aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dist/changes-5.1.03
-rw-r--r--examples/quick/demos/calqlatr/calqlatr.pro19
-rw-r--r--examples/quick/demos/calqlatr/calqlatr.qml11
-rw-r--r--examples/quick/demos/calqlatr/content/Display.qml20
-rw-r--r--examples/quick/demos/calqlatr/content/NumberPad.qml2
-rw-r--r--examples/quick/demos/calqlatr/content/calculator.js8
-rw-r--r--examples/quick/dialogs/colorandfiledialogs/ColorDialogs.qml (renamed from examples/quick/dialogs/ColorDialogs.qml)2
-rw-r--r--examples/quick/dialogs/colorandfiledialogs/FileDialogs.qml (renamed from examples/quick/dialogs/FileDialogs.qml)2
-rw-r--r--examples/quick/dialogs/colorandfiledialogs/colorandfiledialogs.pro17
-rw-r--r--examples/quick/dialogs/colorandfiledialogs/colorandfiledialogs.qrc (renamed from examples/quick/dialogs/dialogs.qrc)0
-rw-r--r--examples/quick/dialogs/colorandfiledialogs/dialogs.qml (renamed from examples/quick/dialogs/dialogs.qml)0
-rw-r--r--examples/quick/dialogs/colorandfiledialogs/doc/images/qml-colorandfiledialogs-example.jpgbin0 -> 47413 bytes
-rw-r--r--examples/quick/dialogs/colorandfiledialogs/doc/src/colorandfiledialogs.qdoc44
-rw-r--r--examples/quick/dialogs/colorandfiledialogs/main.cpp (renamed from examples/quick/dialogs/main.cpp)2
-rw-r--r--examples/quick/dialogs/dialogs.pro19
-rw-r--r--examples/quick/window/Splash.qml11
-rw-r--r--examples/quick/window/main.cpp2
-rw-r--r--examples/quick/window/window.qml7
-rw-r--r--src/imports/dialogs/dialogs.pro2
-rw-r--r--src/imports/dialogs/doc/qtquickdialogs.qdocconf37
-rw-r--r--src/imports/dialogs/doc/src/qtquickdialogs-examples.qdoc36
-rw-r--r--src/imports/dialogs/doc/src/qtquickdialogs-index.qdoc58
-rw-r--r--src/imports/dialogs/plugin.cpp27
-rw-r--r--src/imports/testlib/TestCase.qml5
-rw-r--r--src/plugins/accessible/quick/qaccessiblequickview.cpp6
-rw-r--r--src/qml/animations/qsequentialanimationgroupjob.cpp4
-rw-r--r--src/qml/doc/src/whatsnew.qdoc23
-rw-r--r--src/qml/types/qqmllistmodel.cpp8
-rw-r--r--src/quick/doc/qtquick.qdocconf5
-rw-r--r--src/quick/doc/src/concepts/positioning/layouts.qdoc8
-rw-r--r--src/quick/doc/src/concepts/positioning/topic.qdoc25
-rw-r--r--src/quick/doc/src/qmltypereference.qdoc6
-rw-r--r--src/quick/doc/src/qtquick.qdoc2
-rw-r--r--src/quick/doc/src/tutorial.qdoc2
-rw-r--r--src/quick/items/qquickitem.cpp4
-rw-r--r--src/quick/items/qquickpositioners.cpp14
-rw-r--r--src/quick/items/qquickshadereffect.cpp4
-rw-r--r--src/quick/items/qquickshadereffectsource.cpp2
-rw-r--r--src/quick/items/qquicktext.cpp5
-rw-r--r--src/quick/items/qquickwindow.cpp31
-rw-r--r--src/quick/items/qquickwindow.h3
-rw-r--r--src/quick/items/qquickwindow_p.h2
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp15
-rw-r--r--tests/auto/quick/qquicktext/data/elideBeforeMaximumLineCount.qml10
-rw-r--r--tests/auto/quick/qquicktext/tst_qquicktext.cpp14
45 files changed, 415 insertions, 112 deletions
diff --git a/dist/changes-5.1.0 b/dist/changes-5.1.0
index 50bdc2f9f8..8633d22eef 100644
--- a/dist/changes-5.1.0
+++ b/dist/changes-5.1.0
@@ -43,6 +43,9 @@ Third party components
as count, which are based off of the data model will no longer update
immediately if queried. Updates are batched to happen once per frame (or
when properties are being set).
+
+ - tryCompare now correctly fails when it only gets two parameters
+
****************************************************************************
* Library *
****************************************************************************
diff --git a/examples/quick/demos/calqlatr/calqlatr.pro b/examples/quick/demos/calqlatr/calqlatr.pro
index 1b002a5f27..91d52a293e 100644
--- a/examples/quick/demos/calqlatr/calqlatr.pro
+++ b/examples/quick/demos/calqlatr/calqlatr.pro
@@ -6,5 +6,24 @@ SOURCES += main.cpp
RESOURCES += calqlatr.qrc \
../../shared/shared.qrc
+OTHER_FILES = calqlatr.qml \
+ content/Button.qml \
+ content/Display.qml \
+ content/NumberPad.qml \
+ content/StyleLabel.qml \
+ content/audio/touch.wav \
+ content/calculator.js \
+ content/images/icon-back.png \
+ content/images/icon-close.png \
+ content/images/icon-settings.png \
+ content/images/logo.png \
+ content/images/paper-edge-left.png \
+ content/images/paper-edge-right.png \
+ content/images/paper-grip.png \
+ content/images/settings-selected-a.png \
+ content/images/settings-selected-b.png \
+ content/images/touch-green.png \
+ content/images/touch-white.png
+
target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/calqlatr
INSTALLS += target
diff --git a/examples/quick/demos/calqlatr/calqlatr.qml b/examples/quick/demos/calqlatr/calqlatr.qml
index 16b2e19724..0a092c25da 100644
--- a/examples/quick/demos/calqlatr/calqlatr.qml
+++ b/examples/quick/demos/calqlatr/calqlatr.qml
@@ -57,7 +57,7 @@ Rectangle {
Item {
id: pad
- width: window.width * 0.58
+ width: 180
NumberPad { y: 10; anchors.horizontalCenter: parent.horizontalCenter }
}
@@ -77,7 +77,7 @@ Rectangle {
Display {
id: display
x: -16
- width: window.width * 0.42
+ width: window.width - pad.width
height: parent.height
MouseArea {
@@ -85,7 +85,12 @@ Rectangle {
property real oldP: 0
property bool rewind: false
- anchors.fill: parent
+ anchors {
+ bottom: parent.bottom
+ left: parent.left
+ right: parent.right
+ }
+ height: 50
onPositionChanged: {
var reverse = startX > window.width / 2
var mx = mapToItem(window, mouse.x).x
diff --git a/examples/quick/demos/calqlatr/content/Display.qml b/examples/quick/demos/calqlatr/content/Display.qml
index 4a78a3ebcd..ec8edfea66 100644
--- a/examples/quick/demos/calqlatr/content/Display.qml
+++ b/examples/quick/demos/calqlatr/content/Display.qml
@@ -42,23 +42,38 @@ import QtQuick 2.0
Item {
id: display
+ property bool enteringDigits: false
function displayOperator(operator)
{
listView.model.append({ "operator": operator, "operand": "" })
+ enteringDigits = true
}
function newLine(operator, operand)
{
listView.model.append({ "operator": operator, "operand": operand })
+ enteringDigits = false
+ listView.positionViewAtEnd()
}
function appendDigit(digit)
{
- if (!listView.model.count)
+ if (!enteringDigits)
listView.model.append({ "operator": "", "operand": "" })
var i = listView.model.count - 1;
listView.model.get(i).operand = listView.model.get(i).operand + digit;
+ enteringDigits = true
+ }
+
+ function clear()
+ {
+ if (enteringDigits) {
+ var i = listView.model.count - 1
+ if (i >= 0)
+ listView.model.remove(i)
+ enteringDigits = false
+ }
}
Item {
@@ -87,6 +102,7 @@ Item {
}
Image {
+ id: grip
source: "images/paper-grip.png"
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
@@ -97,7 +113,7 @@ Item {
id: listView
x: 16; y: 30
width: display.width
- height: display.height
+ height: display.height - 50 - y
delegate: Item {
height: 20
width: parent.width
diff --git a/examples/quick/demos/calqlatr/content/NumberPad.qml b/examples/quick/demos/calqlatr/content/NumberPad.qml
index 3203e18431..c7f2680651 100644
--- a/examples/quick/demos/calqlatr/content/NumberPad.qml
+++ b/examples/quick/demos/calqlatr/content/NumberPad.qml
@@ -60,7 +60,7 @@ Grid {
Button { text: "±"; color: "#6da43d"; operator: true }
Button { text: "−"; color: "#6da43d"; operator: true }
Button { text: "+"; color: "#6da43d"; operator: true }
- Button { text: " "; color: "#6da43d"; operator: true }
+ Button { text: "√"; color: "#6da43d"; operator: true }
Button { text: "÷"; color: "#6da43d"; operator: true }
Button { text: "×"; color: "#6da43d"; operator: true }
Button { text: "C"; color: "#6da43d"; operator: true }
diff --git a/examples/quick/demos/calqlatr/content/calculator.js b/examples/quick/demos/calqlatr/content/calculator.js
index d86fecbf39..da8e940b16 100644
--- a/examples/quick/demos/calqlatr/content/calculator.js
+++ b/examples/quick/demos/calqlatr/content/calculator.js
@@ -84,7 +84,7 @@ function operatorPressed(op)
} else if (previousOperator == "×") {
digits = Number(curVal) * Number(digits.valueOf())
} else if (previousOperator == "÷") {
- digits = Number(Number(curVal) / Number(digits.valueOf())).toString()
+ digits = Number(curVal) / Number(digits.valueOf())
} else if (previousOperator == "=") {
}
@@ -110,9 +110,9 @@ function operatorPressed(op)
digits = (Math.abs(digits.valueOf())).toString()
} else if (op == "Int") {
digits = (Math.floor(digits.valueOf())).toString()
- } else if (op == window.plusminus) {
+ } else if (op == "±") {
digits = (digits.valueOf() * -1).toString()
- } else if (op == window.squareRoot) {
+ } else if (op == "√") {
digits = (Math.sqrt(digits.valueOf())).toString()
} else if (op == "mc") {
memory = 0;
@@ -130,7 +130,7 @@ function operatorPressed(op)
} else if (op == "Off") {
Qt.quit();
} else if (op == "C") {
- digits = "0"
+ display.clear()
} else if (op == "AC") {
curVal = 0
memory = 0
diff --git a/examples/quick/dialogs/ColorDialogs.qml b/examples/quick/dialogs/colorandfiledialogs/ColorDialogs.qml
index f3d253aa8c..6a0af7f730 100644
--- a/examples/quick/dialogs/ColorDialogs.qml
+++ b/examples/quick/dialogs/colorandfiledialogs/ColorDialogs.qml
@@ -49,6 +49,7 @@ Rectangle {
SystemPalette { id: palette }
clip: true
+ //! [colordialog]
ColorDialog {
id: colorDialog
visible: colorDialogVisible.checked
@@ -59,6 +60,7 @@ Rectangle {
onAccepted: { console.log("Accepted: " + color) }
onRejected: { console.log("Rejected") }
}
+ //! [colordialog]
Column {
anchors.fill: parent
diff --git a/examples/quick/dialogs/FileDialogs.qml b/examples/quick/dialogs/colorandfiledialogs/FileDialogs.qml
index 8ed64b0b3c..d1278609f9 100644
--- a/examples/quick/dialogs/FileDialogs.qml
+++ b/examples/quick/dialogs/colorandfiledialogs/FileDialogs.qml
@@ -49,6 +49,7 @@ Rectangle {
SystemPalette { id: palette }
clip: true
+ //! [filedialog]
FileDialog {
id: fileDialog
visible: fileDialogVisible.checked
@@ -63,6 +64,7 @@ Rectangle {
onAccepted: { console.log("Accepted: " + fileUrls) }
onRejected: { console.log("Rejected") }
}
+ //! [filedialog]
Column {
anchors.fill: parent
diff --git a/examples/quick/dialogs/colorandfiledialogs/colorandfiledialogs.pro b/examples/quick/dialogs/colorandfiledialogs/colorandfiledialogs.pro
new file mode 100644
index 0000000000..3a7b25c91a
--- /dev/null
+++ b/examples/quick/dialogs/colorandfiledialogs/colorandfiledialogs.pro
@@ -0,0 +1,17 @@
+TEMPLATE = app
+
+QT += quick qml
+SOURCES += main.cpp
+RESOURCES += colorandfiledialogs.qrc ../../shared/shared.qrc
+
+OTHER_FILES += \
+ dialogs.qml \
+ FileDialogs.qml \
+ ColorDialogs.qml
+
+EXAMPLE_FILES = \
+ FileDialogs.qml \
+ ColorDialogs.qml
+
+target.path = $$[QT_INSTALL_EXAMPLES]/quick/dialogs
+INSTALLS += target
diff --git a/examples/quick/dialogs/dialogs.qrc b/examples/quick/dialogs/colorandfiledialogs/colorandfiledialogs.qrc
index efebfe4845..efebfe4845 100644
--- a/examples/quick/dialogs/dialogs.qrc
+++ b/examples/quick/dialogs/colorandfiledialogs/colorandfiledialogs.qrc
diff --git a/examples/quick/dialogs/dialogs.qml b/examples/quick/dialogs/colorandfiledialogs/dialogs.qml
index b5f9841a3f..b5f9841a3f 100644
--- a/examples/quick/dialogs/dialogs.qml
+++ b/examples/quick/dialogs/colorandfiledialogs/dialogs.qml
diff --git a/examples/quick/dialogs/colorandfiledialogs/doc/images/qml-colorandfiledialogs-example.jpg b/examples/quick/dialogs/colorandfiledialogs/doc/images/qml-colorandfiledialogs-example.jpg
new file mode 100644
index 0000000000..4517a39308
--- /dev/null
+++ b/examples/quick/dialogs/colorandfiledialogs/doc/images/qml-colorandfiledialogs-example.jpg
Binary files differ
diff --git a/examples/quick/dialogs/colorandfiledialogs/doc/src/colorandfiledialogs.qdoc b/examples/quick/dialogs/colorandfiledialogs/doc/src/colorandfiledialogs.qdoc
new file mode 100644
index 0000000000..68804649a9
--- /dev/null
+++ b/examples/quick/dialogs/colorandfiledialogs/doc/src/colorandfiledialogs.qdoc
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+ \title Qt Quick ColorDialog and FileDialog Examples
+ \example colorandfiledialogs
+ \brief This example demonstrates the color and file dialog types in QML
+ \image qml-colorandfiledialogs-example.jpg
+ \ingroup qtquickdialog_examples
+
+ This example demonstrates the color and file system dialogs in the \l{Qt Quick Dialogs}
+ module. The appearance and behavior is platform-dependent.
+
+ A \l FileDialog is used to choose a single file, multiple files or a
+ single directory, depending on how it is configured.
+ \snippet colorandfiledialogs/FileDialogs.qml filedialog
+
+ A \l ColorDialog is used to choose a color, with or without alpha (transparency)
+ depending on how it is configured.
+ \snippet colorandfiledialogs/ColorDialogs.qml colordialog
+*/
diff --git a/examples/quick/dialogs/main.cpp b/examples/quick/dialogs/colorandfiledialogs/main.cpp
index bbf0c48104..e8c2ae6aaa 100644
--- a/examples/quick/dialogs/main.cpp
+++ b/examples/quick/dialogs/colorandfiledialogs/main.cpp
@@ -37,5 +37,5 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "../shared/shared.h"
+#include "../../shared/shared.h"
DECLARATIVE_EXAMPLE_MAIN(dialogs/dialogs)
diff --git a/examples/quick/dialogs/dialogs.pro b/examples/quick/dialogs/dialogs.pro
index b76f396e9d..275e36470f 100644
--- a/examples/quick/dialogs/dialogs.pro
+++ b/examples/quick/dialogs/dialogs.pro
@@ -1,17 +1,4 @@
-TEMPLATE = app
+TEMPLATE = subdirs
-QT += quick qml
-SOURCES += main.cpp
-RESOURCES += dialogs.qrc ../shared/shared.qrc
-
-OTHER_FILES += \
- dialogs.qml \
- FileDialogs.qml \
- ColorDialogs.qml
-
-EXAMPLE_FILES = \
- FileDialogs.qml \
- ColorDialogs.qml
-
-target.path = $$[QT_INSTALL_EXAMPLES]/quick/dialogs
-INSTALLS += target
+SUBDIRS = \
+ colorandfiledialogs
diff --git a/examples/quick/window/Splash.qml b/examples/quick/window/Splash.qml
index 092e6e6fc2..c981bd2585 100644
--- a/examples/quick/window/Splash.qml
+++ b/examples/quick/window/Splash.qml
@@ -43,6 +43,7 @@ import QtQuick.Window 2.1
//! [splash-properties]
Window {
+ id: splash
visible: true
width: splashImage.width
height: splashImage.height
@@ -50,7 +51,8 @@ Window {
title: "Splash Window"
modality: Qt.ApplicationModal
flags: Qt.SplashScreen
- property int timeout: 2000
+ property int timeoutInterval: 2000
+ signal timeout
//! [splash-properties]
//! [screen-properties]
x: (Screen.width - splashImage.width) / 2
@@ -67,8 +69,11 @@ Window {
}
//! [timer]
Timer {
- interval: timeout; running: true; repeat: false
- onTriggered: visible = false
+ interval: timeoutInterval; running: true; repeat: false
+ onTriggered: {
+ visible = false
+ splash.timeout()
+ }
}
//! [timer]
}
diff --git a/examples/quick/window/main.cpp b/examples/quick/window/main.cpp
index 2223c607b4..7872c7183c 100644
--- a/examples/quick/window/main.cpp
+++ b/examples/quick/window/main.cpp
@@ -41,6 +41,7 @@
#include <QtGui/QGuiApplication>
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlComponent>
+#include <QtQuick/QQuickWindow>
#include <QtCore/QUrl>
#include <QDebug>
@@ -49,6 +50,7 @@ int main(int argc, char* argv[])
QGuiApplication app(argc, argv);
QQmlEngine engine;
QQmlComponent component(&engine);
+ QQuickWindow::setDefaultAlphaBuffer(true);
component.loadUrl(QUrl("qrc:///window/window.qml"));
if ( component.isReady() )
component.create();
diff --git a/examples/quick/window/window.qml b/examples/quick/window/window.qml
index 1d7282f7a1..67e2ba40ff 100644
--- a/examples/quick/window/window.qml
+++ b/examples/quick/window/window.qml
@@ -46,14 +46,11 @@ QtObject {
property real defaultSpacing: 10
property SystemPalette palette: SystemPalette { }
- property var splashWindow: Splash { }
-
property var controlWindow: Window {
width: 400
height: col.implicitHeight + defaultSpacing * 2
color: palette.window
title: "Control Window"
- visible: true
Column {
id: col
anchors.fill: parent
@@ -177,4 +174,8 @@ QtObject {
}
}
}
+
+ property var splashWindow: Splash {
+ onTimeout: controlWindow.visible = true
+ }
}
diff --git a/src/imports/dialogs/dialogs.pro b/src/imports/dialogs/dialogs.pro
index b7704dadda..53cad30cee 100644
--- a/src/imports/dialogs/dialogs.pro
+++ b/src/imports/dialogs/dialogs.pro
@@ -3,6 +3,8 @@ TARGET = dialogplugin
TARGETPATH = QtQuick/Dialogs
IMPORT_VERSION = 1.0
+QMAKE_DOCS = $$PWD/doc/qtquickdialogs.qdocconf
+
SOURCES += \
qquickabstractfiledialog.cpp \
qquickplatformfiledialog.cpp \
diff --git a/src/imports/dialogs/doc/qtquickdialogs.qdocconf b/src/imports/dialogs/doc/qtquickdialogs.qdocconf
new file mode 100644
index 0000000000..5caa1c0588
--- /dev/null
+++ b/src/imports/dialogs/doc/qtquickdialogs.qdocconf
@@ -0,0 +1,37 @@
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+
+project = QtQuickDialogs
+description = Qt Quick Dialogs Reference Documentation
+url = http://qt-project.org/doc/qt-$QT_VER/qtquickdialogs/
+version = $QT_VERSION
+
+qhp.projects = QtQuickDialogs
+
+qhp.QtQuickDialogs.file = qtquickdialogs.qhp
+qhp.QtQuickDialogs.namespace = org.qt-project.qtquickdialogs.$QT_VERSION_TAG
+qhp.QtQuickDialogs.virtualFolder = qtquickdialogs
+qhp.QtQuickDialogs.indexTitle = Qt Quick Dialogs
+qhp.QtQuickDialogs.indexRoot =
+
+qhp.QtQuickDialogs.filterAttributes = qtquickdialogs $QT_VERSION qtrefdoc
+qhp.QtQuickDialogs.customFilters.Qt.name = QtQuickDialogs $QT_VERSION
+qhp.QtQuickDialogs.customFilters.Qt.filterAttributes = qtquickdialogs $QT_VERSION
+
+qhp.QtQuickDialogs.subprojects = qtquickdialogsqmltypes
+qhp.QtQuickDialogs.subprojects.qtquickdialogsqmltypes.title = QML Types
+qhp.QtQuickDialogs.subprojects.qtquickdialogsqmltypes.indexTitle = Qt Quick Dialogs
+qhp.QtQuickDialogs.subprojects.qtquickdialogsqmltypes.selectors = fake:qmlclass
+qhp.QtQuickDialogs.subprojects.qtquickdialogsqmltypes.sortPages = true
+qhp.QtQuickDialogs.subprojects.qtquickdialogsqmltypes.type = manual
+
+depends = qtqml qtquick qtgui qtwidgets qtdoc
+
+exampledirs += ../../../../examples/quick/dialogs
+
+examplesinstallpath = quick/dialogs
+
+headerdirs += ..
+
+sourcedirs += ..
+
+imagedirs += images
diff --git a/src/imports/dialogs/doc/src/qtquickdialogs-examples.qdoc b/src/imports/dialogs/doc/src/qtquickdialogs-examples.qdoc
new file mode 100644
index 0000000000..ee277f48dc
--- /dev/null
+++ b/src/imports/dialogs/doc/src/qtquickdialogs-examples.qdoc
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \group qtquickdialog_examples
+ \ingroup qtquickexamples
+ \title Qt Quick Examples - Dialogs
+ \brief A Collection of examples for \l{Qt Quick Dialogs}, written in QML.
+
+ These examples show how to use the \l{Qt Quick Dialogs}.
+*/
+
diff --git a/src/imports/dialogs/doc/src/qtquickdialogs-index.qdoc b/src/imports/dialogs/doc/src/qtquickdialogs-index.qdoc
new file mode 100644
index 0000000000..5a1223b04d
--- /dev/null
+++ b/src/imports/dialogs/doc/src/qtquickdialogs-index.qdoc
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \group dialogs
+ \title Dialogs
+*/
+
+/*!
+ \page qtquickdialogs-index.html
+ \title Qt Quick Dialogs
+
+ \brief Qt Quick Dialogs submodule
+
+ The module is new in Qt 5.1.
+
+ \section1 Dialogs
+
+ \annotatedlist dialogs
+
+ \section1 Related information
+
+ \section2 Examples
+ \list
+ \li \l{Qt Quick Examples - Dialogs}{Dialogs Examples}
+ \endlist
+
+ \section2 Reference
+ \list
+ \li \l{Qt Quick Dialogs QML Types}{QML Types}
+ \endlist
+
+*/
+
diff --git a/src/imports/dialogs/plugin.cpp b/src/imports/dialogs/plugin.cpp
index bee0ee00bc..5502a65310 100644
--- a/src/imports/dialogs/plugin.cpp
+++ b/src/imports/dialogs/plugin.cpp
@@ -55,33 +55,6 @@
QT_BEGIN_NAMESPACE
-
-/*!
- \group dialogs
- \title Dialogs
-*/
-
-/*!
- \page qtquickdialogs-index.html
- \title Qt Quick Dialogs
-
- \brief Qt Quick Dialogs submodule
-
- The submodule is new in Qt 5.1.
-
- \section1 Dialogs
-
- \annotatedlist dialogs
-
- \section1 Related information
-
- \section2 Reference
- \list
- \li \l{Qt Quick Dialogs QML Types}{Qt Quick Dialogs QML Types}
- \endlist
-
-*/
-
/*!
\qmlmodule QtQuick.Dialogs 1
\title Qt Quick Dialogs QML Types
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index 7584241ca6..0bec4cddf2 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -291,6 +291,11 @@ Item {
}
function tryCompare(obj, prop, value, timeout) {
+ if (arguments.length == 2) {
+ qtest_results.fail("A value is required for tryCompare",
+ util.callerFile(), util.callerLine())
+ throw new Error("QtQuickTest::fail")
+ }
if (!timeout)
timeout = 5000
if (!qtest_compareInternal(obj[prop], value))
diff --git a/src/plugins/accessible/quick/qaccessiblequickview.cpp b/src/plugins/accessible/quick/qaccessiblequickview.cpp
index b85f23c48b..1240b2ef4c 100644
--- a/src/plugins/accessible/quick/qaccessiblequickview.cpp
+++ b/src/plugins/accessible/quick/qaccessiblequickview.cpp
@@ -81,10 +81,8 @@ QAccessibleInterface *QAccessibleQuickWindow::parent() const
QAccessibleInterface *QAccessibleQuickWindow::child(int index) const
{
- if (index == 0) {
- if (QQuickItem *declarativeRoot = rootItem())
- return new QAccessibleQuickItem(declarativeRoot);
- }
+ if (index == 0)
+ return QAccessible::queryAccessibleInterface(rootItem());
return 0;
}
diff --git a/src/qml/animations/qsequentialanimationgroupjob.cpp b/src/qml/animations/qsequentialanimationgroupjob.cpp
index c649370680..b82e1850f7 100644
--- a/src/qml/animations/qsequentialanimationgroupjob.cpp
+++ b/src/qml/animations/qsequentialanimationgroupjob.cpp
@@ -226,14 +226,14 @@ void QSequentialAnimationGroupJob::updateCurrentTime(int currentTime)
if (atEnd()) {
//we make sure that we don't exceed the duration here
m_currentTime += m_currentAnimation->currentTime() - newCurrentTime;
- stop();
+ RETURN_IF_DELETED(stop());
}
} else {
//the only case where currentAnimation could be null
//is when all animations have been removed
Q_ASSERT(!firstChild());
m_currentTime = 0;
- stop();
+ RETURN_IF_DELETED(stop());
}
m_previousLoop = m_currentLoop;
diff --git a/src/qml/doc/src/whatsnew.qdoc b/src/qml/doc/src/whatsnew.qdoc
index 6ca979db37..38713a1976 100644
--- a/src/qml/doc/src/whatsnew.qdoc
+++ b/src/qml/doc/src/whatsnew.qdoc
@@ -29,7 +29,28 @@
\title Qt QML Release Notes
\page qtqml-releasenotes.html
-\section1 Qt QML in Qt 5
+\section1 Qt QML in Qt 5.1
+
+Qt 5.1 introduces several bug fixes and new functionalities to Qt QML. This is
+a summary of the new changes:
+\list
+\li New QQmlApplicationEngine convenience class for QML applications.
+\li New Instantiatior type for generic, dynamic object creation.
+\li New properties for \l Qt.application: arguments, name, and version.
+\endlist
+
+\section2 New Submodules
+
+The Qt QML Models is a new submodule in Qt 5.1 and provides several QML types
+for handling data with models and lists.
+
+\list
+\li \l{QtQml.Models}{Models}
+\endlist
+
+The \l{What's New in Qt 5.1} has more information about the Qt 5.1 release.
+
+\section1 Qt QML in Qt 5.0
The \l{Qt QML} module is new in Qt 5.0. It provides the QML engine and
implements the QML language supporting infrastructure.
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index 9277b6ea8f..5ddc0f52bd 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -1431,7 +1431,9 @@ QQmlListModelParser::ListInstruction *QQmlListModelParser::ListModelData::instru
The ListModel is a simple container of ListElement definitions, each containing data roles.
The contents can be defined dynamically, or explicitly in QML.
- This type is also available in the \c {QtQuick 2} import. For full documentation, see \l QtQuick2::ListModel
+ This type is also available in the \c {QtQuick 2} import.
+
+ \sa {QtQml2::ListModel}{Full documentation for ListModel}
*/
/*!
\qmltype ListModel
@@ -2540,7 +2542,9 @@ bool QQmlListModelParser::definesEmptyList(const QString &s)
List elements are defined inside ListModel definitions, and represent items in a list.
- This type is also available in the \c {QtQuick 2} import. For full documentation, see \l QtQuick2::ListElement
+ This type is also available in the \c {QtQuick 2} import.
+
+ \sa {QtQml2::ListElement}{Full documentation for ListElement}
*/
/*!
\qmltype ListElement
diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf
index fba4ff89df..a27b0f82f7 100644
--- a/src/quick/doc/qtquick.qdocconf
+++ b/src/quick/doc/qtquick.qdocconf
@@ -34,7 +34,7 @@ qhp.QtQuick.subprojects.examples.selectors = fake:example
tagfile = ../../../doc/qtquick/qtquick.tags
-depends += qtcore qtxmlpatterns qtqml qtgui qtlinguist qtquickcontrols qtdoc
+depends += qtcore qtxmlpatterns qtqml qtgui qtlinguist qtquickcontrols qtquicklayouts qtdoc qtquickdialogs
headerdirs += ..
@@ -58,3 +58,6 @@ sourcedirs += ../../imports
#add plugins directory because of dependencies
headerdirs += ../../plugins
sourcedirs += ../../plugins
+
+#exclude certain directories
+excludedirs = ../../imports/dialogs
diff --git a/src/quick/doc/src/concepts/positioning/layouts.qdoc b/src/quick/doc/src/concepts/positioning/layouts.qdoc
index 785bcc6ca6..35be2f6235 100644
--- a/src/quick/doc/src/concepts/positioning/layouts.qdoc
+++ b/src/quick/doc/src/concepts/positioning/layouts.qdoc
@@ -28,9 +28,9 @@
/*!
\ingroup qtquick-positioners
\page qtquick-positioning-layouts.html
-\title Item Layouts
+\title Item Positioners
-Positioner items are container items that manage the positions and sizes of
+Positioner items are container items that manage the positions of
items in a declarative user interface. Positioners behave in a similar way to
the \l{Widgets and Layouts}{layout managers} used with standard Qt widgets,
except that they are also containers in their own right.
@@ -38,6 +38,10 @@ except that they are also containers in their own right.
Positioners make it easier to work with many items when they need
to be arranged in a regular layout.
+\l{Qt Quick Layouts} can also be used to arrange Qt Quick items in a user interface.
+They manage both the positions and the sizes of items on a declarative user interface,
+and are well suited for resizable user interfaces.
+
\section1 Positioners
A set of standard positioners are provided in the basic set of Qt Quick
diff --git a/src/quick/doc/src/concepts/positioning/topic.qdoc b/src/quick/doc/src/concepts/positioning/topic.qdoc
index 25fc6eaab7..bae6a7f71b 100644
--- a/src/quick/doc/src/concepts/positioning/topic.qdoc
+++ b/src/quick/doc/src/concepts/positioning/topic.qdoc
@@ -34,7 +34,7 @@ Visual items in QML can be positioned in a variety of ways. The most important
positioning-related concept is that of anchoring, a form of relative
positioning where items can be anchored (or attached) to each other at certain
boundaries. Other positioning concepts include absolute positioning,
-positioning with coordinate bindings, and layouts.
+positioning with coordinate bindings, positioners, and layouts.
\section1 Manual Positioning
@@ -134,21 +134,20 @@ positioning, whereas a "contaminated" anchor layout is one which uses both
anchoring and bindings (either on position-related [x,y] properties or on
dimension-related [width,height] properties) to determine the position.
-\section1 Layouts
-
-Qt Quick also provides some built-in layout items. For many use cases, the
-best layout to use is a simple grid, row, or column, and Qt Quick provides
-items which will layout children in these formations in the most efficient
-manner possible.
+\section1 Positioners
-There are many well-known layouts which work well in user-interfaces, such as
-grids and lists, rows and columns. Qt Quick supports these sort of pre-defined
-layouts, which can often be more performant to draw than anchor or
-binding-based layouts. See the documentation on
-\l{qtquick-positioning-layouts.html}{layout types} for more
-information about utilizing pre-defined layouts.
+Qt Quick also provides some built-in positioner items. For many use cases, the best
+positioner to use is a simple grid, row, or column, and Qt Quick provides items which
+will position children in these formations in the most efficient manner possible.
+See the documentation on \l{qtquick-positioning-layouts.html}{item positioners types}
+for more information about utilizing pre-defined positioners.
+\section1 Layouts
+From Qt 5.1, the module \l {Qt Quick Layouts} can also be used to arrange Qt Quick
+items in a user interface. Unlike positioners, the types in Qt Quick Layouts manage
+both the positions and sizes of items in a declarative interface. They are well
+suited for resizable user interfaces.
\section1 Right-To-Left Support
diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc
index d580ba8c96..bb488ac2f2 100644
--- a/src/quick/doc/src/qmltypereference.qdoc
+++ b/src/quick/doc/src/qmltypereference.qdoc
@@ -236,11 +236,11 @@ Animation paths
Models And Model Data
\list
-\li \l {QtQuick2::ListModel}{ListModel} - Defines a list of data
-\li \l {QtQuick2::ListElement}{ListElement} - Defines a data item in a \l {QtQuick2::ListModel}{ListModel}
+\li \l {QtQml2::ListModel}{ListModel} - Defines a list of data
+\li \l {QtQml2::ListElement}{ListElement} - Defines a data item in a \l {QtQml2::ListModel}{ListModel}
\li \l {VisualItemModel} - Contains items that already defines its own visual delegate
\li \l {VisualDataModel} - Encapsulates a model and a delegate
-\li \l {VisualDataGroup} -Encapsulates a filtered set of visual data items
+\li \l {VisualDataGroup} - Encapsulates a filtered set of visual data items
\li \l {XmlListModel} - Specifies a model using XPath expressions
\li \l {XmlRole} - Specifies a role for an \l {XmlListModel}
\endlist
diff --git a/src/quick/doc/src/qtquick.qdoc b/src/quick/doc/src/qtquick.qdoc
index 7163baa819..0a4d276cb8 100644
--- a/src/quick/doc/src/qtquick.qdoc
+++ b/src/quick/doc/src/qtquick.qdoc
@@ -125,7 +125,7 @@ Additional Qt Quick information:
system for Qt Quick
\li \l{QtQuick.Window 2}{Window} - contains types for creating
top-level windows and accessing screen information
- \li \l{QtQuick.Dialogs 1}{Dialogs} - contains types for creating and
+ \li \l{Qt Quick Dialogs}{Dialogs} - contains types for creating and
interacting with system dialogs
\endlist
\li \l{Qt Quick Release Notes} - list of changes and additions in the Qt Quick
diff --git a/src/quick/doc/src/tutorial.qdoc b/src/quick/doc/src/tutorial.qdoc
index 46125ede18..bd07c9a98d 100644
--- a/src/quick/doc/src/tutorial.qdoc
+++ b/src/quick/doc/src/tutorial.qdoc
@@ -32,7 +32,7 @@
\previouspage Introduction to the QML Language
\nextpage QML Tutorial 1 - Basic Types
-This tutorial gives an introduction to QML, the mark up language for Qt Quick. It doesn't cover everything;
+This tutorial gives an introduction to QML, the declarative language for Qt Quick. It doesn't cover everything;
the emphasis is on teaching the key principles, and features are introduced as needed.
Through the different steps of this tutorial we will learn about QML basic types, we will create our own QML component
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 58e1612e19..110e14d266 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -1363,7 +1363,7 @@ QQuickKeysAttached *QQuickKeysAttached::qmlAttachedProperties(QObject *obj)
\brief Property used to mirror layout behavior
The LayoutMirroring attached property is used to horizontally mirror \l {anchor-layout}{Item anchors},
- \l{Item Layouts}{positioner} types (such as \l Row and \l Grid)
+ \l{Item Positioners}{positioner} types (such as \l Row and \l Grid)
and views (such as \l GridView and horizontal \l ListView). Mirroring is a visual change: left
anchors become right anchors, and positioner types like \l Grid and \l Row reverse the
horizontal layout of child items.
@@ -1403,7 +1403,7 @@ QQuickKeysAttached *QQuickKeysAttached::qmlAttachedProperties(QObject *obj)
This property holds whether the item's layout is mirrored horizontally. Setting this to true
horizontally reverses \l {anchor-layout}{anchor} settings such that left anchors become right,
- and right anchors become left. For \l{Item Layouts}{positioner} types
+ and right anchors become left. For \l{Item Positioners}{positioner} types
(such as \l Row and \l Grid) and view types (such as \l {GridView}{GridView} and \l {ListView}{ListView})
this also mirrors the horizontal layout direction of the item.
diff --git a/src/quick/items/qquickpositioners.cpp b/src/quick/items/qquickpositioners.cpp
index 789d2e62aa..b07a38cdaf 100644
--- a/src/quick/items/qquickpositioners.cpp
+++ b/src/quick/items/qquickpositioners.cpp
@@ -626,7 +626,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem)
more information about its position within the Column.
For more information on using Column and other related positioner-types, see
- \l{Item Layouts}.
+ \l{Item Positioners}.
\section1 Using Transitions
@@ -644,7 +644,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem)
\image verticalpositioner_transition.gif
- \sa Row, Grid, Flow, Positioner, {Qt Quick Examples - Positioners}
+ \sa Row, Grid, Flow, Positioner, ColumnLayout, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Column::populate
@@ -795,10 +795,10 @@ void QQuickColumn::reportConflictingAnchors()
more information about its position within the Row.
For more information on using Row and other related positioner-types, see
- \l{Item Layouts}.
+ \l{Item Positioners}.
- \sa Column, Grid, Flow, Positioner, {Qt Quick Examples - Positioners}
+ \sa Column, Grid, Flow, Positioner, RowLayout, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Row::populate
@@ -1028,10 +1028,10 @@ void QQuickRow::reportConflictingAnchors()
or anchor itself with any of the \l {Item::anchors}{anchor} properties.
For more information on using Grid and other related positioner-types, see
- \l{Item Layouts}.
+ \l{Item Positioners}.
- \sa Flow, Row, Column, Positioner, {Qt Quick Examples - Positioners}
+ \sa Flow, Row, Column, Positioner, GridLayout, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Grid::populate
@@ -1570,7 +1570,7 @@ void QQuickGrid::reportConflictingAnchors()
or anchor itself with any of the \l {Item::anchors}{anchor} properties.
For more information on using Flow and other related positioner-types, see
- \l{Item Layouts}.
+ \l{Item Positioners}.
\sa Column, Row, Grid, Positioner, {Qt Quick Examples - Positioners}
*/
diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp
index 102066704b..f39a15070c 100644
--- a/src/quick/items/qquickshadereffect.cpp
+++ b/src/quick/items/qquickshadereffect.cpp
@@ -912,8 +912,8 @@ QSGNode *QQuickShaderEffect::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDa
{
QQuickShaderEffectNode *node = static_cast<QQuickShaderEffectNode *>(oldNode);
- // In the case of a bad vertex shader, don't try to create a node...
- if (m_common.attributes.isEmpty()) {
+ // In the case of zero-size or a bad vertex shader, don't try to create a node...
+ if (m_common.attributes.isEmpty() || width() <= 0 || height() <= 0) {
if (node)
delete node;
return 0;
diff --git a/src/quick/items/qquickshadereffectsource.cpp b/src/quick/items/qquickshadereffectsource.cpp
index bd0bb2348e..9debfe35b3 100644
--- a/src/quick/items/qquickshadereffectsource.cpp
+++ b/src/quick/items/qquickshadereffectsource.cpp
@@ -942,7 +942,7 @@ void QQuickShaderEffectSource::releaseResources()
QSGNode *QQuickShaderEffectSource::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
{
- if (!m_sourceItem || m_sourceItem->width() == 0 || m_sourceItem->height() == 0) {
+ if (!m_sourceItem || m_sourceItem->width() <= 0 || m_sourceItem->height() <= 0) {
if (m_texture)
m_texture->setItem(0);
delete oldNode;
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index cf9cb4224f..fbf46f51e4 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -954,7 +954,10 @@ QRectF QQuickTextPrivate::setupTextLayout(qreal *const baseline)
// Create the remainder of the unwrapped lines up to maxLineCount to get the
// implicit width.
- if (line.isValid() && layoutText.at(line.textStart() + line.textLength()) != QChar::LineSeparator)
+ const int eol = line.isValid()
+ ? line.textStart() + line.textLength()
+ : layoutText.length();
+ if (eol < layoutText.length() && layoutText.at(eol) != QChar::LineSeparator)
line = layout.createLine();
for (; line.isValid() && unwrappedLineCount <= maxLineCount; ++unwrappedLineCount)
line = layout.createLine();
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 4a34adabe8..7137bb165e 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -74,6 +74,8 @@ QT_BEGIN_NAMESPACE
extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
+bool QQuickWindowPrivate::defaultAlphaBuffer(0);
+
void QQuickWindowPrivate::updateFocusItemTransform()
{
Q_Q(QQuickWindow);
@@ -2969,7 +2971,7 @@ QSGTexture *QQuickWindow::createTextureFromId(uint id, const QSize &size, Create
Setting the clear color has no effect when clearing is disabled.
By default, the clear color is white.
- \sa setClearBeforeRendering()
+ \sa setClearBeforeRendering(), setDefaultAlphaBuffer()
*/
void QQuickWindow::setColor(const QColor &color)
@@ -2979,7 +2981,7 @@ void QQuickWindow::setColor(const QColor &color)
return;
if (color.alpha() != d->clearColor.alpha()) {
- QSurfaceFormat fmt = format();
+ QSurfaceFormat fmt = requestedFormat();
if (color.alpha() < 255)
fmt.setAlphaBufferSize(8);
else
@@ -2997,6 +2999,31 @@ QColor QQuickWindow::color() const
}
/*!
+ \brief Returns whether to use alpha transparency on newly created windows.
+
+ \since Qt 5.1
+ \sa setDefaultAlphaBuffer()
+ */
+bool QQuickWindow::hasDefaultAlphaBuffer()
+{
+ return QQuickWindowPrivate::defaultAlphaBuffer;
+}
+
+/*!
+ \brief \a useAlpha specifies whether to use alpha transparency on newly created windows.
+ \since Qt 5.1
+
+ In any application which expects to create translucent windows, it's
+ necessary to set this to true before creating the first QQuickWindow,
+ because all windows will share the same \l QOpenGLContext. The default
+ value is false.
+ */
+void QQuickWindow::setDefaultAlphaBuffer(bool useAlpha)
+{
+ QQuickWindowPrivate::defaultAlphaBuffer = useAlpha;
+}
+
+/*!
\qmlproperty string QtQuick.Window2::Window::title
The window's title in the windowing system.
diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h
index fc148aabe6..a0bc832334 100644
--- a/src/quick/items/qquickwindow.h
+++ b/src/quick/items/qquickwindow.h
@@ -115,6 +115,9 @@ public:
void setColor(const QColor &color);
QColor color() const;
+ static bool hasDefaultAlphaBuffer();
+ static void setDefaultAlphaBuffer(bool useAlpha);
+
void setPersistentOpenGLContext(bool persistent);
bool isPersistentOpenGLContext() const;
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index 9e3251b240..2465629778 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -219,6 +219,8 @@ public:
mutable QQuickWindowIncubationController *incubationController;
+ static bool defaultAlphaBuffer;
+
static bool dragOverThreshold(qreal d, Qt::Axis axis, QMouseEvent *event);
// data property
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp
index d3710c7bd5..c47250662b 100644
--- a/src/quick/scenegraph/qsgcontext.cpp
+++ b/src/quick/scenegraph/qsgcontext.cpp
@@ -54,6 +54,7 @@
#include <QGuiApplication>
#include <QOpenGLContext>
+#include <QQuickWindow>
#include <QtGui/qopenglframebufferobject.h>
#include <private/qqmlglobal_p.h>
@@ -159,15 +160,13 @@ QSGContext::QSGContext(QObject *parent) :
QObject(*(new QSGContextPrivate), parent)
{
Q_D(QSGContext);
- static bool doSubpixel = qApp->arguments().contains(QLatin1String("--text-subpixel-antialiasing"));
- static bool doLowQualSubpixel = qApp->arguments().contains(QLatin1String("--text-subpixel-antialiasing-lowq"));
- static bool doGray = qApp->arguments().contains(QLatin1String("--text-gray-antialiasing"));
- if (doSubpixel)
+ QByteArray mode = qgetenv("QSG_DISTANCEFIELD_ANTIALIASING");
+ if (mode == "subpixel")
d->distanceFieldAntialiasing = QSGGlyphNode::HighQualitySubPixelAntialiasing;
- else if (doLowQualSubpixel)
+ else if (mode == "subpixel-lowq")
d->distanceFieldAntialiasing = QSGGlyphNode::LowQualitySubPixelAntialiasing;
- else if (doGray)
- d->distanceFieldAntialiasing = QSGGlyphNode::GrayAntialiasing;
+ else if (mode == "gray")
+ d->distanceFieldAntialiasing = QSGGlyphNode::GrayAntialiasing;
}
@@ -398,6 +397,8 @@ QSurfaceFormat QSGContext::defaultSurfaceFormat() const
QSurfaceFormat format;
format.setDepthBufferSize(24);
format.setStencilBufferSize(8);
+ if (QQuickWindow::hasDefaultAlphaBuffer())
+ format.setAlphaBufferSize(8);
format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
return format;
}
diff --git a/tests/auto/quick/qquicktext/data/elideBeforeMaximumLineCount.qml b/tests/auto/quick/qquicktext/data/elideBeforeMaximumLineCount.qml
new file mode 100644
index 0000000000..7f1ce705dd
--- /dev/null
+++ b/tests/auto/quick/qquicktext/data/elideBeforeMaximumLineCount.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.0
+
+Text {
+ width: implicitWidth / 2
+ height: implicitHeight / 2
+ elide: Text.ElideRight
+ maximumLineCount: 4
+
+ text: "Line one\nLine two\nLine three\nLine four"
+}
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
index b95a646bd6..fb3b62b8d2 100644
--- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp
+++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
@@ -149,6 +149,8 @@ private slots:
void htmlLists();
void htmlLists_data();
+ void elideBeforeMaximumLineCount();
+
private:
QStringList standard;
QStringList richText;
@@ -3638,6 +3640,18 @@ void tst_qquicktext::htmlLists_data()
QTest::newRow("unordered list bad") << "<ul type=\"bad\"><li>one</li><li>two</li></ul>" << 2;
}
+void tst_qquicktext::elideBeforeMaximumLineCount()
+{ // QTBUG-31471
+ QQmlComponent component(&engine, testFile("elideBeforeMaximumLineCount.qml"));
+
+ QScopedPointer<QObject> object(component.create());
+
+ QQuickText *item = qobject_cast<QQuickText *>(object.data());
+ QVERIFY(item);
+
+ QCOMPARE(item->lineCount(), 2);
+}
+
QTEST_MAIN(tst_qquicktext)
#include "tst_qquicktext.moc"