WIP icon combobox

This commit is contained in:
Michael Ehrenreich
2023-02-18 18:45:32 +01:00
parent 14af9d0093
commit bf96d4d0fe
6 changed files with 36 additions and 0 deletions

View File

@ -4,12 +4,14 @@ project(lightcontrol VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
find_package(Qt6 6.2 REQUIRED COMPONENTS SerialPort Quick)
qt_add_executable(applightcontrol
resources.qrc
main.cpp
devicetypesmodel.h devicetypesmodel.cpp
dmxcontroller.h dmxcontroller.cpp

View File

@ -8,6 +8,13 @@ ColumnLayout {
Label {
text: qsTr("Device Types Settings")
}
Image {
height: 64
width: 64
source: ":/lightcontrol/icons/movinghead.png"
onStatusChanged: console.log(status)
Component.onCompleted: console.log(status)
}
RowLayout {
//Layout.fillWidth: true
@ -48,6 +55,26 @@ ColumnLayout {
text: listView.currentData.name
onTextEdited: listView.currentData.name = text
}
Label { text: qsTr("Icon:") }
ComboBox {
Layout.fillWidth: true
id: iconCombobox
//textRole: "imageSource"
//valueRole: "imageSource"
//currentIndex: iconCombobox.indexOfValue(listView.currentData.deviceTypeId)
//onActivated: if (listView.currentData) listView.currentData.deviceTypeId = currentValue; else console.warn('discarded');
delegate: Image {
height: 64
fillMode: Image.PreserveAspectFit
source: imageSource
}
model: ListModel {
id: cbItems
ListElement { imageSource: ":/lightcontrol/icons/movinghead.png" }
ListElement { imageSource: ":/lightcontrol/icons/nebelmaschine.png" }
ListElement { imageSource: ":/lightcontrol/icons/rgbstrahler.png" }
}
}
Label { text: qsTr("Registers:") }
RegistersSettingsItem {
Layout.fillWidth: true

BIN
icons/movinghead.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
icons/nebelmaschine.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
icons/rgbstrahler.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

7
resources.qrc Normal file
View File

@ -0,0 +1,7 @@
<RCC>
<qresource prefix="/lightcontrol">
<file>icons/movinghead.png</file>
<file>icons/nebelmaschine.png</file>
<file>icons/rgbstrahler.png</file>
</qresource>
</RCC>