summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README8
-rw-r--r--dist/changes-5.4.126
-rw-r--r--src/controls/ComboBox.qml2
-rw-r--r--src/controls/Menu.qml4
-rw-r--r--src/controls/MenuBar.qml2
-rw-r--r--src/controls/Private/AbstractCheckable.qml3
-rw-r--r--src/controls/Private/BasicButton.qml2
-rw-r--r--src/controls/Private/BasicTableView.qml2
-rw-r--r--src/controls/Private/ColumnMenuContent.qml3
-rw-r--r--src/controls/Private/HoverButton.qml4
-rw-r--r--src/controls/Private/MenuContentScroller.qml3
-rw-r--r--src/controls/Private/ScrollBar.qml2
-rw-r--r--src/controls/Private/TabBar.qml3
-rw-r--r--src/controls/Private/TextInputWithHandles.qml2
-rw-r--r--src/controls/Private/ToolMenuButton.qml2
-rw-r--r--src/controls/Private/qquickcontrolsettings.cpp5
-rw-r--r--src/controls/Private/qquickcontrolsettings_p.h2
-rw-r--r--src/controls/ProgressBar.qml2
-rw-r--r--src/controls/Slider.qml9
-rw-r--r--src/controls/SpinBox.qml6
-rw-r--r--src/controls/SplitView.qml2
-rw-r--r--src/controls/Styles/Base/CalendarStyle.qml2
-rw-r--r--src/controls/qquickmenupopupwindow.cpp2
-rw-r--r--src/layouts/qquicklinearlayout.cpp21
-rw-r--r--src/layouts/qquicklinearlayout_p.h5
-rw-r--r--tests/auto/controls/data/tst_gridlayout.qml30
26 files changed, 126 insertions, 28 deletions
diff --git a/README b/README
index fb15cfc6..77712f6a 100644
--- a/README
+++ b/README
@@ -4,9 +4,9 @@ This project aims to deliver widgets/controls functionality with Qt Quick.
Some more information can be found on the following blog entries:
-https://blog.qt.digia.com/blog/2011/03/10/qml-components-for-desktop/
-https://blog.qt.digia.com/blog/2011/05/26/table-view-with-qt-quick/
-https://blog.qt.digia.com/blog/2011/08/26/toplevel-windows-and-menus-with-qt-quick/
+https://blog.qt.io/blog/2011/03/10/qml-components-for-desktop/
+https://blog.qt.io/blog/2011/05/26/table-view-with-qt-quick/
+https://blog.qt.io/blog/2011/08/26/toplevel-windows-and-menus-with-qt-quick/
HELP
@@ -38,6 +38,6 @@ application. This is because it will ensure that the QMLViewer application itsel
show and make up the main window in your application.
Again, please refer to :
-https://blog.qt.digia.com/blog/2011/08/26/toplevel-windows-and-menus-with-qt-quick/
+https://blog.qt.io/blog/2011/08/26/toplevel-windows-and-menus-with-qt-quick/
For more information on this.
diff --git a/dist/changes-5.4.1 b/dist/changes-5.4.1
new file mode 100644
index 00000000..f2d8c359
--- /dev/null
+++ b/dist/changes-5.4.1
@@ -0,0 +1,26 @@
+Qt 5.4.1 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.4.0.
+
+ http://doc.qt.io/qt-5.4/
+
+The Qt version 5.4 series is binary compatible with the 5.3.x series.
+Applications compiled for 5.3 will continue to run with 5.4.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+ http://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* General *
+****************************************************************************
+
+ - [QTBUG-42506] Fixed StackView focus handling by making it a FocusScope.
+ - Documented how to select a specific Android theme.
+ - Fixed iOS edit menu to show up only when the control has active focus.
+ - [QTBUG-43693] Fixed popup positioning to take all screen geometry into
+ account.
+ - Fixed some documentation linking issues.
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml
index 2baa4c73..2f50dc0e 100644
--- a/src/controls/ComboBox.qml
+++ b/src/controls/ComboBox.qml
@@ -345,7 +345,7 @@ Control {
property bool overridePressed: false
readonly property bool effectivePressed: (pressed || overridePressed) && containsMouse
anchors.fill: parent
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
onPressed: {
if (comboBox.activeFocusOnPress)
forceActiveFocus()
diff --git a/src/controls/Menu.qml b/src/controls/Menu.qml
index 7d90e19e..2ab229ab 100644
--- a/src/controls/Menu.qml
+++ b/src/controls/Menu.qml
@@ -44,8 +44,8 @@ import QtQuick.Controls.Private 1.0
\inqmlmodule QtQuick.Controls
\since 5.1
\ingroup menus
- \brief Provides a menu component for use in menu bars, as context menu,
- and other popup menus.
+ \brief Provides a menu component for use as a context menu, popup menu, or
+ as part of a menu bar.
\image menu.png
diff --git a/src/controls/MenuBar.qml b/src/controls/MenuBar.qml
index d453e227..5f444dac 100644
--- a/src/controls/MenuBar.qml
+++ b/src/controls/MenuBar.qml
@@ -286,7 +286,7 @@ MenuBarPrivate {
MouseArea {
id: menuMouseArea
anchors.fill: parent
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
onPositionChanged: updateCurrentItem(mouse, false)
onPressed: {
diff --git a/src/controls/Private/AbstractCheckable.qml b/src/controls/Private/AbstractCheckable.qml
index 0e685dea..42abebe5 100644
--- a/src/controls/Private/AbstractCheckable.qml
+++ b/src/controls/Private/AbstractCheckable.qml
@@ -36,6 +36,7 @@
import QtQuick 2.2
import QtQuick.Controls 1.2
+import QtQuick.Controls.Private 1.0
/*!
\qmltype AbstractCheckable
@@ -109,7 +110,7 @@ Control {
id: mouseArea
focus: true
anchors.fill: parent
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
enabled: !keyPressed
property bool keyPressed: false
diff --git a/src/controls/Private/BasicButton.qml b/src/controls/Private/BasicButton.qml
index dc503dc5..5de95aa9 100644
--- a/src/controls/Private/BasicButton.qml
+++ b/src/controls/Private/BasicButton.qml
@@ -182,7 +182,7 @@ Control {
property bool effectivePressed: pressed && containsMouse || keyPressed
anchors.fill: parent
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
enabled: !keyPressed
function toggle() {
diff --git a/src/controls/Private/BasicTableView.qml b/src/controls/Private/BasicTableView.qml
index cac673eb..bc8ebdb0 100644
--- a/src/controls/Private/BasicTableView.qml
+++ b/src/controls/Private/BasicTableView.qml
@@ -682,7 +682,7 @@ ScrollView {
MouseArea{
id: headerClickArea
drag.axis: Qt.YAxis
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
anchors.fill: parent
onClicked: {
if (sortIndicatorColumn === index)
diff --git a/src/controls/Private/ColumnMenuContent.qml b/src/controls/Private/ColumnMenuContent.qml
index a5fa3dc8..8de3fcea 100644
--- a/src/controls/Private/ColumnMenuContent.qml
+++ b/src/controls/Private/ColumnMenuContent.qml
@@ -36,6 +36,7 @@
import QtQuick 2.2
import QtQuick.Controls 1.2
+import QtQuick.Controls.Private 1.0
Item {
id: content
@@ -189,7 +190,7 @@ Item {
width: scrollView.width - scrollView.__verticalScrollBar.width
height: parent.height
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
acceptedButtons: Qt.AllButtons
onPositionChanged: updateCurrentItem({ "x": mouse.x, "y": mouse.y })
diff --git a/src/controls/Private/HoverButton.qml b/src/controls/Private/HoverButton.qml
index 6825ff98..c5b39d56 100644
--- a/src/controls/Private/HoverButton.qml
+++ b/src/controls/Private/HoverButton.qml
@@ -35,6 +35,8 @@
****************************************************************************/
import QtQuick 2.2
+import QtQuick.Controls 1.2
+import QtQuick.Controls.Private 1.0
Item {
id: button
@@ -69,6 +71,6 @@ Item {
id: mouse
anchors.fill: parent
onClicked: button.clicked()
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
}
}
diff --git a/src/controls/Private/MenuContentScroller.qml b/src/controls/Private/MenuContentScroller.qml
index 44c0eaa1..3efbd5ad 100644
--- a/src/controls/Private/MenuContentScroller.qml
+++ b/src/controls/Private/MenuContentScroller.qml
@@ -36,6 +36,7 @@
import QtQuick 2.2
import QtQuick.Controls 1.2
+import QtQuick.Controls.Private 1.0
MouseArea {
id: scrollIndicator
@@ -46,7 +47,7 @@ MouseArea {
bottom: direction === Qt.DownArrow ? parent.bottom : undefined
}
- hoverEnabled: visible
+ hoverEnabled: visible && Settings.hoverEnabled
height: scrollerLoader.height
width: parent.width
diff --git a/src/controls/Private/ScrollBar.qml b/src/controls/Private/ScrollBar.qml
index 481d766a..f6f5e26d 100644
--- a/src/controls/Private/ScrollBar.qml
+++ b/src/controls/Private/ScrollBar.qml
@@ -97,7 +97,7 @@ Item {
onEntered: if (!pressed) __panel.activeControl = __panel.hitTest(mouseX, mouseY)
onExited: if (!pressed) __panel.activeControl = "none"
onMouseXChanged: if (!pressed) __panel.activeControl = __panel.hitTest(mouseX, mouseY)
- hoverEnabled: !Settings.hasTouchScreen
+ hoverEnabled: Settings.hoverEnabled
enabled: !Settings.isMobile || !Settings.hasTouchScreen // ### Not ideal, but will usually behave as expected...
preventStealing: true
property var pressedX
diff --git a/src/controls/Private/TabBar.qml b/src/controls/Private/TabBar.qml
index e7382aa4..183d006b 100644
--- a/src/controls/Private/TabBar.qml
+++ b/src/controls/Private/TabBar.qml
@@ -36,6 +36,7 @@
import QtQuick 2.2
import QtQuick.Controls 1.2
+import QtQuick.Controls.Private 1.0
/*!
\qmltype TabBar
@@ -161,7 +162,7 @@ FocusScope {
delegate: MouseArea {
id: tabitem
objectName: "mousearea"
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
focus: true
enabled: modelData.enabled
diff --git a/src/controls/Private/TextInputWithHandles.qml b/src/controls/Private/TextInputWithHandles.qml
index 9ed4468d..f931986f 100644
--- a/src/controls/Private/TextInputWithHandles.qml
+++ b/src/controls/Private/TextInputWithHandles.qml
@@ -99,7 +99,7 @@ TextInput {
MouseArea {
id: mouseArea
anchors.fill: parent
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
cursorShape: Qt.IBeamCursor
acceptedButtons: (input.selectByMouse ? Qt.NoButton : Qt.LeftButton) | (control.menu ? Qt.RightButton : Qt.NoButton)
onClicked: {
diff --git a/src/controls/Private/ToolMenuButton.qml b/src/controls/Private/ToolMenuButton.qml
index c93c3b14..f2c8c3e1 100644
--- a/src/controls/Private/ToolMenuButton.qml
+++ b/src/controls/Private/ToolMenuButton.qml
@@ -87,7 +87,7 @@ FocusScope {
anchors.fill: parent
enabled: !keyPressed
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
onReleased: {
if (Settings.hasTouchScreen && containsMouse && menu)
diff --git a/src/controls/Private/qquickcontrolsettings.cpp b/src/controls/Private/qquickcontrolsettings.cpp
index d1c5b82e..017a0714 100644
--- a/src/controls/Private/qquickcontrolsettings.cpp
+++ b/src/controls/Private/qquickcontrolsettings.cpp
@@ -101,6 +101,11 @@ bool QQuickControlSettings::isMobile() const
#endif
}
+bool QQuickControlSettings::hoverEnabled() const
+{
+ return !isMobile() || !hasTouchScreen();
+}
+
static QString styleImportPath(QQmlEngine *engine, const QString &styleName)
{
QString path = qgetenv("QT_QUICK_CONTROLS_STYLE");
diff --git a/src/controls/Private/qquickcontrolsettings_p.h b/src/controls/Private/qquickcontrolsettings_p.h
index f7234670..ed21101d 100644
--- a/src/controls/Private/qquickcontrolsettings_p.h
+++ b/src/controls/Private/qquickcontrolsettings_p.h
@@ -54,6 +54,7 @@ class QQuickControlSettings : public QObject
Q_PROPERTY(qreal dragThreshold READ dragThreshold CONSTANT)
Q_PROPERTY(bool hasTouchScreen READ hasTouchScreen CONSTANT)
Q_PROPERTY(bool isMobile READ isMobile CONSTANT)
+ Q_PROPERTY(bool hoverEnabled READ hoverEnabled CONSTANT)
public:
QQuickControlSettings(QQmlEngine *engine);
@@ -71,6 +72,7 @@ public:
bool hasTouchScreen() const;
bool isMobile() const;
+ bool hoverEnabled() const;
signals:
void styleChanged();
diff --git a/src/controls/ProgressBar.qml b/src/controls/ProgressBar.qml
index e988874e..7bc3bec5 100644
--- a/src/controls/ProgressBar.qml
+++ b/src/controls/ProgressBar.qml
@@ -141,7 +141,7 @@ Control {
MouseArea {
id: hoverArea
anchors.fill: parent
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
}
/*! \internal */
diff --git a/src/controls/Slider.qml b/src/controls/Slider.qml
index 3f1169a2..8bce7e8f 100644
--- a/src/controls/Slider.qml
+++ b/src/controls/Slider.qml
@@ -171,8 +171,11 @@ Control {
/*! \internal */
property bool __horizontal: orientation === Qt.Horizontal
- /*! \internal */
- property real __handlePos: range.valueForPosition(__horizontal ? fakeHandle.x : fakeHandle.y)
+ /*! \internal
+ The extra arguments positionAtMinimum and positionAtMaximum are there to force
+ re-evaluation of the handle position when the constraints change (QTBUG-41255).
+ */
+ property real __handlePos: range.valueForPosition(__horizontal ? fakeHandle.x : fakeHandle.y, range.positionAtMinimum, range.positionAtMaximum)
activeFocusOnTab: true
@@ -225,7 +228,7 @@ Control {
id: mouseArea
anchors.fill: parent
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
property int clickOffset: 0
property real pressX: 0
property real pressY: 0
diff --git a/src/controls/SpinBox.qml b/src/controls/SpinBox.qml
index 39caae50..95ce2b47 100644
--- a/src/controls/SpinBox.qml
+++ b/src/controls/SpinBox.qml
@@ -267,7 +267,7 @@ Control {
MouseArea {
id: mouseArea
anchors.fill: parent
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
onPressed: if (activeFocusOnPress) input.forceActiveFocus()
onWheel: {
if (wheel.angleDelta.y > 0)
@@ -330,7 +330,7 @@ Control {
MouseArea {
id: mouseUp
objectName: "mouseUp"
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
property var upRect: __panel ? __panel.upRect : null
@@ -357,7 +357,7 @@ Control {
MouseArea {
id: mouseDown
objectName: "mouseDown"
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
onClicked: __decrement()
onPressed: if (!Settings.hasTouchScreen && activeFocusOnPress) input.forceActiveFocus()
diff --git a/src/controls/SplitView.qml b/src/controls/SplitView.qml
index 15db7350..38b7f839 100644
--- a/src/controls/SplitView.qml
+++ b/src/controls/SplitView.qml
@@ -449,7 +449,7 @@ Item {
anchors.rightMargin: (parent.width <= 1) ? -defaultMargin : 0
anchors.topMargin: (parent.height <= 1) ? -defaultMargin : 0
anchors.bottomMargin: (parent.height <= 1) ? -defaultMargin : 0
- hoverEnabled: true
+ hoverEnabled: Private.Settings.hoverEnabled
drag.threshold: 0
drag.target: parent
drag.axis: root.orientation === Qt.Horizontal ? Drag.XAxis : Drag.YAxis
diff --git a/src/controls/Styles/Base/CalendarStyle.qml b/src/controls/Styles/Base/CalendarStyle.qml
index d8af6ab1..590f67db 100644
--- a/src/controls/Styles/Base/CalendarStyle.qml
+++ b/src/controls/Styles/Base/CalendarStyle.qml
@@ -526,7 +526,7 @@ Style {
id: mouseArea
anchors.fill: parent
- hoverEnabled: true
+ hoverEnabled: Settings.hoverEnabled
function cellIndexAt(mouseX, mouseY) {
var viewContainerPos = viewContainer.mapFromItem(mouseArea, mouseX, mouseY);
diff --git a/src/controls/qquickmenupopupwindow.cpp b/src/controls/qquickmenupopupwindow.cpp
index 1c5f8d0b..52063979 100644
--- a/src/controls/qquickmenupopupwindow.cpp
+++ b/src/controls/qquickmenupopupwindow.cpp
@@ -96,7 +96,7 @@ void QQuickMenuPopupWindow::setGeometry(int posx, int posy, int w, int h)
pw = parentItem()->window();
if (!pw)
pw = this;
- QRect g = pw->screen()->availableVirtualGeometry();
+ QRect g = pw->screen()->virtualGeometry();
if (posx + w > g.right()) {
if (qobject_cast<QQuickMenuPopupWindow *>(transientParent())) {
diff --git a/src/layouts/qquicklinearlayout.cpp b/src/layouts/qquicklinearlayout.cpp
index e22951ac..0b9c6f54 100644
--- a/src/layouts/qquicklinearlayout.cpp
+++ b/src/layouts/qquicklinearlayout.cpp
@@ -393,6 +393,11 @@ void QQuickGridLayoutBase::invalidate(QQuickItem *childItem)
Q_D(QQuickGridLayoutBase);
if (!isReady())
return;
+ if (d->m_rearranging) {
+ d->m_invalidateAfterRearrange << childItem;
+ return;
+ }
+
quickLayoutDebug() << "QQuickGridLayoutBase::invalidate()";
if (childItem) {
@@ -432,6 +437,11 @@ void QQuickGridLayoutBase::updateLayoutItems()
Q_D(QQuickGridLayoutBase);
if (!isReady())
return;
+ if (d->m_rearranging) {
+ d->m_updateAfterRearrange = true;
+ return;
+ }
+
quickLayoutDebug() << "QQuickGridLayoutBase::updateLayoutItems";
d->engine.deleteItems();
insertLayoutItems();
@@ -540,6 +550,7 @@ void QQuickGridLayoutBase::rearrange(const QSizeF &size)
if (!isReady())
return;
+ d->m_rearranging = true;
quickLayoutDebug() << objectName() << "QQuickGridLayoutBase::rearrange()" << size;
Qt::LayoutDirection visualDir = effectiveLayoutDirection();
d->engine.setVisualDirection(visualDir);
@@ -555,6 +566,16 @@ void QQuickGridLayoutBase::rearrange(const QSizeF &size)
// This could happen if there is a binding like implicitWidth: height
QQuickLayout::rearrange(size);
d->engine.setGeometries(QRectF(QPointF(0,0), size), d->styleInfo);
+ d->m_rearranging = false;
+
+ foreach (QQuickItem *invalid, d->m_invalidateAfterRearrange)
+ invalidate(invalid);
+ d->m_invalidateAfterRearrange.clear();
+
+ if (d->m_updateAfterRearrange) {
+ updateLayoutItems();
+ d->m_updateAfterRearrange = false;
+ }
}
bool QQuickGridLayoutBase::shouldIgnoreItem(QQuickItem *child, QQuickLayoutAttached *&info, QSizeF *sizeHints)
diff --git a/src/layouts/qquicklinearlayout_p.h b/src/layouts/qquicklinearlayout_p.h
index 322ae93e..0f43badd 100644
--- a/src/layouts/qquicklinearlayout_p.h
+++ b/src/layouts/qquicklinearlayout_p.h
@@ -109,6 +109,8 @@ class QQuickGridLayoutBasePrivate : public QQuickLayoutPrivate
public:
QQuickGridLayoutBasePrivate() : m_disableRearrange(true)
, m_isReady(false)
+ , m_rearranging(false)
+ , m_updateAfterRearrange(false)
, m_layoutDirection(Qt::LeftToRight)
{}
@@ -122,6 +124,9 @@ public:
Qt::Orientation orientation;
unsigned m_disableRearrange : 1;
unsigned m_isReady : 1;
+ unsigned m_rearranging : 1;
+ unsigned m_updateAfterRearrange : 1;
+ QVector<QQuickItem *> m_invalidateAfterRearrange;
Qt::LayoutDirection m_layoutDirection : 2;
QSet<QQuickItem *> m_ignoredItems;
diff --git a/tests/auto/controls/data/tst_gridlayout.qml b/tests/auto/controls/data/tst_gridlayout.qml
index f2ed533c..c0494a7d 100644
--- a/tests/auto/controls/data/tst_gridlayout.qml
+++ b/tests/auto/controls/data/tst_gridlayout.qml
@@ -922,6 +922,7 @@ Item {
}
Component {
+
id: layout_Margins_Component
GridLayout {
columns: 2
@@ -985,7 +986,36 @@ Item {
compare(layout.implicitWidth, 10 + 20 + 4 + 4 + 20 + 6)
c0.Layout.bottomMargin = undefined
compare(layout.implicitHeight, 3 + 20 + 10 + 4 + 20 + 5)
+ }
+
+ Component {
+ id: layout_invalidateWhileRearranging_Component
+
+ GridLayout {
+ columns: 1
+ Rectangle {
+ height: 50
+ Layout.fillWidth: true
+ color: 'blue'
+ }
+ Rectangle {
+ height: 50
+ Layout.fillWidth: true
+ color: 'red'
+ onYChanged: {
+ visible = false;
+ }
+ }
+ }
+ }
+
+ function test_invalidateWhileRearranging_QTBUG_44139()
+ {
+ var layout = layout_invalidateWhileRearranging_Component.createObject(container)
+
+ waitForRendering(layout);
+ verify(layout.children[1].visible == false);
layout.destroy()
}
}