开发者

qml send a list/array from signal

how can i create an item that send signal with array of data(ar开发者_StackOverflow中文版ray of numbers), and read it from another item?....


I don't know what you want to do exactly, but here is an example:

import QtQuick 1.0

Item {
    // item with the data
    Item {
        id: otherItem
        property variant numbers: [11, 22, 33]
    }

    // declare signal
    signal mySignal(variant array);

    // send mySignal when component is ready
    Component.onCompleted: mySignal(otherItem.numbers);

    // signal handler
    onMySignal: console.log("mySignal: " + array)
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜