Qt Declarative (Quick 2)
Go to file
Mitch Curtis d56c193eb4 QQuickPopupPositioner: avoid adding duplicate item change listeners
The issue is that QQuickPopupPositioner::setParentItem() is called when
the delegate has been created and assigned to the Repeater, then the
ancestor listeners are added, and then straight after that, the
benchmark item itself is parented to benchmarkRoot, which causes
QQuickPopupPositioner::itemParentChanged() to be called, which adds a
single ancestor listener: the QQuickRootItem (which was just added
previously as a result of QQuickPopupPositioner::setParentItem()
being called).

The item could be arbitrarily high up in the ancestry tree, so there's
no nice (i.e. fast) way of checking for duplicates in Controls 2
itself. Instead, use the new
QQuickItemPrivate::updateOrAddItemChangeListener() function which only
adds the listener if it doesn't already exist.

This avoids a heap-use-after-free in qmlbench when creating Menus.

Task-number: QTBUG-70729
Change-Id: I0efaa10167c4c9a9c4c1b65a5c34e683c3ec5732
Fixes: QTBUG-70729
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-10-04 08:16:11 +00:00
dist Add changes file for Qt 5.11.2 2018-09-03 04:44:02 +00:00
examples wearable: fix items still being visible when returning to LauncherPage 2018-09-10 08:52:15 +00:00
src QQuickPopupPositioner: avoid adding duplicate item change listeners 2018-10-04 08:16:11 +00:00
tests MenuBar: ensure the correct delegates are used when created via Component 2018-10-02 09:04:56 +00:00
.gitattributes Import the Qt Quick Controls 2 prototype 2015-02-05 14:50:29 +02:00
.gitignore Merge remote-tracking branch 'origin/5.9' into 5.10 2017-12-15 11:44:26 +01:00
.qmake.conf Bump version 2018-07-30 18:46:18 +02:00
.tag Import the Qt Quick Controls 2 prototype 2015-02-05 14:50:29 +02:00
LICENSE.FDL Add LICENSE.FDL for docs 2015-03-18 16:26:12 +02:00
LICENSE.GPL2 Fix license headers 2017-12-22 08:05:01 +00:00
LICENSE.GPL3 Fix license headers 2017-12-22 08:05:01 +00:00
LICENSE.GPLv3 Welcome to 2017 2017-01-09 17:29:40 +00:00
LICENSE.LGPL3 Fix license headers 2017-12-22 08:05:01 +00:00
LICENSE.LGPLv3 Welcome to 2017 2017-01-09 17:29:40 +00:00
README.md Update README.md 2017-12-22 12:47:54 +00:00
configure.json Make styles configurable features 2017-02-06 11:32:21 +00:00
qtquickcontrols2.pro Import the Qt Quick Controls 2 prototype 2015-02-05 14:50:29 +02:00
sync.profile Merge remote-tracking branch 'origin/5.6' into 5.7 2016-11-24 19:46:00 +01:00

README.md

Qt Quick Controls 2

Qt Quick Controls 2 Styles

The Qt Quick Controls 2 module delivers the next generation user interface controls based on Qt Quick. In comparison to the desktop-oriented Qt Quick Controls 1, Qt Quick Controls 2 are an order of magnitude simpler, lighter and faster, and are primarily targeted towards embedded and mobile platforms.

Qt Quick Controls 2 are based on a flexible template system that enables rapid development of entire custom styles and user experiences. Qt Quick Controls 2 comes with a selection of built-in styles:

  • Default style - a simple and minimal all-round style that offers the maximum performance
  • Fusion style - a platform-agnostic style that offers a desktop-oriented look'n'feel
  • Imagine style - a designer-friendly style based on image assets
  • Material style - a style based on the Google Material Design Guidelines
  • Universal style - a style based on the Microsoft Universal Design Guidelines

More information can be found in the following blog posts:

Help

If you have problems or questions, don't hesitate to:

Installation

The MINIMUM REQUIREMENT for building this project is to use the same branch of Qt 5. The dependencies are qtbase, qtxmlpatterns and qtdeclarative.

To install the controls into your Qt directory (QTDIR/qml):

qmake
make
make install

If you are compiling against a system Qt on Linux, you might have to use sudo make install to install the project.

Usage

Please refer to the Getting Started with Qt Quick Controls 2 documentation.