Fixed resource compilation
This commit is contained in:
@ -4,14 +4,12 @@ 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
|
||||
@ -23,6 +21,10 @@ qt_add_executable(applightcontrol
|
||||
|
||||
qt_add_qml_module(applightcontrol
|
||||
URI lightcontrol
|
||||
RESOURCES
|
||||
icons/movinghead.png
|
||||
icons/nebelmaschine.png
|
||||
icons/rgbstrahler.png
|
||||
VERSION 1.0
|
||||
QML_FILES
|
||||
main.qml
|
||||
|
@ -8,14 +8,6 @@ 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
|
||||
Layout.fillHeight: true
|
||||
@ -70,9 +62,9 @@ ColumnLayout {
|
||||
}
|
||||
model: ListModel {
|
||||
id: cbItems
|
||||
ListElement { imageSource: ":/lightcontrol/icons/movinghead.png" }
|
||||
ListElement { imageSource: ":/lightcontrol/icons/nebelmaschine.png" }
|
||||
ListElement { imageSource: ":/lightcontrol/icons/rgbstrahler.png" }
|
||||
ListElement { imageSource: "qrc:/lightcontrol/icons/movinghead.png" }
|
||||
ListElement { imageSource: "qrc:/lightcontrol/icons/nebelmaschine.png" }
|
||||
ListElement { imageSource: "qrc:/lightcontrol/icons/rgbstrahler.png" }
|
||||
}
|
||||
}
|
||||
Label { text: qsTr("Registers:") }
|
||||
|
@ -172,26 +172,26 @@ bool DeviceTypeRegistersModel::setData(const QModelIndex &index, const QVariant
|
||||
if (!index.isValid())
|
||||
{
|
||||
qWarning() << "hilfe" << __LINE__;
|
||||
return {};
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!m_controller)
|
||||
{
|
||||
qWarning() << "hilfe" << __LINE__;
|
||||
return {};
|
||||
return true;
|
||||
}
|
||||
|
||||
if (m_deviceTypeId == -1)
|
||||
{
|
||||
qWarning() << "hilfe" << __LINE__;
|
||||
return {};
|
||||
return true;
|
||||
}
|
||||
|
||||
auto deviceTypePtr = m_controller->lightProject().deviceTypes.findById(m_deviceTypeId);
|
||||
if (!deviceTypePtr)
|
||||
{
|
||||
qWarning() << "hilfe" << __LINE__;
|
||||
return {};
|
||||
return true;
|
||||
}
|
||||
|
||||
auto &deviceType = *deviceTypePtr;
|
||||
@ -199,24 +199,25 @@ bool DeviceTypeRegistersModel::setData(const QModelIndex &index, const QVariant
|
||||
if (index.row() < 0 || index.row() >= deviceType.registers.size())
|
||||
{
|
||||
qWarning() << "hilfe" << __LINE__;
|
||||
return {};
|
||||
return true;
|
||||
}
|
||||
|
||||
if (index.column() != 0)
|
||||
{
|
||||
qWarning() << "hilfe" << __LINE__;
|
||||
return {};
|
||||
return true;
|
||||
}
|
||||
|
||||
qDebug() << value.value<DeviceTypeRegisterType>();
|
||||
|
||||
auto &deviceTypeRegister = deviceType.registers.at(index.row());
|
||||
|
||||
deviceTypeRegister.type = value.value<DeviceTypeRegisterType>();
|
||||
emit dataChanged(index, index, { Qt::DisplayRole, Qt::EditRole });
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DeviceTypeRegistersModel::removeRows(int row, int count, const QModelIndex &parent)
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
@ -26,6 +26,7 @@ public:
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
|
||||
bool removeRows(int row, int count, const QModelIndex &parent) override;
|
||||
|
||||
signals:
|
||||
void controllerChanged(DmxController *controller);
|
||||
|
3
main.cpp
3
main.cpp
@ -3,6 +3,7 @@
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
|
||||
#include "dmxcontroller.h"
|
||||
|
||||
@ -23,6 +24,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
QGuiApplication app{argc, argv};
|
||||
|
||||
qDebug() << QDir{":/lightcontrol"}.entryInfoList();
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.addHelpOption();
|
||||
parser.addVersionOption();
|
||||
|
@ -1,7 +0,0 @@
|
||||
<RCC>
|
||||
<qresource prefix="/lightcontrol">
|
||||
<file>icons/movinghead.png</file>
|
||||
<file>icons/nebelmaschine.png</file>
|
||||
<file>icons/rgbstrahler.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
Reference in New Issue
Block a user