应用及案例
Qt是跨平台UI框架
WPS Autodesk Maya 极品飞车是Qt开发的
医疗设备软件选择Qt开发 缘于极致性能及可靠性
slot vs signal
Qt creator
Delegate Model
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
| ListView {
id: listview
Layout.fillWidth: true
height: 80
orientation: ListView.Horizontal
spacing: 15
displaced: Transition {
NumberAnimation {
properties: "x,y"
easing.type: Easing.OutQuad
}
} model: DelegateModel {
id: visualModel
model: selectedItems
delegate: DropArea {
id: delegateRoot
width: tt.width
height: tt.height onEntered: function (drag) {
visualModel.items.move(drag.source.curIndex, tt.curIndex)
}
property int visualIndex: DelegateModel.itemsIndex DraggableIcon {
id: tt
dragParent: listview
curIndex: delegateRoot.visualIndex
sourceImg: source
keyImg: key
}
}
}
}
|