| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Change-Id: I547e94213f4b4d2c3ca3aeaa06330069e6311043
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This includes removal of the corresponding .prev_CMakeLists.txt files.
Pick-to: 6.1
Task-number: QTBUG-88742
Change-Id: I4247294258629c92e80914518e9208019090c815
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
|
|
| |
Modify special case locations to use the new API as well.
Task-number: QTBUG-86815
Change-Id: I4a690095fcd4b1141550de86b6820ae2dd579429
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-82922
Change-Id: I75f4a553a6bb260f77bfa791f12fa42e80131e09
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch completes the cumulative work done in previous patches.
- Uses qmlRegisterModuleImport() to register styles. This has some
added requirements:
- Each style must now be a QML module -- that is, it must have a
qmldir file.
- As a result of the above, the module must be available within the
QML import path in order to be found.
- The various forms of accepted style names have been reduced down to
one ("Material", "MyStyle", etc). See below for an explanation of
why.
- The following API in QQuickStyle is removed:
addStylePath(), availableStyles(), path(), stylePathList(). These
no longer make sense now that we reuse the existing QML import
system.
- Adds the tst_qquickstyleselector auto test back as "styleimports".
qmlRegisterModuleImport() vs resolvedUrl()
Previously we would use QQuickStyleSelector to select individual
QML files based on which style was set. We'd do this once when
QtQuick.Controls was first imported.
With Qt 6, and the requirement that each style be a proper QML
module, qmlRegisterModuleImport() was introduced. This allows us
to "link" one import with another. For an example of what this
looks like in practice, suppose the style was set to "MyStyle",
and the fallback to "Material". The "QtQuick.Controls" import
will be linked to "MyStyle", "MyStyle" to
"QtQuick.Controls.Material", and as a final fallback (for controls
like Action which only the Default style implements),
"QtQuick.Controls.Material" to "QtQuick.Controls.Default".
This is the same behavior as in Qt 5 (see qquickstyleselector.cpp):
// 1) requested style (e.g. "MyStyle", included in d->selectors)
// 2) fallback style (e.g. "Material", included in d->selectors)
// 3) default style (empty selector, not in d->selectors)
This is a necessary step to enable compilation of QML to C++.
Reducing the set of accepted style names
The problem
In QtQuickControls2Plugin() we need to call
QQuickStylePrivate::init(baseUrl()) in order to detect if the style
is a custom style in QQuickStyleSpec::resolve() (by checking if the
style path starts with the base URL). In Qt 5, init() is called in
QtQuickControls2Plugin::registerTypes(), but in Qt 6 that's too
late, because we need to call qmlRegisterModuleImport() in the
constructor. qmlRegisterModuleImport() itself requires the style to
have already been set in order to create the correct import URI
("QtQuick.Controls.X" for built-in styles, "MyCustomStyle" for
custom styles).
The solution
By reducing the valid forms for style names down to one:
./myapp -style MyStyle
we solve the problem of needing baseUrl() to determine if the
style is a custom style or not, but needing to call it too early
(since we now call qmlRegisterModuleImport() in
QtQuickControls2Plugin(), which itself requires the style to have
already been set). baseUrl() can't have been set before the
constructor is finished.
All of the various forms for _setting_ a style are still valid;
environment variables, qtquickcontrols2.conf, etc.
[ChangeLog][Important Behavior Changes] Custom styles must now have
a qmldir that lists the files that the style implements. For example,
for a style that only implements Button:
---
module MyStyle
Button 1.0 Button.qml
---
In addition, there is now only one valid, case-sensitive form for style
names: "Material", "MyStyle", etc.
These changes are done to help enable the compilation of QML code to
C++, as well as improve tooling capabilities.
[ChangeLog][Important Behavior Changes] The following API was removed:
- QQuickStyle::addStylePath()
- QQuickStyle::availableStyles()
- QQuickStyle::path()
- QQuickStyle::stylePathList()
- QT_QUICK_CONTROLS_STYLE_PATH
This API is no longer necessary and/or able to be provided now that
styles are treated as regular QML modules.
Task-number: QTBUG-82922
Change-Id: I3b281131903c7c3c1cf0616eb7486a872dccd730
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
As of Qt 6, the latest version will be used by default. This saves us a
lot of effort in terms of version bumps.
Task-number: QTBUG-82922
Change-Id: I74eba8185ec3ccc75bc293d4b2ea87d59e2d9928
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
| |
Change-Id: Ifd6b2289de6465a010f5f2a32789221767b4d5be
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|\
| |
| |
| | |
Change-Id: Ieb9bcfba9651d646509afd065ce2389ef74448cc
|
| |
| |
| |
| |
| |
| |
| |
| | |
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.
Change-Id: I3ed1abd00bf54da654c9ccade427f5756b99b595
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Up until this patch, we've always deleted "old" items when a new one is
assigned. For example, the style's implementation of contentItem will
be destroyed here as it is not accessible by the user and is no longer
used:
Button {
contentItem: Item { /* ... */ }
}
This was especially important before the introduction of deferred
execution, as the "default" items would always be created, regardless
of whether the user had overridden it with one of their own items.
By deleting the old items, we free unused resources that would
otherwise persist until application shutdown (calling gc() does not
result in the items being garbage-collected, from my testing).
Although this has largely worked without issues, deleting objects
that weren't created by us in C++ is not supported. User-assigned items
can be created in QML (with JavaScriptOwnership) or C++ (with
CppOwnership), and it is up to the user and/or the QML engine to
manage the lifetime of these items.
After the introduction of deferred execution, it became possible to
skip creation of the default items altogether, meaning that there was
nothing to delete when assigning a new, user-specified item. This
requires that no ids are used in these items, as doing so prevents
deferred execution. Assuming that users avoid using ids in their items,
there should be no unused items that live unnecessarily until
application shutdown. The remaining cases where items do not get
destroyed when they should result from the following:
- Imperative assignments (e.g. assigning an item to a Button's
contentItem in Component.onCompleted). We already encourage
declarative bindings rather than imperative assignments.
- Using ids in items.
Given that these are use cases that we will advise against in the
documentation, it's an acceptable compromise.
[ChangeLog][Important Behavior Changes] Old delegate items (background,
contentItem, etc.) are no longer destroyed, as they are technically
owned by user code. Instead, they are hidden, unparented from the
control (QQuickItem parent, not QObject), and Accessible.ignored is
set to true. This prevents them from being unintentionally visible and
interfering with the accessibility tree when a new delegate item is
set.
Change-Id: I56c39a73dfee989dbe8f8b8bb33aaa187750fdb7
Task-number: QTBUG-72085
Fixes: QTBUG-70144
Fixes: QTBUG-75605
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| | |
Change-Id: I3a57449c9025e22414b8337fcffdeb0f4d769af2
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/
|
|
|
|
|
|
| |
Initial conversion of QtQuickControls2 tests.
Change-Id: I7e09e387ec90f89cc2856c7f7f2cb810b03b7fa3
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change makes all Qt Quick Controls 2 imports match the current
Qt minor version, which is 12 as of this patch.
It also updates all other Qt Quick imports to match.
This will also make future version bumps easier as all version numbers
in existing code/docs will match.
The following commands were used to verify that no old versions remain:
for i in `seq 0 11`; do git grep "import QtGraphicalEffects.*1.$i$"; done
for i in `seq 0 11`; do git grep "import QtQuick 2.$i$"; done
for i in `seq 0 11`; do git grep "import QtQuick.Layouts 1.$i$"; done
for i in `seq 0 5`; do git grep "import QtQuick.Controls.*2.$i$"; done
for i in `seq 0 11`; do git grep "import QtQuick.Templates 2.$i as T$"; done
[ChangeLog] From Qt 5.12 onwards, all import versions in
Qt Quick Controls 2 follow the same minor version as Qt's
minor version number. For example, the import version for Qt 5.12 is:
"import QtQuick.Controls 2.12".
Change-Id: I6d87573f20912e041d9c3b7c773cc7bf7b152ec3
Fixes: QTBUG-71095
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
| |
Change-Id: I496a6a60383c0332ec52e9349892c8923ed42c76
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
|
|\
| |
| |
| | |
Change-Id: I697f98d5214f487c915032d744ec593da05368a8
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Unlike other delegates, such as background and contentItem, popup is
not unconditionally executed upon component completion. For performance
reasons, its execution is delayed until the popup is needed, that is,
the popup is accessed or shown.
When the popup is accessed, we use the current completion status via
isComponentComplete() to determine whether its execution must be
completed immediately, or if we can wait until componentComplete().
However, if the popup was accessed while the combobox itself was being
completed (used in ComboBox's bindings), the popup was never completed
because isComponentComplete() was still returning false even though the
popup was actually being indirectly accessed from componentComplete().
A simple execution order change, to complete the combobox itself before
the popup, fixes the problem.
Task-number: QTBUG-65962
Change-Id: I4764eb7e273e7f6fa1dab1a65a02b87722ee7cba
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/imports/controls/Tumbler.qml
src/quicktemplates2/qquicktumbler.cpp
src/quicktemplates2/qquicktumbler_p.h
src/quicktemplates2/qquicktumbler_p_p.h
Change-Id: I8d50991183fe3c5b50a49e00f01bcd3049f5346c
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now that the contentItem is created at a different stage, we
have to shuffle some code around and add some null checks.
Task-number: QTBUG-50992
Change-Id: I34d3a9ea9cb9ab54008a1015b37b1666538c085e
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
|
| |
| |
| |
| |
| |
| | |
Task-number: QTBUG-50992
Change-Id: Ifb41a8caf6b406249d6da4783c546816d9b51581
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| | |
Task-number: QTBUG-65341
Change-Id: I3bfd36f1d1e275eb507184c376599aa7751a069e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I7cf0a01648d95c386cbf916107546e4f46fadc73
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/imports/controls/BusyIndicator.qml
src/imports/controls/CheckBox.qml
src/imports/controls/CheckDelegate.qml
src/imports/controls/ComboBox.qml
src/imports/controls/DelayButton.qml
src/imports/controls/Dial.qml
src/imports/controls/ItemDelegate.qml
src/imports/controls/MenuItem.qml
src/imports/controls/RadioButton.qml
src/imports/controls/RadioDelegate.qml
src/imports/controls/SwipeDelegate.qml
src/imports/controls/Switch.qml
src/imports/controls/SwitchDelegate.qml
src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc
src/imports/controls/material/CheckDelegate.qml
src/imports/controls/material/ItemDelegate.qml
src/imports/controls/material/MenuItem.qml
src/imports/controls/material/RadioDelegate.qml
src/imports/controls/material/SwipeDelegate.qml
src/imports/controls/material/SwitchDelegate.qml
src/imports/controls/qquickdefaultbusyindicator.cpp
src/imports/controls/qquickdefaultbusyindicator_p.h
src/imports/controls/qtquickcontrols2plugin.cpp
src/imports/controls/universal/CheckDelegate.qml
src/imports/controls/universal/ItemDelegate.qml
src/imports/controls/universal/MenuItem.qml
src/imports/controls/universal/RadioDelegate.qml
src/imports/controls/universal/SwipeDelegate.qml
src/imports/controls/universal/SwitchDelegate.qml
src/quickcontrols2/quickcontrols2.pri
src/quicktemplates2/qquickcontrol.cpp
src/quicktemplates2/qquickmenu.cpp
src/quicktemplates2/qquickpopup_p.h
Change-Id: Ib25c8b4a7fe018b7c0ade9b02bfaaa6980118c15
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Same as da27cace for the Default style.
An internal ID in the OpacityAnimator element prevented deferred
execution for the whole content item. Apply the same visibility trick
in C++ to avoid having to use an ID in QML.
Change-Id: I4b54bbe3044aff9603b1135ac25d7325e01fdff2
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I8ee27a0c65c9ce8c9cc48c6f59d2b34d02849be8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Due to unclear auto test failurs, Tumbler does not yet have deferred
execution enabled for its content item. Because of this, the test is
getting full of skips and expect fail's for Tumbler. Just leave it out
for now and restore later when Tumbler is fixed.
Change-Id: Iab9465e002572d15e5bda6dbd53b71594f593703
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Fix style selection, and make override() actually fail with
internal IDs in the built-in styles.
Change-Id: Ied321c46cd74039f84b683fb6df99aef2d488eef
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the QML engine refuses to defer execution of a delegate (it contains
an ID), we must make sure to cancel any pending deferred execution for
the same delegate. Otherwise, we may end up overriding a custom (non-
deferred) delegate with a default (deferred) delegate.
This patch adds a new test style "identified" to tst_customization.
This style contains delegates with IDs so we can test the behavior with
IDs in base styles. Furthermore, overriding delegates is now tested
in various ways (with and without IDs in the base and custom styles) in
a separate test method. This is done by generating QML code to override
delegates with dummy Item instances with appropriate IDs and names.
Task-number: QTBUG-65341
Change-Id: Ie6dca287cb74672004d9d8f599760b9d32c3a380
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
An ID in the internal Text element prevented deferred execution for
the whole content item. The ID was used for two reasons. First of all,
it was used to propagate implicit size from the Text element to the
root of the content item. Secondly, it was used to calculate clip areas
to provide the same text in two different colors. This patch provides
two internal C++ helpers, ItemGroup and ClippedText, that provide these
functionalities without the need of using IDs in QML. At the same time
we got rid of two wrapper Items and simplified some QML bindings, which
results to a nice boost (18->22) in qmlbench on TX1.
Task-number: QTBUG-65341
Change-Id: Icf9c09356cf5c0ed641bde537bee7291bd260057
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
An internal ID in the OpacityAnimator element prevented deferred
execution for the whole content item. Apply the same visibility trick
in C++ to avoid having to use an ID in QML.
Task-number: QTBUG-65341
Change-Id: Icb20e4ecc60d1093e849737799bb269f7f03097a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the undesired internal IDs where easily possible, and
add expected failures for the harder ones for now.
Task-number: QTBUG-65341
Change-Id: I5964b2cb59652661c90141259c68b95c721cf6ca
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Maintain the tested controls and delegates in a single array that can
be re-used for testing all styles without repetitive and error-prone
hand-written data rows.
For this to work, the structure of the tested styles must match. The
"incomplete" and "override" styles filled in all possible delegates,
whereas the "simple" style filled in only the normally used delegates.
The test styles have now been synced with the structure of our built-
in styles. For example, Dials and Sliders don't normally have a content
item, and CheckBoxes and RadioButtons don't normally have a background.
Change-Id: I48a26ee170f66882c55b54a282f2e4b3a3875f9a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|/
|
|
|
|
|
|
|
|
|
| |
QQuickPopup is backed by a QQuickControl subclass aka QQuickPopupItem.
However, since the QML engine sees "background" and "contentItem" as
properties of QQuickPopup, we must ensure that the deferred properties
are executed for the QQuickPopup wrapper object.
Task-number: QTBUG-50992
Change-Id: I2ec055b382e41530a6f4a740cb80853c0181c21a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
| |
Tumbler is excluded because test_customContentItemAtConstruction()
starts failing if deferred execution is enabled for the content item.
Task-number: QTBUG-50992
Change-Id: I11022c3c380311396453cf6229e068e4aae2d82a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
| |
Change-Id: Icb22f656893c89f61233bb547f03e63240bb8f97
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add more test cases, and clarify the roles of the test styles.
- empty: no delegates at all
- incomplete: has all delegates, but with no bindings that access
delegates and therefore trigger creation (tests that delegates must
be created regardless)
- simple: has all delegates and creates bindings to simulate a full
style
- override: overrides the simple style and tests that the default
instances of overridden delegates are not created
There are still several non-popup controls that lack deferred
execution. These are marked with QEXPECT_FAIL() to make it easy
to track what's missing. This list still excludes all popups.
Task-number: QTBUG-50992
Change-Id: I70ce42592e7a320251edebfab3030ccc7c0eb978
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
tst_controls::SpinBox::test_initialFocus() caught an issue that focus
was not transferred as expected when the creation of the content item
was deferred.
Task-number: QTBUG-50992
Change-Id: I6b9f5684ab7141fa4ebfe4c7fe3e32528553b96d
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-50992
Change-Id: I3e5c8bf7cc39fae0e882440079bb43292ace1810
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Don't collect multiple object names for the same object. It was
confusing that the "override" tests contained both "label-override"
and "label-simple", for instance.
- If creation fails, output the error as part of the FAIL message.
- Verify that the QML files actually contain correct types. One of
the RadioButton tests was accidentally running with a CheckBox.
Change-Id: Ide56eed84b5625652321bfe4ef5e32fcf6f45438
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-50992
Change-Id: Ibba0e79f8eaf76336dad3708606484a2846b2912
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
As a special case, ComboBox defers the execution of the popup until
the popup is either accessed or made visible. This gives a nice boost
in creation time benchmarks (20->25, ~25%). The old optimization of
setting the delegate model only when the popup is visible is no longer
needed.
Task-number: QTBUG-50992
Change-Id: Ifeaceb759ab676bb54c6bc09dc97810eade72ca1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-50992
Change-Id: Ia07055d2fa3d30c91bdf3c526cf7301c7ed1ce2b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-50992
Change-Id: Ibbc946c3402c65f9b100fc74dde04e4d439c8535
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-50992
Change-Id: I6d205f8ea0c90986b18b7e6cedbf347f1ce38eec
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-50992
Change-Id: I99a8d97e7f25cfff398fb30e365c7b245b738c37
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-50992
Change-Id: I8e626d1a0585f93cbd612aca39a1e9050f5e0ed3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-50992
Change-Id: I432be00d81344ce129bc8906370555b134fdf423
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Note: It is important to repeat the names of the deferred properties
in base classes. The QML engine ask for the class info from the meta-
object. A class info declaration in a sub-class overshadows the class
info declaration by the same name in the base class.
Task-number: QTBUG-50992
Change-Id: Ib674b943db2f0bf196c9386ea22b511715c0a98f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
In practice, deferring the execution of the delegates (until
accessed) means that the default delegate item does not get created
at all, when a custom control replaces it at construction time.
Button {
background: Rectangle { ... }
}
Before, such custom Button would never be faster than the original
one, because the default delegate was first created and then thrown
away at construction time. Originally, this was not considered a huge
problem, because the plan was to keep the default delegates so light-
weight that it wouldn't matter. However, then came the fancy styles
with shadows and effects and thus, heavier default delegates. There's
also a growing demand for more features, and the default delegates
are slowly getting heavier...
Now, after this patch, if you replace a heavy default delegate with
a light and simple custom delegate, the result is a much faster
control. For example, replacing Material style Button's background,
which has a shadow effect, with a plain Rectangle gives a ~10x boost,
because the default background with its heavy shadow effect is not
executed at all.
At the same time, deferring the execution of the default delegates
avoids troubles with asynchronous incubation, because we don't need
to destroy an object in the middle of the incubation process.
Task-number: QTBUG-50992
Change-Id: I2274bff99b9ff126d3748278d58d859222910c98
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|