Commit b6bb37c2 authored by Leander Schulten's avatar Leander Schulten
Browse files

Start with QML/Testing

parent 82b16c1c
QT += core
QT -= gui
QT += qml quick
CONFIG += c++14
TARGET = Lichtsteuerung
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
SOURCES += main.cpp \
deviceprototype.cpp \
channel.cpp \
......@@ -46,3 +51,11 @@ HEADERS += \
syncservice.h \
dmxchannelfilter.h \
usermanagment.h
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
SwipeView {
id: swipeView
anchors.fill: parent
currentIndex: tabBar.currentIndex
Page{
Rectangle{
height: 100
width: 100
anchors.centerIn: parent
color: "red"
}
}
Page {
Label {
text: qsTr("Second page")
anchors.centerIn: parent
}
Button{
contentItem: Text {
id: testwe
text: qsTr("text");
rotation: 90
}
}
}
}
footer:TabBar {
id: tabBar
currentIndex: swipeView.currentIndex
TabButton {
text: qsTr("First")
}
TabButton {
text: qsTr("Second")
}
}
}
......@@ -5,32 +5,45 @@
#include "channel.h"
#include "applicationdata.h"
#include "programm.h"
#include <QMetaProperty>
#include "dmxchannelfilter.h"
#include <chrono>
#include <QEasingCurve>
#include <cmath>
#include <QCryptographicHash>
#include "usermanagment.h"
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
const auto filename = "QTJSONFile.json";
QFile file(filename);
auto model = IDBaseDataModel<Channel>::singletone();
ApplicationData::loadData(file);
//ProgrammPrototype p(*IDBase<DevicePrototype>::getAllIDBases().begin(), "Test","Mein erstes Programm");
Programm p("Mein erstes Programm");
p.addDeviceProgramm(*IDBase<Device>::getAllIDBases().begin(),*IDBase<ProgrammPrototype>::getAllIDBases().begin(),0.5);
//DevicePrototype c("Scanner");
//c.addChannel(0,"Speed");
//c.addChannel(1,"RED");
//c.addChannel(2,"GREEN");
//c.addChannel(3,"BLUE");
new Channel(1);
new Channel(3);
delete new Channel(2);
QCoreApplication a(argc, argv);
ID id;
qDebug() << model->rowCount()<<'\n';
for(int i = 0 ; i < model->rowCount();++i){
qDebug() << model->data(model->index(i))<<'\n';
}
ApplicationData::saveData(file);
//IDBase<Device>::deleter.hello();
//IDBase<Channel>::deleter.hello();
qDebug() << "Hello ich bin cooler \n"<<id.value()<<' '<<IDBase<Device>::getIDBaseObjectByID(0)<<'\n';
//return a.exec();
return 0;
QQmlApplicationEngine engine;
engine.load(QUrl(QLatin1String("qrc:/Test.qml")));
return app.exec();
}
<RCC>
<qresource prefix="/">
<file>Test.qml</file>
<file>qtquickcontrols2.conf</file>
</qresource>
</RCC>
; This file can be edited to change the style of the application
; See Styling Qt Quick Controls 2 in the documentation for details:
; http://doc.qt.io/qt-5/qtquickcontrols2-styles.html
[Controls]
Style=Material
[Universal]
Theme=Light
;Accent=Steel
[Material]
Theme=Light
;Accent=BlueGrey
;Primary=BlueGray
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment