diff --git a/tests/QtQuickControls2Application/Page1.qml b/tests/QtQuickControls2Application/Page1.qml new file mode 100644 index 0000000..02ac22e --- /dev/null +++ b/tests/QtQuickControls2Application/Page1.qml @@ -0,0 +1,7 @@ +import QtQuick 2.7 + +Page1Form { + button1.onClicked: { + console.log("Button Pressed. Entered text: " + textField1.text); + } +} diff --git a/tests/QtQuickControls2Application/Page1Form.ui.qml b/tests/QtQuickControls2Application/Page1Form.ui.qml new file mode 100644 index 0000000..d3c54d2 --- /dev/null +++ b/tests/QtQuickControls2Application/Page1Form.ui.qml @@ -0,0 +1,24 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.0 + +Item { + property alias textField1: textField1 + property alias button1: button1 + + RowLayout { + anchors.horizontalCenter: parent.horizontalCenter + anchors.topMargin: 20 + anchors.top: parent.top + + TextField { + id: textField1 + placeholderText: qsTr("Text Field") + } + + Button { + id: button1 + text: qsTr("Press Me") + } + } +} diff --git a/tests/QtQuickControls2Application/QtQuickControls2Application.pro b/tests/QtQuickControls2Application/QtQuickControls2Application.pro new file mode 100644 index 0000000..d0d4cd2 --- /dev/null +++ b/tests/QtQuickControls2Application/QtQuickControls2Application.pro @@ -0,0 +1,29 @@ +QT += qml quick + +CONFIG += c++11 + +SOURCES += main.cpp + +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 = + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which as been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if you use deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target diff --git a/tests/QtQuickControls2Application/main.cpp b/tests/QtQuickControls2Application/main.cpp new file mode 100644 index 0000000..34614e7 --- /dev/null +++ b/tests/QtQuickControls2Application/main.cpp @@ -0,0 +1,13 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + engine.load(QUrl(QLatin1String("qrc:/main.qml"))); + + return app.exec(); +} diff --git a/tests/QtQuickControls2Application/main.qml b/tests/QtQuickControls2Application/main.qml new file mode 100644 index 0000000..9e0707a --- /dev/null +++ b/tests/QtQuickControls2Application/main.qml @@ -0,0 +1,37 @@ +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 + + Page1 { + } + + Page { + Label { + text: qsTr("Second page") + anchors.centerIn: parent + } + } + } + + footer: TabBar { + id: tabBar + currentIndex: swipeView.currentIndex + TabButton { + text: qsTr("First") + } + TabButton { + text: qsTr("Second") + } + } +} diff --git a/tests/QtQuickControls2Application/qml.qrc b/tests/QtQuickControls2Application/qml.qrc new file mode 100644 index 0000000..44587bd --- /dev/null +++ b/tests/QtQuickControls2Application/qml.qrc @@ -0,0 +1,8 @@ + + + main.qml + Page1.qml + Page1Form.ui.qml + qtquickcontrols2.conf + + diff --git a/tests/QtQuickControls2Application/qtquickcontrols2.conf b/tests/QtQuickControls2Application/qtquickcontrols2.conf new file mode 100644 index 0000000..1764b16 --- /dev/null +++ b/tests/QtQuickControls2Application/qtquickcontrols2.conf @@ -0,0 +1,15 @@ +; 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=Default + +[Universal] +Theme=Light +;Accent=Steel + +[Material] +Theme=Light +;Accent=BlueGrey +;Primary=BlueGray diff --git a/tests/tests.sh b/tests/tests.sh index 592fefc..828d743 100644 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -1,13 +1,15 @@ #!/bin/bash -# Build the sample Qt Widgets Application that comes with Qt Creator - # Workaround for: # https://github.com/probonopd/linuxdeployqt/issues/65 unset QT_PLUGIN_PATH unset LD_LIBRARY_PATH unset QTDIR +############################################################################### +# Build the sample Qt Widgets Application that comes with Qt Creator +############################################################################### + cd tests/QtWidgetsApplication/ if [ -e build/ ] ; then rm -rf build/ @@ -36,3 +38,36 @@ sleep 10 killall QtWidgetsApplication && echo "SUCCESS" cd ../../../ + +############################################################################### +# Build the sample Qt Quick Controls 2 Application that comes with Qt Creator +############################################################################### + +cd tests/QtQuickControls2Application/ +if [ -e build/ ] ; then + rm -rf build/ +fi +mkdir build +cd build/ +qmake ../QtQuickControls2Application.pro +make -j2 +rm *.o *.cpp *.h Makefile +mkdir -p nonfhs fhs/usr/bin + +cp QtQuickControls2Application nonfhs/ +../../../linuxdeployqt-*-x86_64.AppImage nonfhs/QtQuickControls2Application -qmldir=../ +ldd nonfhs/QtWidgetsApplication +find nonfhs/ +LD_DEBUG=libs nonfhs/QtQuickControls2Application & +sleep 10 +killall QtQuickControls2Application && echo "SUCCESS" + +cp QtQuickControls2Application fhs/usr/bin/ +../../../linuxdeployqt-*-x86_64.AppImage fhs/usr/bin/QtQuickControls2Application -qmldir=../ +ldd fhs/usr/bin/QtQuickControls2Application +find fhs/ +LD_DEBUG=libs fhs/usr/bin/QtQuickControls2Application & +sleep 10 +killall QtQuickControls2Application && echo "SUCCESS" + +cd ../../../