aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickaction.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Templates: use C++11 default member initializationJ-P Nurmi2018-05-041-12/+1
| | | | | | | | | | | The code is more readable and less error-prone (this patch caught a few uninitialized members) when the members are initialized in the same place where they are declared. In many cases, empty default destructors can be entirely removed, and we get faster implicitly declared inline default constructors defined by the compiler. Change-Id: I14c5448afc901f9b2ac5965f28c1c26c0b646c08 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix double toggling through Action with checked AbstractButtonJoni Poikelin2017-12-131-5/+15
| | | | | | | | | | | Action caused checked state of the button to be reset back to its original value if checked status had been change through click or key press. To avoid this, separate private function has been added to that does not change the status. Task-number: QTBUG-65108 Change-Id: I8a5aaa9aab739db3ba10d0202f5fb718cc7195bd Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickAction: don't uncheck the checked action of an exclusive groupJ-P Nurmi2017-10-091-2/+5
| | | | | | | | The logic is adapted from QAction::activate(). Task-number: QTBUG-63674 Change-Id: I7af127ea917e40e6a8ca99c2528362cf6ad283b8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Make QQuickIcon a value typeJ-P Nurmi2017-05-101-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickIcon no longer inherits QObject, but becomes a light-weight implicitly shared Q_GADGET-type, that is passed by value the same way fonts and colors are. Before: SUB: OS: Fedora 25 (Workstation Edition) SUB: QPA: xcb SUB: GL_VENDOR: Intel Open Source Technology Center SUB: GL_RENDERER: Mesa DRI Intel(R) Haswell Desktop SUB: GL_VERSION: 3.0 Mesa 13.0.4 SUB: running: benchmarks/auto/creation/controls/delegates_buttoncontrol2.qml SUB: 110 frames SUB: 109 frames SUB: 109 frames SUB: 109 frames SUB: 109 frames SUB: Average: SUB: 109.2 frames; using samples; MedianAll=109; StdDev=0.447214, CoV=0.00409536 After: [...] SUB: running: benchmarks/auto/creation/controls/delegates_buttoncontrol2.qml SUB: 123 frames SUB: 124 frames SUB: 124 frames SUB: 122 frames SUB: 125 frames SUB: Average: SUB: 123.6 frames; using samples; MedianAll=124; StdDev=1.14018, CoV=0.00922472 Change-Id: I604532204fb94fc0726d0c9b8b6097f9ebc265e8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Use QQml_setParent_noEvent() for QQuickIconJ-P Nurmi2017-04-271-2/+4
| | | | | | | | QObject::setParent() sends QEvent::ChildAdded to the parent. We do not need such event while creating the grouped icon-property object. Change-Id: I1ab319f18fd49572eb14de0f7a085567700becfe Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickIcon: fix the type of the source propertyJ-P Nurmi2017-04-241-1/+1
| | | | | | | | | | | | | | | | | | | For example, something like: Button { icon.source: "../images/drawer.png" } did not work in the Gallery example, even though it works fine for Image elements etc. The URL needs to be resolved relative to the caller. By making the property an URL instead of a plain string, the QML engine does the correct thing automatically. Note: icon.source.length no longer works in auto tests, so it got replaced by a compare(). Change-Id: I5fdb3aa55003d2f04e5458b7636e4dae3fa9857c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: add missing Action::icon.colorJ-P Nurmi2017-04-241-0/+1
| | | | | Change-Id: Ib79690a991d41ecc8aa06beabfaad9b942c43de0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add ActionGroupJ-P Nurmi2017-04-191-2/+7
| | | | | | | | | [ChangeLog][Controls][ActionGroup] Introduced ActionGroup, a non-visual group of actions that is mutually exclusive by default. Task-number: QTBUG-50705 Change-Id: Ia33103173441ca8980341b7c94aba0db3264284d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickAction: keep track whether explicitly enabledJ-P Nurmi2017-04-181-9/+27
| | | | | | | | An enabled ActionGroup enables all its actions, except those explicitly disabled. Change-Id: I917dbb1d382bbb2e254a20933b13af8adfe8faa4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickAction: fix deferred deleteJ-P Nurmi2017-04-101-1/+1
| | | | | | | | | Noticed while writing auto tests for the upcoming ActionGroup. Calling action.destroy(); wait(0); did not destroy the action because it did not let QObject::event() handle QEvent::DeferredDelete. Change-Id: Ife491b436800d0bce37189ee118e3ffc5b313542 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Add ActionJ-P Nurmi2017-04-101-0/+523
[ChangeLog][Controls][Action] Introduced Action, an abstract user interface action that can have shortcuts and be assigned to buttons. Task-number: QTBUG-50705 Change-Id: I1986cc7ed13cdf428d51ae38cd196a20493fde8b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>