Добавил:
Только когда поступишь в технический вуз поймешь на сколько ты гуманитарий Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Дополнительные материалы.pdf
Скачиваний:
3
Добавлен:
07.06.2025
Размер:
12.29 Mб
Скачать

РАЗРАБОТКА НА QT ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ

SILICALISTVIEW — СПИСОК ЭЛЕМЕНТОВ

SilicaListView { anchors.fill: parent

header: PageHeader { title: qsTr("List Page") } delegate: ListItem {

Label {

text: qsTr("Item %1").arg(model.index + 1) anchors.verticalCenter: parent.verticalCenter x: Theme.horizontalPageMargin

color: highlighted ? Theme.highlightColor : Theme.primaryColor

}

}

model: 100

VerticalScrollDecorator { }

}

community.omprussia.ru/documentation/software_development/reference/silica/silicalistview.html

РАЗРАБОТКА НА QT ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ

КОНТЕЙНЕР-СПИСОК В SILICA: SILICALISTVIEW

ListModel {

id: animalsModel

ListElement { name: "Rat"; size: "Small"; } ListElement { name: "Cat"; size: "Medium"; } ListElement { name: "Rabbit"; size: "Medium"; } ListElement { name: "Elephant"; size: "Large"; }

}

SilicaListView { model: animalsModel

header: PageHeader { title: "Animals" } section {

property: "size"

delegate: SectionHeader { text: section }

}

delegate: Label { text: name; color: "white" }

}

РАЗРАБОТКА НА QT ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ

ЭЛЕМЕНТ СПИСКА В QQC2: ITEMDELEGATE

ListView {

delegate: ItemDelegate { text: modelData width: parent.width

onClicked: console.log("clicked:", modelData)

}

model: Qt.fontFamilies() ScrollIndicator.vertical: ScrollIndicator { }

}

doc.qt.io/qt-5/qml-qtquick-controls2-itemdelegate.html

РАЗРАБОТКА НА QT ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ

SILICAGRIDVIEW — ТАБЛИЦА

SilicaGridView { anchors.fill: parent

header: PageHeader { title: qsTr("SilicaGridView") } cellWidth: width / 4

cellHeight: cellWidth

delegate: Label {

width: GridView.view.cellWidth height: GridView.view.cellHeight text: (model.index + 1)

color: Theme.highlightColor verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter

}

model: 100

VerticalScrollDecorator { }

}

community.omprussia.ru/documentation/software_development/reference/silica/silicagridview.html