aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/imports/controls/Button.qml1
-rw-r--r--src/imports/controls/CheckBox.qml1
-rw-r--r--src/imports/controls/GroupBox.qml1
-rw-r--r--src/imports/controls/RadioButton.qml1
-rw-r--r--src/imports/controls/Switch.qml1
-rw-r--r--src/imports/controls/TabButton.qml4
-rw-r--r--src/imports/controls/ToggleButton.qml1
-rw-r--r--src/imports/controls/ToolButton.qml1
-rw-r--r--tests/manual/fonts/deployment.pri14
-rw-r--r--tests/manual/fonts/fonts.pro14
-rw-r--r--tests/manual/fonts/main.cpp49
-rw-r--r--tests/manual/fonts/main.qml75
-rw-r--r--tests/manual/fonts/qml.qrc6
-rw-r--r--tests/manual/manual.pro3
14 files changed, 170 insertions, 2 deletions
diff --git a/src/imports/controls/Button.qml b/src/imports/controls/Button.qml
index 19934824..5c7eaf04 100644
--- a/src/imports/controls/Button.qml
+++ b/src/imports/controls/Button.qml
@@ -58,6 +58,7 @@ T.Button {
height: control.availableHeight
text: control.text
+ font: control.font
color: control.Theme.selectedTextColor
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
diff --git a/src/imports/controls/CheckBox.qml b/src/imports/controls/CheckBox.qml
index df53fd09..ca61eff3 100644
--- a/src/imports/controls/CheckBox.qml
+++ b/src/imports/controls/CheckBox.qml
@@ -87,6 +87,7 @@ T.CheckBox {
height: control.availableHeight
text: control.text
+ font: control.font
color: control.enabled ? control.Theme.textColor : control.Theme.disabledColor
elide: Text.ElideRight
visible: control.text
diff --git a/src/imports/controls/GroupBox.qml b/src/imports/controls/GroupBox.qml
index 63c0d2ca..ac82a263 100644
--- a/src/imports/controls/GroupBox.qml
+++ b/src/imports/controls/GroupBox.qml
@@ -61,6 +61,7 @@ T.GroupBox {
width: control.availableWidth
text: control.title
+ font: control.font
color: control.enabled ? control.Theme.textColor : control.Theme.disabledColor
elide: Text.ElideRight
horizontalAlignment: Text.AlignLeft
diff --git a/src/imports/controls/RadioButton.qml b/src/imports/controls/RadioButton.qml
index 5c94382f..6e13503b 100644
--- a/src/imports/controls/RadioButton.qml
+++ b/src/imports/controls/RadioButton.qml
@@ -88,6 +88,7 @@ T.RadioButton {
height: control.availableHeight
text: control.text
+ font: control.font
color: control.enabled ? control.Theme.textColor : control.Theme.disabledColor
elide: Text.ElideRight
visible: control.text
diff --git a/src/imports/controls/Switch.qml b/src/imports/controls/Switch.qml
index 0eafc2b2..9c05b9de 100644
--- a/src/imports/controls/Switch.qml
+++ b/src/imports/controls/Switch.qml
@@ -96,6 +96,7 @@ T.Switch {
height: control.availableHeight
text: control.text
+ font: control.font
color: control.enabled ? control.Theme.textColor : control.Theme.disabledColor
elide: Text.ElideRight
visible: control.text
diff --git a/src/imports/controls/TabButton.qml b/src/imports/controls/TabButton.qml
index b1a88b00..0364385a 100644
--- a/src/imports/controls/TabButton.qml
+++ b/src/imports/controls/TabButton.qml
@@ -48,6 +48,8 @@ T.TabButton {
padding: 6
+ font.pointSize: 10
+
//! [label]
label: Text {
x: control.leftPadding
@@ -56,7 +58,7 @@ T.TabButton {
height: control.availableHeight
text: control.text
- font.pointSize: 10
+ font: control.font
elide: Text.ElideRight
color: !control.enabled ? control.Theme.disabledColor : control.pressed ? control.Theme.accentColor : control.Theme.textColor
horizontalAlignment: Text.AlignHCenter
diff --git a/src/imports/controls/ToggleButton.qml b/src/imports/controls/ToggleButton.qml
index e533b154..e5dd2805 100644
--- a/src/imports/controls/ToggleButton.qml
+++ b/src/imports/controls/ToggleButton.qml
@@ -95,6 +95,7 @@ T.ToggleButton {
height: control.availableHeight
text: control.text
+ font: control.font
color: control.enabled ? control.Theme.textColor : control.Theme.disabledColor
elide: Text.ElideRight
visible: control.text
diff --git a/src/imports/controls/ToolButton.qml b/src/imports/controls/ToolButton.qml
index f68653b3..13c9d13f 100644
--- a/src/imports/controls/ToolButton.qml
+++ b/src/imports/controls/ToolButton.qml
@@ -56,6 +56,7 @@ T.ToolButton {
height: control.availableHeight
text: control.text
+ font: control.font
color: control.enabled ? control.Theme.textColor : control.Theme.disabledColor
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
diff --git a/tests/manual/fonts/deployment.pri b/tests/manual/fonts/deployment.pri
new file mode 100644
index 00000000..c89af25a
--- /dev/null
+++ b/tests/manual/fonts/deployment.pri
@@ -0,0 +1,14 @@
+unix:!android {
+ isEmpty(target.path) {
+ qnx {
+ target.path = /tmp/$${TARGET}/bin
+ } else {
+ target.path = /opt/$${TARGET}/bin
+ }
+ export(target.path)
+ }
+ INSTALLS += target
+}
+
+export(INSTALLS)
+
diff --git a/tests/manual/fonts/fonts.pro b/tests/manual/fonts/fonts.pro
new file mode 100644
index 00000000..36e70f7e
--- /dev/null
+++ b/tests/manual/fonts/fonts.pro
@@ -0,0 +1,14 @@
+TEMPLATE = app
+
+QT += qml quick
+
+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)
+
diff --git a/tests/manual/fonts/main.cpp b/tests/manual/fonts/main.cpp
new file mode 100644
index 00000000..9a40ad6d
--- /dev/null
+++ b/tests/manual/fonts/main.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
+
+ return app.exec();
+}
+
diff --git a/tests/manual/fonts/main.qml b/tests/manual/fonts/main.qml
new file mode 100644
index 00000000..11298660
--- /dev/null
+++ b/tests/manual/fonts/main.qml
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+import QtQuick.Controls 2.0
+import QtQuick.Templates 2.0 as T
+import QtQuick.Layouts 1.2
+
+ApplicationWindow {
+ visible: true
+ width: 480
+ height: 640
+ title: qsTr("Hello World")
+
+ T.Control {
+ id: control
+ ColumnLayout {
+ Button { text: "Button" }
+ CheckBox { text: "CheckBox" }
+ GroupBox { title: "GroupBox" }
+ RadioButton { text: "RadioButton" }
+ Switch { text: "Switch" }
+ TabButton {
+ text: "TabButton"
+ font.pointSize: control.font.pointSize
+ }
+ ToggleButton { text: "ToggleButton" }
+ ToolButton { text: "ToolButton" }
+ Slider {
+ from: 16
+ to: 48
+ stepSize: 1
+ onValueChanged: control.font.pointSize = value
+ }
+ }
+ }
+}
+
diff --git a/tests/manual/fonts/qml.qrc b/tests/manual/fonts/qml.qrc
new file mode 100644
index 00000000..0ff3892d
--- /dev/null
+++ b/tests/manual/fonts/qml.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ </qresource>
+</RCC>
+
diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro
index 787b99e1..8dac1b34 100644
--- a/tests/manual/manual.pro
+++ b/tests/manual/manual.pro
@@ -1,3 +1,4 @@
TEMPLATE = subdirs
SUBDIRS += \
- gifs
+ gifs \
+ fonts