summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2017-03-02 10:22:22 +0100
committerPaul Olav Tvete <paul.tvete@qt.io>2017-03-02 10:23:17 +0100
commitba81daa6f58992f0724f0a43590fae3453d3948e (patch)
tree50ca39886f4a196708fcfdfad807dfaeb4d7fad5 /src
parent98ed5ba985f04f342a11d6a8550f843fd053b39d (diff)
parent7b6f57086bbc64ad2f9be0c75a462120fc031e86 (diff)
downloadqtquickcontrols-ba81daa6f58992f0724f0a43590fae3453d3948e.tar.gz
Merge remote-tracking branch 'qt/5.8' into 5.9
Change-Id: Ia4337204f3b69d63eb50d1b918685b098c77b48d
Diffstat (limited to 'src')
-rw-r--r--src/controls/Private/BasicButton.qml5
-rw-r--r--src/widgets/qquickqfiledialog_p.h4
-rw-r--r--src/widgets/widgets.pro60
-rw-r--r--src/widgets/widgetsplugin.cpp9
4 files changed, 58 insertions, 20 deletions
diff --git a/src/controls/Private/BasicButton.qml b/src/controls/Private/BasicButton.qml
index a9ca4c48..0206c72f 100644
--- a/src/controls/Private/BasicButton.qml
+++ b/src/controls/Private/BasicButton.qml
@@ -169,8 +169,10 @@ Control {
activeFocusOnTab: true
Keys.onPressed: {
- if (event.key === Qt.Key_Space && !event.isAutoRepeat && !behavior.pressed)
+ if (event.key === Qt.Key_Space && !event.isAutoRepeat && !behavior.pressed) {
behavior.keyPressed = true;
+ event.accepted = true;
+ }
}
onFocusChanged: if (!focus) behavior.keyPressed = false
@@ -180,6 +182,7 @@ Control {
behavior.keyPressed = false;
__action.trigger(button)
behavior.toggle()
+ event.accepted = true;
}
}
diff --git a/src/widgets/qquickqfiledialog_p.h b/src/widgets/qquickqfiledialog_p.h
index fef39584..9e20ae88 100644
--- a/src/widgets/qquickqfiledialog_p.h
+++ b/src/widgets/qquickqfiledialog_p.h
@@ -54,6 +54,8 @@
#include <QFileDialog>
#include "../dialogs/qquickabstractfiledialog_p.h"
+#if QT_CONFIG(filedialog)
+
QT_BEGIN_NAMESPACE
class QQuickQFileDialog : public QQuickAbstractFileDialog
@@ -104,4 +106,6 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickQFileDialog *)
+#endif // QT_CONFIG(filedialog)
+
#endif // QQUICKQFILEDIALOG_P_H
diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro
index 2e3c8164..04bfd21b 100644
--- a/src/widgets/widgets.pro
+++ b/src/widgets/widgets.pro
@@ -5,30 +5,54 @@ TARGET = widgetsplugin
TARGETPATH = QtQuick/PrivateWidgets
IMPORT_VERSION = 1.1
+QT += quick-private gui-private core-private qml-private widgets
+
SOURCES += \
- qquickqmessagebox.cpp \
- ../dialogs/qquickabstractmessagedialog.cpp \
- qquickqfiledialog.cpp \
- ../dialogs/qquickabstractfiledialog.cpp \
- qquickqcolordialog.cpp \
- ../dialogs/qquickabstractcolordialog.cpp \
- qquickqfontdialog.cpp \
- ../dialogs/qquickabstractfontdialog.cpp \
../dialogs/qquickabstractdialog.cpp \
widgetsplugin.cpp
HEADERS += \
- qquickqmessagebox_p.h \
- qmessageboxhelper_p.h \
- ../dialogs/qquickabstractmessagedialog_p.h \
- qquickqfiledialog_p.h \
- ../dialogs/qquickabstractfiledialog_p.h \
- qquickqcolordialog_p.h \
- ../dialogs/qquickabstractcolordialog_p.h \
- qquickqfontdialog_p.h \
- ../dialogs/qquickabstractfontdialog_p.h \
../dialogs/qquickabstractdialog_p.h
-QT += quick-private gui-private core-private qml-private widgets
+qtConfig(messagebox) {
+ HEADERS += \
+ qquickqmessagebox_p.h \
+ qmessageboxhelper_p.h \
+ ../dialogs/qquickabstractmessagedialog_p.h
+
+ SOURCES += \
+ qquickqmessagebox.cpp \
+ ../dialogs/qquickabstractmessagedialog.cpp
+}
+
+qtConfig(filedialog) {
+ SOURCES += \
+ qquickqfiledialog.cpp \
+ ../dialogs/qquickabstractfiledialog.cpp
+
+ HEADERS += \
+ qquickqfiledialog_p.h \
+ ../dialogs/qquickabstractfiledialog_p.h
+}
+
+qtConfig(colordialog) {
+ SOURCES += \
+ qquickqcolordialog.cpp \
+ ../dialogs/qquickabstractcolordialog.cpp
+
+ HEADERS += \
+ qquickqcolordialog_p.h \
+ ../dialogs/qquickabstractcolordialog_p.h
+}
+
+qtConfig(fontdialog) {
+ SOURCES += \
+ qquickqfontdialog.cpp \
+ ../dialogs/qquickabstractfontdialog.cpp
+
+ HEADERS += \
+ qquickqfontdialog_p.h \
+ ../dialogs/qquickabstractfontdialog_p.h
+}
load(qml_plugin)
diff --git a/src/widgets/widgetsplugin.cpp b/src/widgets/widgetsplugin.cpp
index 9ed0e6bc..65233756 100644
--- a/src/widgets/widgetsplugin.cpp
+++ b/src/widgets/widgetsplugin.cpp
@@ -82,11 +82,18 @@ public:
virtual void registerTypes(const char *uri)
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.PrivateWidgets"));
-
+#if QT_CONFIG(messagebox)
qmlRegisterType<QQuickQMessageBox>(uri, 1, 1, "QtMessageDialog");
+#endif
+#if QT_CONFIG(filedialog)
qmlRegisterType<QQuickQFileDialog>(uri, 1, 0, "QtFileDialog");
+#endif
+#if QT_CONFIG(colordialog)
qmlRegisterType<QQuickQColorDialog>(uri, 1, 0, "QtColorDialog");
+#endif
+#if QT_CONFIG(fontdialog)
qmlRegisterType<QQuickQFontDialog>(uri, 1, 1, "QtFontDialog");
+#endif
}
};