aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml8
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml8
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-button-textonly.qml8
-rw-r--r--src/imports/platform/qquickplatformmenu_p.h1
-rw-r--r--src/imports/platform/qquickplatformstandardpaths_p.h2
-rw-r--r--src/imports/platform/qquickplatformsystemtrayicon_p.h2
-rw-r--r--src/imports/platform/qtlabsplatformplugin.cpp6
-rw-r--r--src/quicktemplates2/qquickdialogbuttonbox.cpp15
-rw-r--r--src/quicktemplates2/qquickslider.cpp6
9 files changed, 29 insertions, 27 deletions
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml
index 43110494..32b0797a 100644
--- a/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -11,8 +11,8 @@
** 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.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
@@ -20,7 +20,7 @@
** 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.
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml
index e3be7a4b..870da262 100644
--- a/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -11,8 +11,8 @@
** 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.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
@@ -20,7 +20,7 @@
** 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.
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-button-textonly.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-button-textonly.qml
index 883340dc..fe871639 100644
--- a/src/imports/controls/doc/snippets/qtquickcontrols2-button-textonly.qml
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-button-textonly.qml
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -11,8 +11,8 @@
** 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.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
@@ -20,7 +20,7 @@
** 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.
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/imports/platform/qquickplatformmenu_p.h b/src/imports/platform/qquickplatformmenu_p.h
index 7456c660..b5c23b61 100644
--- a/src/imports/platform/qquickplatformmenu_p.h
+++ b/src/imports/platform/qquickplatformmenu_p.h
@@ -209,5 +209,6 @@ private:
QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickPlatformMenu)
+Q_DECLARE_METATYPE(QPlatformMenu::MenuType)
#endif // QQUICKPLATFORMMENU_P_H
diff --git a/src/imports/platform/qquickplatformstandardpaths_p.h b/src/imports/platform/qquickplatformstandardpaths_p.h
index c3d879b0..e2f4e11e 100644
--- a/src/imports/platform/qquickplatformstandardpaths_p.h
+++ b/src/imports/platform/qquickplatformstandardpaths_p.h
@@ -86,5 +86,7 @@ private:
QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickPlatformStandardPaths)
+Q_DECLARE_METATYPE(QStandardPaths::StandardLocation)
+Q_DECLARE_METATYPE(QStandardPaths::LocateOptions)
#endif // QQUICKPLATFORMSTANDARDPATHS_P_H
diff --git a/src/imports/platform/qquickplatformsystemtrayicon_p.h b/src/imports/platform/qquickplatformsystemtrayicon_p.h
index 7aa07512..77a78f30 100644
--- a/src/imports/platform/qquickplatformsystemtrayicon_p.h
+++ b/src/imports/platform/qquickplatformsystemtrayicon_p.h
@@ -137,5 +137,7 @@ private:
QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickPlatformSystemTrayIcon)
+Q_DECLARE_METATYPE(QPlatformSystemTrayIcon::ActivationReason)
+Q_DECLARE_METATYPE(QPlatformSystemTrayIcon::MessageIcon)
#endif // QQUICKPLATFORMSYSTEMTRAYICON_P_H
diff --git a/src/imports/platform/qtlabsplatformplugin.cpp b/src/imports/platform/qtlabsplatformplugin.cpp
index bcb9ac98..1eac7d80 100644
--- a/src/imports/platform/qtlabsplatformplugin.cpp
+++ b/src/imports/platform/qtlabsplatformplugin.cpp
@@ -56,9 +56,6 @@
# include "qquickplatformsystemtrayicon_p.h"
#endif
-Q_DECLARE_METATYPE(QStandardPaths::StandardLocation)
-Q_DECLARE_METATYPE(QStandardPaths::LocateOptions)
-
static inline void initResources()
{
#ifdef QT_STATIC
@@ -102,6 +99,7 @@ void QtLabsPlatformPlugin::registerTypes(const char *uri)
qmlRegisterType<QQuickPlatformMenuItem>(uri, 1, 0, "MenuItem");
qmlRegisterType<QQuickPlatformMenuItemGroup>(uri, 1, 0, "MenuItemGroup");
qmlRegisterType<QQuickPlatformMenuSeparator>(uri, 1, 0, "MenuSeparator");
+ qRegisterMetaType<QPlatformMenu::MenuType>();
qmlRegisterUncreatableType<QPlatformDialogHelper>(uri, 1, 0, "StandardButton", QQuickPlatformDialog::tr("Cannot create an instance of StandardButton"));
qmlRegisterSingletonType<QQuickPlatformStandardPaths>(uri, 1, 0, "StandardPaths", QQuickPlatformStandardPaths::create);
@@ -110,6 +108,8 @@ void QtLabsPlatformPlugin::registerTypes(const char *uri)
#if QT_CONFIG(systemtrayicon)
qmlRegisterType<QQuickPlatformSystemTrayIcon>(uri, 1, 0, "SystemTrayIcon");
+ qRegisterMetaType<QPlatformSystemTrayIcon::ActivationReason>();
+ qRegisterMetaType<QPlatformSystemTrayIcon::MessageIcon>();
#endif
}
diff --git a/src/quicktemplates2/qquickdialogbuttonbox.cpp b/src/quicktemplates2/qquickdialogbuttonbox.cpp
index b6a9d757..cd971139 100644
--- a/src/quicktemplates2/qquickdialogbuttonbox.cpp
+++ b/src/quicktemplates2/qquickdialogbuttonbox.cpp
@@ -197,13 +197,13 @@ static QRectF alignedRect(Qt::LayoutDirection direction, Qt::Alignment alignment
qreal w = size.width();
qreal h = size.height();
if ((alignment & Qt::AlignVCenter) == Qt::AlignVCenter)
- y += rectangle.size().height() / 2 - h / 2;
+ y += (rectangle.size().height() - h) / 2;
else if ((alignment & Qt::AlignBottom) == Qt::AlignBottom)
y += rectangle.size().height() - h;
if ((alignment & Qt::AlignRight) == Qt::AlignRight)
x += rectangle.size().width() - w;
else if ((alignment & Qt::AlignHCenter) == Qt::AlignHCenter)
- x += rectangle.size().width() / 2 - w / 2;
+ x += (rectangle.size().width() - w) / 2;
return QRectF(x, y, w, h);
}
@@ -213,15 +213,12 @@ void QQuickDialogButtonBoxPrivate::resizeContent()
if (!contentItem)
return;
- const int halign = alignment & Qt::AlignHorizontal_Mask;
- const int valign = alignment & Qt::AlignVertical_Mask;
-
- const qreal cw = !halign ? q->availableWidth() : contentItem->implicitWidth();
- const qreal ch = !valign ? q->availableHeight() : contentItem->implicitHeight();
-
QRectF geometry = q->boundingRect().adjusted(q->leftPadding(), q->topPadding(), -q->rightPadding(), -q->bottomPadding());
- if (halign || valign)
+ if (alignment != 0) {
+ qreal cw = (alignment & Qt::AlignHorizontal_Mask) == 0 ? q->availableWidth() : contentItem->implicitWidth();
+ qreal ch = (alignment & Qt::AlignVertical_Mask) == 0 ? q->availableHeight() : contentItem->implicitHeight();
geometry = alignedRect(q->isMirrored() ? Qt::RightToLeft : Qt::LeftToRight, alignment, QSizeF(cw, ch), geometry);
+ }
contentItem->setPosition(geometry.topLeft());
contentItem->setSize(geometry.size());
diff --git a/src/quicktemplates2/qquickslider.cpp b/src/quicktemplates2/qquickslider.cpp
index 8628f981..b358663d 100644
--- a/src/quicktemplates2/qquickslider.cpp
+++ b/src/quicktemplates2/qquickslider.cpp
@@ -545,10 +545,10 @@ void QQuickSlider::setHandle(QQuickItem *handle)
qreal QQuickSlider::valueAt(qreal position) const
{
Q_D(const QQuickSlider);
- const qreal value = d->from + (d->to - d->from) * position;
+ const qreal value = (d->to - d->from) * position;
if (qFuzzyIsNull(d->stepSize))
- return value;
- return qRound(value / d->stepSize) * d->stepSize;
+ return d->from + value;
+ return d->from + qRound(value / d->stepSize) * d->stepSize;
}
/*!