summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qstylehints.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename Qt::Appearance to Qt::ColorSchemeTor Arne Vestbø2023-02-131-3/+0
| | | | | | | | | | | | Based on discussions in the 6.5 API review, where we concluded that 'appearance' is too general. Instead, we follow the CSS standard and use the term 'color scheme'. Pick-to: 6.5 Change-Id: I8ceaf4138ecadff5ccd962480e8e5beb39b556ec Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Jonas Kvinge <jonas@jkvinge.net> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Prepare for replacing Qt::Appearance with Qt::ColorSchemeTor Arne Vestbø2023-02-091-0/+3
| | | | | | | | | | | | | | Based on discussions in the 6.5 API review, where we concluded that 'appearance' is too general. Instead, we follow the CSS standard and use the term 'color scheme'. This patch is a first step, only introducing the new API, so that submodules can port over. The next step will be to remove the old API and transition the docs and platform themes. Pick-to: 6.5 Change-Id: I43cdb6bb1ccb49c535c06b1897821467fd83ca60 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QStyleHints: Fix Q_PROPERTY declaration for keyboardAutoRepeatRateFTor Arne Vestbø2023-01-141-1/+1
| | | | | | Pick-to: 6.5 Change-Id: I21d3280176d6c52daab0b3abfdafb404d42db9d0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Properly deprecate QStyleHints::keyboardAutoRepeatRate()Tor Arne Vestbø2022-10-011-0/+2
| | | | | | | | The property also needs a QT_DEPRECATED_SINCE guard, and we can specify the version in the qdoc \deprecated tag. Change-Id: Ib333df862d1ef1c0c41a1baf51691928a64ecd75 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Add QStyleHints::keyboardAutoRepeatRateF()Tor Arne Vestbø2022-09-291-0/+5
| | | | | | | | | | The keyboardAutoRepeatRate() function returning an int assumes the rate can not be lower than one event per second, but this is not always the case, e.g. on macOS where the slowest setting for key repeat results in a two second delay between events. Change-Id: I806fb57883ce0085c835fb0a43d6b86bd6da375a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Propagate appearance property from QPlatformTheme to QStyleHintsAxel Spoerl2022-09-241-0/+3
| | | | | | | | | | | Implement appearance property, getter and notifier in QStyleHints. Update appearance property in QStyleHints when handling theme change in QGuiApplicationPrivate. Task-number: QTBUG-106381 Change-Id: Idd67ca9df248ec9d9e67c0d48121e8eead11a9e2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Consistent indentation for all Q_PROPERTYsAndreas Buhr2021-06-241-8/+17
| | | | | | | | Task-number: QTBUG-94407 Pick-to: 6.2 Change-Id: I8c97a0b2de2bed78456322be271724fc47479d83 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add mouseDoubleClickDistance and touchDoubleTapDistance to QStyleHintsShawn Rutledge2019-07-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Amends ca280bfe3bc551f814d59d25079e098798fbdad7 and 705e3f68df83dca165e3cddb914d3816155323f8 which added these enums only to QPlatformTheme::ThemeHint but not to QPlatformIntegration::StyleHint. Those patches did not add accessors to QStyleHints, probably because the accessors in QStyleHints use the themeableHint() function which takes both enums; so to have an accessor implemented this way, we need it in both enums. But it's getting too silly, since the only platform plugin that modifies MouseDoubleClickDistance is Android, implemented by QAndroidPlatformTheme overriding QPlatformTheme::themeHint(), and thus illustrating that adding the enum to QPlatformIntegration::StyleHint is not the only way to allow a platform plugin to customize the hint. So it seems we need a new way of writing these accessors without needing to duplicate the enum value in QPlatformIntegration::StyleHint. The new version of themeableHint(QPlatformTheme::ThemeHint) falls back on the static QPlatformTheme::defaultThemeHint() accessor. Users should at least be able to see what the default value is; and having these getters will also provide link targets for QtQuick's TapHandler docs. Change-Id: I0f8560062bcd0ca5e6d580071d9fbcf3f07f625f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add setter for property QStyleHints::showShortcutsInContextMenusFriedemann Kleint2018-11-241-1/+3
| | | | | | | | Add a tri-state setter logic similar to the other properties. Fixes: QTBUG-71471 Change-Id: Iddb5be18a037634a53ad8725bddb91c12fb33fed Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QLineEdit: implement quick text selection by mouseElvis Angelaccio2018-02-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This is a standard feature in GtkEntry widgets or HTML <input type="text"> elements. During a normal text selection by mouse (LeftButton press + mouse move event), it's now possible to quickly select all the text from the start of the selection to the end of the line edit by moving the mouse cursor down. By moving it up instead, all the text up to the start of the line edit gets selected. If the layout direction is right-to-left, the semantic of the mouse movement is inverted. This feature is only enabled if the y() of the mouse move event is bigger than a fixed threshold, to avoid unexpected selections in the normal case. This threshold is set by the QPlatformTheme and a value smaller than zero disables this feature. The threshold is updated whenever the style or the screen changes. [ChangeLog][QtWidgets][QLineEdit] Implemented quick text selection by mouse in QLineEdit. Change-Id: I4de33c2d11c033ec295de2b2ea81adf786324f4b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QStyleHints: Make showShortcutsInContextMenus a Q_PROPERTYFriedemann Kleint2017-04-201-0/+1
| | | | | | | | | | | | | Fixing qdoc warnings: qtbase/src/gui/kernel/qstylehints.cpp:367: warning: Cannot find 'QStyleHints::showShortcutsInContextMenus' specified with '\property' in any header file qtbase/src/gui/kernel/qstylehints.cpp:378: warning: No documentation for 'QStyleHints::showShortcutsInContextMenus()' Amends change c2c3452ba5b4c32d0c2d5df9193bf89986623ab5. Task-number: QTBUG-49435 Change-Id: I2db52f013c0fc46c80a1200667c19d63a2c9c0c4 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Add new API to control whether shortcuts are shown in context menusJake Petroules2017-03-141-0/+1
| | | | | | | | | | | | | Shortcuts are universally not shown on macOS or mobile platforms, making applications look very obviously out of place. Windows and GNOME desktop environments almost never use them. Only KDE appears to do so commonly; default accordingly. Task-number: QTBUG-49435 Change-Id: Ieac4cee57b15a02be5258f3d07749af6316af62b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Make wheelScrollLines a QStyleHintAllan Sandfeld Jensen2017-01-251-0/+4
| | | | | | | | | The number of lines to scroll on a wheel click have previously been a QPlatformTheme hint and QApplication setting, this patch moves it to QStyleHint so it may be easier read by QGuiApplications. Change-Id: I80673c7b99d78c6407b1202b3742e1cb5fef0583 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add QStyleHints::useHoverEffectsJ-P Nurmi2016-07-201-0/+4
| | | | | | | | | | | | | The delivery of hover events creates unnecessary overhead on touch platforms. This allows Qt Quick Controls 2 to determine whether the underlying platform wants hover effects. The hover effects are enabled by default for the classic desktop platforms: Linux, Windows & macOS. Change-Id: Ia4e7b5c0fcb7af8f1c47e06fb28086cffdf35976 Task-number: QTBUG-50003 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add qtguiglobal.h and qtguiglobal_p.hLars Knoll2016-07-031-0/+1
| | | | | | | | | | | | | | | | | | | | The new modular configuration system requires one global header per module, that is included by all other files in this module. A similar scheme and naming convention is already being used for many other modules (e.g. printsupport, qml, quick). That header will later on #include the configuration file for Qt Gui. For now it defines the Q_GUI_EXPORT macro for this library. In addition, add a private global header, qtguiglobal_p.h, that can later on include the private config header for Qt Gui for things we don't want to export to the world. Change-Id: Id9ce2a4f3d2962c3592c35e3d080574789195f24 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Add QStyleHints::setTabFocusBehavior() for testing purposesJ-P Nurmi2016-02-161-1/+3
| | | | | | | | | | So far we've been dependent on the focus behavior setting in OS X system preferences. This change allows us to start testing both behaviors on any platform. Change-Id: I9ce004f8b9479f8e722a387b795de16edb166a07 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into devSimon Hausmann2015-12-081-0/+2
|\ | | | | | | Change-Id: I2532c7f7db5e6cc3ef09753d886279816dd662b2
| * Add QStyleHints::showIsMaximized().Friedemann Kleint2015-12-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Expose QPlatformIntegration::ShowIsMaximized similarly to QPlatformIntegration::ShowIsFullScreen. This allows for applications to adapt their UI to mobile/desktop accordingly. Change-Id: Ic14d16fde11d7d2740b2f4092ae12e88a2f522fd Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Add QStyleHints::setMousePressAndHoldInterval()J-P Nurmi2015-11-131-1/+3
|/ | | | | | | Allows speeding up press & hold auto tests in qtquick core & controls. Change-Id: I66717b581996977e894e3c386880ab90379abaef Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Expose ItemViewActivateItemOnSingleClick in QStyleHintsEike Hein2015-04-101-0/+2
| | | | | | | | | | | | | | | | | | | | This completes support for ItemViewActivateItemOnSingleClick in QPlatformIntegration and exposes the setting in QStyleHints. Based on the review process, the public name used is 'singleClickActivation' for brevity, as well as to avoid con- fusion over alluding to "item views" in the Qt Quick context. KDE Plasma intends to use this via Qt.styleHints to have Qt Quick-based UI correctly implement the global single vs. double click user preference for item activation. [ChangeLog][QtGui] Added QStyleHints::singleClickActivation to access whether the platform expects item activation to occur on single clicks rather than double clicks. Change-Id: I0916e9e68c3a157f95053da8227b2612803653f7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Expose TabFocusBehavior in QStyleHintsLiang Qi2015-02-121-0/+2
| | | | | | | | | | TabAllWidgets in QPlatformTheme is replaced by TabFocusBehavior. [ChangeLog][QtGui] Expose TabFocusBehavior in QStyleHints Change-Id: Iafaad7c6a5c6bc888d1e124e6ddcdbdc46f37b1c Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* QStyleHints: restore CONSTANT to non-NOTIFYable propertiesJ-P Nurmi2015-02-021-9/+9
| | | | | | | | | | | | | | The removal of CONSTANT keywords broke intended QML usage: property string: Qt.styleHints.passwordMaskCharacter and leads to such warnings: QQmlExpression: Expression ... depends on non-NOTIFYable properties: QStyleHints::passwordMaskCharacter Change-Id: Iadc5ddcbe5c5704f146e073f514845426ff0ec4d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Make QStyleHints usable in QMLJ-P Nurmi2015-01-131-0/+22
| | | | | | | Change-Id: Ia8f143d12c754b4af4a29bb9542cd050b5ae2ab0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Allow the platform to specify a press and hold delay.Michael Brasser2013-12-101-0/+1
| | | | | | | | | | | | | Press and hold is an interaction available on many platforms, particularly when touch is involved. In Qt Quick this is exposed to the user via MouseArea::onPressAndHold. This value should not be hard-coded, but rather use a platform-specified default. This commit adds the low-level hooks necessary for that to happen. Task-number: QTBUG-24793 Change-Id: I621a8ac9de66b881e34336228056bffbb6306a70 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix settable style hints.Friedemann Kleint2013-10-221-0/+7
| | | | | | | | | | Introduce QStyleHintsPrivate and introduce internal setters called by QApplication. Task-number: QTBUG-33991 Change-Id: Id61f8b1e2b5c9cfd7b4713aaded66e93e6f63719 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* QPlatformIntegration: add new style hint: SetFocusOnTouchReleaseRichard Moe Gustavsen2013-06-251-0/+1
| | | | | | | | | | | | | | | | On desktop platforms, widgets have traditionally received focus on mouse press. On touch platforms (iOS, Android) this is different, there you need to delay setting the focus until a touch release (probably to check if the press starts a flick or tap'n'hold etc). This patch will add a new style hint SetFocusOnRelease that can be set by the plugin to control this behavior in Qt. Change-Id: I2e4d714894e327822c855eb48a3b28e354726e95 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Make password mask characters themeable.Mitch Curtis2013-04-191-0/+1
| | | | | | | | Task-number: QTBUG-29871 Change-Id: I3cf739a321d7917f8f8431992e29bba0871b1934 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Add stylehint to use querying RTL keyboard support.Friedemann Kleint2012-07-111-0/+1
| | | | | Change-Id: Ic58ed7cb64cc7fe60b4d431e9f29e389c62265fc Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* Add StartDragVelocity to style hintsLaszlo Agocs2012-06-051-0/+1
| | | | | | | | This will be used by Flickable in combination with the drag distance to improve the drag start detection logic. Change-Id: Ica30042ef3d15041d857b07fa4173dde3d3f900f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Introduce FontSmoothingGamma as a platform style hint.Friedemann Kleint2012-03-271-0/+1
| | | | | | | | | | - Allocate gamma tables on the heap in a thread-safe way, use font smoothing returned by the style hints of the platform to calculate them. - Improve font rendering on Windows. Change-Id: I8cd39b51cf03cbd642474c02b9076814baecd597 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Password editor mask delay stylable by platform pluginPekka Vuorela2012-03-261-0/+2
| | | | | | | | | Replaced hard coding as QT_GUI_PASSWORD_ECHO_DELAY with a style hint. Change-Id: I0b78ebad723dbe19d9b9496583203e31545874e2 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Make show() default to sane sizing behaviour based on the platform.Samuel Rødal2012-01-121-0/+1
| | | | | | | | | | | | | | | | Traditionally it's been hard to write a Qt app that behaves sanely across embedded and desktop platforms, i.e. defaults to fullscreen on embedded and non-fullscreen on desktop. For Qt 5 we can fix this by making the behaviour of the default QWindow::show() be customizable by the platform plugin. If the application developer wants to override this behaviour he can still use the explicit showFullScreen(), showNormal() etc functions. Change-Id: I26a907b404058e345d841c818daefbb57a26d3fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Platform style hints: Introduce keyboard repeat rate.Friedemann Kleint2012-01-101-0/+1
| | | | | Change-Id: I556c2ecec7d5368122875a659af3ae7db88aa481 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix stale license headers from refactor branchJason McDonald2011-09-151-17/+17
| | | | | | Change-Id: I38cd941202641f50bf632af35165a944d03a20e3 Reviewed-on: http://codereview.qt-project.org/4848 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add a QStyleHints class to QtGuiLars Knoll2011-08-311-0/+73
This class encapsulates platform specific style hints like doubleClickInterval or cursorFlashTime. Change-Id: I0d88c47a59d564d8d346642184e5b14e1864cf40 Reviewed-on: http://codereview.qt.nokia.com/3927 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>