# HG changeset patch # User sl # Date 1401184847 -7200 # Node ID c0e13d2503b9aae7244aded4e96138048854ad56 First contribution. Here is a basic QtQuick application based on Qt 5.3. diff -r 000000000000 -r c0e13d2503b9 FontsTab.qml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FontsTab.qml Tue May 27 12:00:47 2014 +0200 @@ -0,0 +1,96 @@ +import QtQuick 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Dialogs 1.1 + +Item { + width: 640 + height: 480 + //SystemPalette { id: palette } + clip: true + + + // + FontDialog { + id: fontDialog + visible: false + modality: Qt.WindowModal + scalableFonts: fontDialogScalableFonts.checked + nonScalableFonts: fontDialogNonScalableFonts.checked + monospacedFonts: fontDialogMonospacedFonts.checked + proportionalFonts: fontDialogProportionalFonts.checked + title: qsTr("Choose a font") + font: Qt.font({ family: "Arial", pointSize: 24, weight: Font.Normal }) + currentFont: Qt.font({ family: "Arial", pointSize: 24, weight: Font.Normal }) + onCurrentFontChanged: { console.log("CurrentFontChanged: " + currentFont) } + onAccepted: { console.log("Accepted: " + font) } + onRejected: { console.log("Rejected") } + } + // + + Flow { + anchors.fill: parent + anchors.margins: 12 + spacing: 10 + + CheckBox { + id: fontDialogScalableFonts + text: "Scalable fonts" + Binding on checked { value: fontDialog.scalableFonts } + } + CheckBox { + id: fontDialogNonScalableFonts + text: "Non scalable fonts" + Binding on checked { value: fontDialog.nonScalableFonts } + } + CheckBox { + id: fontDialogMonospacedFonts + text: "Monospaced fonts" + Binding on checked { value: fontDialog.monospacedFonts } + } + CheckBox { + id: fontDialogProportionalFonts + text: "Proportional fonts" + Binding on checked { value: fontDialog.proportionalFonts } + } + + Text { + text: "Current font:" + } + + Text { + id: fontLabel + color: palette.windowText + text: "" + fontDialog.font.family + " - " + fontDialog.font.pointSize + "" + MouseArea { + anchors.fill: parent + onClicked: fontDialog.open() + } + } + + Text { + id: textFontDemoLowerCase + text: "abcdefghijklmnopqrstyvwxyz" + font: fontDialog.font + } + + Text { + id: textFontDemoUpperCase + text: "ABCDEFGHIJKLMNOPQRSTYVWXYZ" + font: fontDialog.font + } + + Text { + id: textFontDemoDigits + text: "0123456789" + font: fontDialog.font + } + + + Button { + text: qsTr("Select Font") + onClicked: fontDialog.open() + } + + + } +} diff -r 000000000000 -r c0e13d2503b9 MiniDisplayManager.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MiniDisplayManager.pro Tue May 27 12:00:47 2014 +0200 @@ -0,0 +1,19 @@ +TEMPLATE = app + +QT += qml quick widgets + +SOURCES += main.cpp + +RESOURCES += \ + qml.qrc + +# Additional import path used to resolve QML modules in Qt Creator's code model +QML_IMPORT_PATH = + +# Default rules for deployment. +include(deployment.pri) + +OTHER_FILES += \ + FontsTab.qml \ + main.qml \ + TestsTab.qml diff -r 000000000000 -r c0e13d2503b9 MiniDisplayManager.pro.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MiniDisplayManager.pro.user Tue May 27 12:00:47 2014 +0200 @@ -0,0 +1,251 @@ + + + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.3.0 MSVC2012 OpenGL 32bit + Desktop Qt 5.3.0 MSVC2012 OpenGL 32bit + qt.53.win32_msvc2012_opengl_kit + 0 + 0 + 0 + + D:/Dev/Qt/build-MiniDisplayManager-Desktop_Qt_5_3_0_MSVC2012_OpenGL_32bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + D:/Dev/Qt/build-MiniDisplayManager-Desktop_Qt_5_3_0_MSVC2012_OpenGL_32bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 2 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + MiniDisplayManager + + Qt4ProjectManager.Qt4RunConfiguration:D:/Dev/Qt/MiniDisplayManager/MiniDisplayManager.pro + + MiniDisplayManager.pro + false + false + + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.EnvironmentId + {acc65bd0-f32a-4e5c-a5a8-5fb52e4a9cd9} + + + ProjectExplorer.Project.Updater.FileVersion + 15 + + diff -r 000000000000 -r c0e13d2503b9 TestsTab.qml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TestsTab.qml Tue May 27 12:00:47 2014 +0200 @@ -0,0 +1,10 @@ +import QtQuick 2.2 +import QtQuick.Controls 1.2 + +Item { + width: 100 + height: 62 + //SystemPalette { id: palette } + clip: true + +} diff -r 000000000000 -r c0e13d2503b9 deployment.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deployment.pri Tue May 27 12:00:47 2014 +0200 @@ -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) diff -r 000000000000 -r c0e13d2503b9 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue May 27 12:00:47 2014 +0200 @@ -0,0 +1,38 @@ +/* +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); + + return app.exec(); +} +*/ + +#include "qtquickcontrolsapplication.h" +#include +#include + +int main(int argc, char *argv[]) +{ + QtQuickControlsApplication app(argc, argv); + //Specifying the following properties was needed for persistent settings to work + app.setOrganizationName("Slions"); + app.setOrganizationDomain("Slions.com"); + app.setApplicationName("MiniDisplay Manager"); + + //Override system palette + //QPalette customPalette = app.palette(); + //customPalette.setColor(QPalette::Window, QColor("red")); + //customPalette.setColor(QPalette::Base, QColor("red")); + //customPalette.setColor(QPalette::AlternateBase, QColor("red")); + //app.setPalette(customPalette); + // + + QQmlApplicationEngine engine(QUrl("qrc:///main.qml")); + return app.exec(); +} diff -r 000000000000 -r c0e13d2503b9 main.qml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.qml Tue May 27 12:00:47 2014 +0200 @@ -0,0 +1,51 @@ +import QtQuick 2.2 +import QtQuick.Controls 1.2 +import QtPositioning 5.3 +import QtWinExtras 1.0 +import QtQuick.Dialogs 1.2 +import QtQuick.Window 2.1 +import Qt.labs.settings 1.0 + + + +ApplicationWindow { + id: appWindow + visible: true + width: 640 + height: 480 + title: qsTr("MiniDisplay Manager") + SystemPalette { id: palette } + + Settings { + property alias x: appWindow.x + property alias y: appWindow.y + property alias width: appWindow.width + property alias height: appWindow.height + } + + /* + menuBar: MenuBar { + Menu { + title: qsTr("File") + MenuItem { + text: qsTr("Exit") + onTriggered: Qt.quit(); + } + } + + }*/ + + TabView { + anchors.fill: parent + anchors.margins: 8 + Tab { + title: qsTr("Fonts") + FontsTab { anchors.fill: parent } + } + Tab { + title: qsTr("Tests") + TestsTab { anchors.fill: parent } + } + + } +} diff -r 000000000000 -r c0e13d2503b9 qml.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qml.qrc Tue May 27 12:00:47 2014 +0200 @@ -0,0 +1,7 @@ + + + main.qml + FontsTab.qml + TestsTab.qml + + diff -r 000000000000 -r c0e13d2503b9 qtquickcontrolsapplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtquickcontrolsapplication.h Tue May 27 12:00:47 2014 +0200 @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Quick Controls module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTQUICKCONTROLSAPPLICATION_H +#define QTQUICKCONTROLSAPPLICATION_H + +#ifdef QT_WIDGETS_LIB +#include +#else +#include +#endif + +QT_BEGIN_NAMESPACE + +#ifdef QT_WIDGETS_LIB +#define QtQuickControlsApplication QApplication +#else +#define QtQuickControlsApplication QGuiApplication +#endif + +QT_END_NAMESPACE + +#endif // QTQUICKCONTROLSAPPLICATION_H