aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/objectcount/tst_objectcount.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update to latest qml CMake APICraig Scott2021-06-051-5/+5
| | | | | | | | | | | | | | The new qml CMake API places a closer relationship between the backing target and the plugin target. Both are typically created together and they share a lot of common details. Instead of creating them in different parts of the source tree, they are now specified together. The src/imports area has effectively been absorbed into the other corresponding subdirectories below src with this change. Task-number: QTBUG-91621 Change-Id: I9bd32e9eb78c198ccc9db04e2829303cac323502 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Rename "Default" style to "Basic"Mitch Curtis2020-09-241-1/+1
| | | | | | | | | | | | [ChangeLog][Styles] The Default style was renamed to Basic to account for the introduction of the platform styles (macOS, Windows), which will be used by default (where possible) when no style is specified. Fixes: QTBUG-85984 Task-number: QTBUG-68814 Task-number: QTBUG-86403 Change-Id: I22b3199c8662e4ee5d55a1be1a51c9856ac62376 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* auto tests: remove all versioning from the test dataRichard Moe Gustavsen2020-09-041-1/+1
| | | | | | | | | | | | The problem is that QtQuick.Controls.macos is only available with revision 6.0. And when importing e.g QtQuick.Controls 2.15, we try to load a style with the same revision. But it simply doesn't exist. So remove all versioning from the tests to also support testing newer styles. Change-Id: I666a93ab03ec4c5dcf2055a363547f8cdac8d25e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Use qmlRegisterModuleImport() to register stylesMitch Curtis2020-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Register C++ types declarativelyMitch Curtis2020-08-261-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adapt to the new way of registering C++ types. The types need to be seen at compile time so that code can be generated that invokes them. This patch: - Adds QML_* macros where applicable. - Adapts the build system files to the new way of registering modules. - Splits up the QtQuick.Controls[.*].impl files into their own plugins, as we can only register one QML module per .pro file. - Removes C++ type registration calls in every plugin. - Moves private types from src/quickcontrols2/quickcontrols2.pro to src/quickcontrols2/impl/quickcontrols2-impl.pro. Some of these types need to be exposed to QML, but quickcontrols2.pro is already in use to declare the QtQuick.Controls import (and also provides the public C++ QQuickStyle API), and the new QML_IMPORT_NAME/VERSION syntax only allows one module per project. As some of the types that need to be exposed to QML are also referenced by some C++ code (e.g. tests, etc.), we just move all of the private types to the new library. Follow-up patches will register the QML types declaratively. Task-number: QTBUG-82922 Change-Id: Iaf9ee106237d61701d57a8896f3822304c8151a6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Tests: move duplicated addTestRows() to QQuickVisualTestUtilJ-P Nurmi2018-04-121-41/+8
| | | | | Change-Id: I723f1fe2e5df1ea4a09bd7e567079cdbc7124e6e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Default: merge SwitchIndicator back to Switch & SwitchDelegateJ-P Nurmi2017-11-021-1/+1
| | | | | | | | | | | | | | | | | | | See the previous commit (CheckIndicator) for more details. Before: running: /home/jpnurmi/Projects/qmlbench/benchmarks/auto/creation/quick.controls2/delegates_switch.qml [...] Average: 87.8 frames; using samples; MedianAll=87; StdDev=2.16795, CoV=0.0246919 After: running: qmlbench/benchmarks/auto/creation/quick.controls2/delegates_switch.qml [...] Average: 92.6 frames; using samples; MedianAll=92; StdDev=2.19089, CoV=0.0236597 Change-Id: Iea9e88e4e771ac27d336c2c87232704d33a226ec Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Default: merge RadioIndicator back to RadioButton & RadioDelegateJ-P Nurmi2017-11-021-1/+1
| | | | | | | | | | | | | | | | | | | See the previous commit (CheckIndicator) for more details. Before: running: qmlbench/benchmarks/auto/creation/quick.controls2/delegates_radiobutton.qml [...] Average: 91.6 frames; using samples; MedianAll=91; StdDev=1.51658, CoV=0.0165565 After: running: qmlbench/benchmarks/auto/creation/quick.controls2/delegates_radiobutton.qml [...] Average: 95.8 frames; using samples; MedianAll=96; StdDev=2.04939, CoV=0.0213924 Change-Id: Ic185241767d0b9422e86919356e3155e00803e56 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Default: merge CheckIndicator back to CheckBox & CheckDelegateJ-P Nurmi2017-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The internal CheckIndicator helper was introduced together with CheckDelegate in 1acb34a, because we naturally wanted to share the indicator instead of duplicating it. This change is controversial, because it leads to duplicate code, but keeping the indicator definitions inline is clearly faster. This is not seen as a huge problem for the Default style, because the indicator is not too complicated. Basically, this fixes a ~5% performance regression introduced by 1acb34a. Before: running: qmlbench/benchmarks/auto/creation/quick.controls2/delegates_checkbox.qml [...] Average: 72.8 frames; using samples; MedianAll=73; StdDev=1.48324, CoV=0.0203742 After: running: qmlbench/benchmarks/auto/creation/quick.controls2/delegates_checkbox.qml [...] Average: 77 frames; using samples; MedianAll=77; StdDev=1.41421, CoV=0.0183664 Change-Id: Ibee0e29e83a64ee4a6a772a90b1784a9c8c715bb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Update benchmarks for the new stylesJ-P Nurmi2017-09-111-0/+1
| | | | | | | | | | | | | | | | | Fusion was missing from tst_creationtime, and Imagine was missing from tst_objectcount. Furthermore, they were both missing from the list of dependencies declared in data/dependencies.qml, which is necessary in static builds and also expected to help with a random failure spotted in the CI logs: QWARN : tst_ObjectCount::qobjects(fusion/ApplicationWindow.qml) QQmlComponent: Component is not ready FAIL! : tst_ObjectCount::qobjects(fusion/ApplicationWindow.qml) 'object.data()' returned FALSE. (file:///C:/Users/qt/work/install/qml/QtQuick/Controls.2/Fusion/ApplicationWindow.qml:40 module "QtQuick.Controls.Fusion" version 2.3 is not installed) tst_objectcount.cpp(141) : failure location Change-Id: Ibb85b3024f1bb9d1e2a9654aeba39adb378fdec6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* benchmarks: avoid "Empty filename passed to function" warningsJ-P Nurmi2017-09-071-3/+6
| | | | | | | | Add isEmpty() checks to avoid annoying warnings from QFileSystemEngine for Unix. Change-Id: I20b4f07605692271468dfc26b3c968406323de98 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Say hello to the Fusion styleJ-P Nurmi2017-05-301-0/+1
| | | | | | | | [ChangeLog][Controls] Introduced a Fusion style that offers a platform agnostic desktop-oriented look'n'feel. Change-Id: Id1c1baf10f4b3a79e89bcc72f6d170ed0b2cc8b0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_objectcount: use setBenchmarkResult() instead of printLiang Qi2017-05-161-13/+6
| | | | | Change-Id: Ieb435b6ac929da753cfff0b157d18d4218cb50d9 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* tst_objectcount: data-driven qobjects vs. qquickitemsJ-P Nurmi2017-05-161-50/+29
| | | | | Change-Id: Ia1f9f0fe9d0d907b16159e964573ba1273cc75b9 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2017-01-111-1/+1
|\ | | | | | | Change-Id: If797ac58344b20e8de4379343131c097247ba2f2
| * Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | | | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Material: share the CursorDelegateJ-P Nurmi2016-10-281-1/+1
|/ | | | | | | | Duplicate code in TextField, TextArea, and SpinBox. The next one is editable ComboBox. Change-Id: Ibbd054d2f945f4964ee0007f9e9dc8a9450902e9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-09-061-5/+6
|\ | | | | | | Change-Id: Ief98cd56abd13cfa4e30578e150207462a8243b8
| * Replace 'foreach' with 'range for'Anton Kudryavtsev2016-09-021-5/+6
| | | | | | | | | | | | | | | | And add QT_NO_FOREACH define to .qmake.conf. Now QuickControls2 is 'foreach' free. Change-Id: I98695258859decadae6fd2f23f5f6f5ef2b0550f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Bump up all controls and templates imports to version 2.1J-P Nurmi2016-07-081-1/+1
|/ | | | | | | | | | | | Controls must import templates version 2.1 in order to "inherit" 1-revisioned properties, methods, and signals. So far, this has been done case by case, but it's less error prone and more clear to change them all. For example, if you ever see a source file pasted/linked somewhere, it's easy to identify the version it belongs to. Change-Id: I41609ec1a22bc05ac3e79f953a147ca42d9e0786 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tests: skip material/BoxShadow.qml and material/ElevationEffect.qmlJ-P Nurmi2016-05-061-1/+1
| | | | | | | | | These are not standalone controls, but internal helper types. They are tested and benchmarked together with the enclosing control, just like the various indicator types. Change-Id: I41b756b5f60dbd25719707da5372e13184092748 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* import Qt.labs.controls 1.0 => QtQuick.Controls 2.0J-P Nurmi2016-04-211-5/+5
| | | | | | | | | Docs, resources, .metainfo and plugins.qmltypes will be updated in follow up commits. Change-Id: I4438c5bfb8802bff0fa15c56431cfd288f179861 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Tests: prepare for the upcoming import rename - part IIJ-P Nurmi2016-04-211-5/+5
| | | | | | | Move the Qt/labs/ prefix out of addTestRows(). Change-Id: I1bd69fee15e795ca40f8c767dc86be5f80f66530 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Tests: prepare for the upcoming import renameJ-P Nurmi2016-04-201-6/+6
| | | | | | | | | | Looks like a duplicate string right now, but after the import rename, the target path (eg. QT_INSTALL_QML/QtQuick/Controls.2/Material) and the source path (eg. src/imports/controls/material) no longer have a common structure, so pass both paths to addTestRows(). Change-Id: I39228ed5f23434289a5bea95977bbd0e7a378641 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* tst_sanity|creationtime|objectcount: skip the internal indicator typesv5.7.0-beta1J-P Nurmi2016-04-121-3/+3
| | | | | Change-Id: I5c3d5309efeaab826e27ef97c3285803603e5e21 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Support static buildsJ-P Nurmi2016-01-131-7/+11
| | | | | Change-Id: I17bb9131603da912597777b2ec0b9be3894ed858 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* tst_objectcount: remove legacy controlsJ-P Nurmi2015-12-231-70/+0
| | | | | | | Moved to the qtquickcontrols repo, where they belong... Change-Id: I56e240d4b718dea123f83ab37f7f67e8a9489213 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* tst_objectcount: fake qbenchmark-like outputJ-P Nurmi2015-11-261-1/+4
| | | | | Change-Id: I20275e1a1d4d98710db1eadcd51bd17b84503130 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Add material style to benchmarksJ-P Nurmi2015-11-201-7/+43
| | | | | Change-Id: I2b8d09f8dcd1380af849f3263bf2ea7599681190 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add Universal styleJ-P Nurmi2015-11-121-0/+15
| | | | | | | https://dev.windows.com/design Change-Id: I1d8c633ae246724649a6ed71b300a56ba9572405 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* tst_objectcount: use componentsJ-P Nurmi2015-11-051-131/+89
| | | | | | | This makes it easier to add different styles to the test. Change-Id: Icd23c809ab9999840b5555f7fb658f38c8b7c15e Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Re-introduce SpinBoxJ-P Nurmi2015-10-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It came up in discussions at the QtWS that even if we have Tumbler, people still want and expect to have the good old SpinBox control. SpinBox has it pros, such as that it might work better inside a vertical Flickable, and that in multi-field forms it might visually align better with other controls like TextFields. An early mockup of SpinBox was removed in 1c0edf0. A quote from the commit message: SpinBox is a desktop centric control. It won't be provided in Qt Quick Controls 2.0, but maybe later when desktop support is re-considered. Qt Quick Controls 2.0 will focus on embedded and mobile. SpinBox is still available in 1.x. While it is true that SpinBox might not be optimal for touch or mobile, the real reason for the removal was that validating decimal number input is very complicated. Even though locales have well- defined thousand separators and decimal points, users have very different expectations on how strict or relaxed the input validation should be. This change re-introduces a touch-optimized integer-based SpinBox. What makes it more touch friendly than the earlier version is that it has now auto-repeating buttons. Limiting it to integers avoids the decimal number input validation problem. We can introduce a separate DoubleSpinBox later if necessary - just like in QtWidgets. Change-Id: I2819060eb5d1ae6a8c00b0f12be703456085079d Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add RangeSliderMitch Curtis2015-10-141-0/+4
| | | | | | | | | This is basically Slider, except with two handles. It's used to specify a range of values. Task-number: QTBUG-48667 Change-Id: Ib4f9afe5dc8343e307610943d338a2b574a01e4d Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* tst_objectcount: add missing controlsJ-P Nurmi2015-10-131-0/+20
| | | | | | Change-Id: I943ab2c7ca7d183e334f9feac15b99a23e47eeef Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Rename QtQuick.Controls 2.0 to Qt.labs.controls 1.0J-P Nurmi2015-10-011-22/+22
| | | | | Change-Id: I142622dd85e95ef70b11132e77ccf48701f2cabc Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Remove ToggleButtonJ-P Nurmi2015-09-251-4/+0
| | | | | | | | We don't have a sensible design. It's better not to have it at all than to have a confusing tiny bit tweaked clone of Switch. Change-Id: Ib0eabd075590100e9e49846c7172909525b54a57 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Remove the old TabView implementationJ-P Nurmi2015-06-111-4/+0
| | | | | Change-Id: I8d8aa96f2f37f458577a5a3ec681e3c9174d0918 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* tst_objectcount: warmup with Buttons & exclude the test QQmlComponentJ-P Nurmi2015-06-061-4/+7
| | | | | | | This ensures that singletons are excluded from the numbers. Change-Id: I14422b7b15d57273dd11717892ebd11eba650902 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Improve tst_objectcountJ-P Nurmi2015-06-061-5/+14
| | | | | | | | | Add support for VERBOSE=1 to get detailed object list, and improve the warmup by importing both controls and loading an image to avoid plugin loaders and image format plugins showing up in the numbers. Change-Id: I26cfdc6d71fe36b45b706164f696bbb7f055f078 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Rename benchmarksJ-P Nurmi2015-04-091-0/+231
Just to make it clear what they actually do. These project names are also visible in Qt Creator when choosing the run-target... Change-Id: I95dd54fd1b6cb3369ab19dbaccbd92d104ea5250 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>