aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-01-31 09:04:29 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2018-01-31 13:01:04 +0100
commit5d27e14e4ca49263d9c3309b5e93d4cb386063cc (patch)
tree714832e22d596c721744fd080148856a95f6d8f5 /src
parentac6f4903aeb2e8399b5aa538b35a760f0392568c (diff)
parentc3858bd53974e486e03537d1937deb0020828556 (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Diffstat (limited to 'src')
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc12
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc1
-rw-r--r--src/quicktemplates2/qquickcombobox.cpp2
-rw-r--r--src/quicktemplates2/qquickcontrol.cpp1
4 files changed, 14 insertions, 2 deletions
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
index eed9ff94..3ab07ae2 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
@@ -122,6 +122,9 @@
their actual counterparts in the Qt Quick Controls 2 module. You can repeat
this process for any control that you wish to add.
+ An added benefit of these three methods is that it's not necessary to
+ implement the template from scratch.
+
\section1 Creating a Custom Style
There are several ways to go about creating your own styles. Below, we'll
@@ -130,12 +133,19 @@
\section2 Definition of a Style
In Qt Quick Controls 2, a style is essentially an interchangeable set of
- QML files within a single directory. There are two requirements for a style
+ QML files within a single directory. There are three requirements for a style
to be \l {Using Styles in Qt Quick Controls 2}{usable}:
\list
\li At least one QML file whose name matches a control (for example,
\c Button.qml) must exist.
+ \li Each QML file must contain the relevant type from the \l {Qt Quick Templates 2}
+ {QtQuick.Templates} import as the root item. For example,
+ Button.qml must contain a Button template as its root item.
+
+ If we instead used the corresponding type from the \l {Qt Quick Controls 2}
+ {QtQuick.Controls} import as we did in the previous section, it would not work:
+ the control we were defining would try to derive from itself.
\li The files must be in a directory in the filesystem or in the
\l {The Qt Resource System}{resource system}.
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
index 21eca464..a1a74ec9 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
@@ -137,6 +137,7 @@
\li \l {Imagine Style}
\li \l {Material Style}
\li \l {Universal Style}
+ \li \l {Customizing Qt Quick Controls 2}
\li \l {Using File Selectors with Qt Quick Controls 2}
\li \l {Deploying Qt Quick Controls 2 Applications}
\li \l {Qt Quick Controls 2 Configuration File}
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp
index f1e05b7e..b4d9bead 100644
--- a/src/quicktemplates2/qquickcombobox.cpp
+++ b/src/quicktemplates2/qquickcombobox.cpp
@@ -1647,9 +1647,9 @@ void QQuickComboBox::componentComplete()
{
Q_D(QQuickComboBox);
d->executeIndicator(true);
+ QQuickControl::componentComplete();
if (d->popup)
d->executePopup(true);
- QQuickControl::componentComplete();
if (d->delegateModel && d->ownModel)
static_cast<QQmlDelegateModel *>(d->delegateModel)->componentComplete();
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp
index 080317d8..67c89729 100644
--- a/src/quicktemplates2/qquickcontrol.cpp
+++ b/src/quicktemplates2/qquickcontrol.cpp
@@ -1446,6 +1446,7 @@ void QQuickControl::componentComplete()
d->executeBackground(true);
d->executeContentItem(true);
QQuickItem::componentComplete();
+ d->resizeBackground();
d->resizeContent();
if (!d->hasLocale)
d->locale = QQuickControlPrivate::calcLocale(d->parentItem);