add first qml files
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
TEMPLATE = app
|
||||
QT += core qml quick widgets
|
||||
|
||||
DEFINES += QML_CLIENT
|
||||
|
||||
INCLUDEPATH += \
|
||||
src/gui/qml \
|
||||
src/gui/qml/views
|
||||
|
||||
DEPENDPATH += \
|
||||
src \
|
||||
src/gui/qml \
|
||||
src/gui/qml/views
|
||||
|
||||
RESOURCES += src/gui/qml/views/qml.qrc
|
||||
|
||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||
QML_IMPORT_PATH = src/gui/qml/views/
|
||||
|
||||
# Default rules for deployment.
|
||||
include(src/gui/qml/views/deployment.pri)
|
||||
|
||||
HEADERS += \
|
||||
src/gui/qml/qmlwrapper.h \
|
||||
src/gui/qml/views/startview/startview.h \
|
||||
|
||||
SOURCES += \
|
||||
src/pokerth.cpp \
|
||||
src/gui/qml/qmlwrapper.cpp \
|
||||
src/gui/qml/views/startview/startview.cpp
|
||||
@@ -0,0 +1,19 @@
|
||||
#include <QtCore>
|
||||
#include "qmlwrapper.h"
|
||||
|
||||
#include "views/startview/startview.h"
|
||||
|
||||
|
||||
qmlWrapper::qmlWrapper()
|
||||
{
|
||||
qDebug("qmlWrapperKonstruktor");
|
||||
|
||||
startView myStartView;
|
||||
myStartView.show();
|
||||
}
|
||||
|
||||
qmlWrapper::~qmlWrapper()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef QMLWRAPPER_H
|
||||
#define QMLWRAPPER_H
|
||||
|
||||
|
||||
class qmlWrapper
|
||||
{
|
||||
public:
|
||||
qmlWrapper();
|
||||
~qmlWrapper();
|
||||
};
|
||||
|
||||
#endif // QMLWRAPPER_H
|
||||
@@ -0,0 +1,31 @@
|
||||
import QtQuick 2.4
|
||||
import QtQuick.Controls 1.3
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
Item {
|
||||
width: 640
|
||||
height: 480
|
||||
|
||||
property alias button3: button3
|
||||
property alias button2: button2
|
||||
property alias button1: button1
|
||||
|
||||
RowLayout {
|
||||
anchors.centerIn: parent
|
||||
|
||||
Button {
|
||||
id: button1
|
||||
text: qsTr("Press Me 1")
|
||||
}
|
||||
|
||||
Button {
|
||||
id: button2
|
||||
text: qsTr("Press Me 2")
|
||||
}
|
||||
|
||||
Button {
|
||||
id: button3
|
||||
text: qsTr("Press Me 3")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
android-no-sdk {
|
||||
target.path = /data/user/qt
|
||||
export(target.path)
|
||||
INSTALLS += target
|
||||
} else:android {
|
||||
x86 {
|
||||
target.path = /libs/x86
|
||||
} else: armeabi-v7a {
|
||||
target.path = /libs/armeabi-v7a
|
||||
} else {
|
||||
target.path = /libs/armeabi
|
||||
}
|
||||
export(target.path)
|
||||
INSTALLS += target
|
||||
} else:unix {
|
||||
isEmpty(target.path) {
|
||||
qnx {
|
||||
target.path = /tmp/$${TARGET}/bin
|
||||
} else {
|
||||
target.path = /opt/$${TARGET}/bin
|
||||
}
|
||||
export(target.path)
|
||||
}
|
||||
INSTALLS += target
|
||||
}
|
||||
|
||||
export(INSTALLS)
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <QApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import QtQuick 2.4
|
||||
import QtQuick.Controls 1.3
|
||||
import QtQuick.Window 2.2
|
||||
import QtQuick.Dialogs 1.2
|
||||
|
||||
ApplicationWindow {
|
||||
title: qsTr("Hello World")
|
||||
width: 640
|
||||
height: 480
|
||||
visible: true
|
||||
|
||||
menuBar: MenuBar {
|
||||
Menu {
|
||||
title: qsTr("&File")
|
||||
MenuItem {
|
||||
text: qsTr("&Open")
|
||||
onTriggered: messageDialog.show(qsTr("Open action triggered"));
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("E&xit")
|
||||
onTriggered: Qt.quit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MainForm {
|
||||
anchors.fill: parent
|
||||
button1.onClicked: messageDialog.show(qsTr("Button 1 pressed"))
|
||||
button2.onClicked: messageDialog.show(qsTr("Button 2 pressed"))
|
||||
button3.onClicked: messageDialog.show(qsTr("Button 3 pressed"))
|
||||
}
|
||||
|
||||
MessageDialog {
|
||||
id: messageDialog
|
||||
title: qsTr("May I have your attention, please?")
|
||||
|
||||
function show(caption) {
|
||||
messageDialog.text = caption;
|
||||
messageDialog.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>main.qml</file>
|
||||
<file>MainForm.ui.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -0,0 +1,19 @@
|
||||
#include <QQmlApplicationEngine>
|
||||
#include "startview.h"
|
||||
|
||||
startView::startView()
|
||||
{
|
||||
qDebug("startViewKonstruktor");
|
||||
myEngine = new QQmlApplicationEngine();
|
||||
}
|
||||
|
||||
startView::~startView()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void startView::show()
|
||||
{
|
||||
qDebug("show mal bitte");
|
||||
myEngine->load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef STARTVIEW_H
|
||||
#define STARTVIEW_H
|
||||
|
||||
class QQmlApplicationEngine;
|
||||
class startView
|
||||
{
|
||||
public:
|
||||
startView();
|
||||
~startView();
|
||||
|
||||
void show();
|
||||
|
||||
private:
|
||||
QQmlApplicationEngine *myEngine;
|
||||
};
|
||||
|
||||
#endif // STARTVIEW_H
|
||||
Reference in New Issue
Block a user