summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Fix potential out-of-bounds or nullptr accessVolker Hilsheimer2020-03-171-4/+4
| | | | | | | | | | | | | | | This ammends change baed8534bc1dac36a9d0ef4240fc14398076a192, which might have introduced a hard to reproduce segmentation fault when the screen number is out of bounds, or when the QScreen object doesn't return a valid pointer for QScreen::handle. As the issue doesn't reliably reproduce, this is a speculative fix that adds bounds and nullptr checking. Change-Id: I0cec0a344e80159ee1723d840f207267a608cef4 Fixes: QTBUG-82807 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Document the behavior of QLineEdit::inputMask correctlyVolker Hilsheimer2020-02-261-14/+18
| | | | | | | | | | | | | | | | QLineEdit is unicode, and uses QChar::isLetter and QChar::isNumber to evaluate whether an input character is valid. There is no test for ASCII ranges, or converting of input characters to ASCII, so the documentation was wrong. [ChangeLog][QtWidgets][QLineEdit] the inputMask property has allowed any Letter or Number category character for the respective mask characters, not just ASCII. The documentation has been updated accordingly. Change-Id: Ied93cf6ddd334ac91bfbc275107a8eb83d231d80 Fixes: QTBUG-82291 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Documentation: correctly use see-also tags to link to related membersVolker Hilsheimer2020-02-261-4/+5
| | | | | Change-Id: I764eb4730067cd704866191516dc4e8dd1820760 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* Set the size of the buffer so it is big enough to hold the contentsAndy Shaw2020-02-251-1/+1
| | | | | | | | | | This will prevent a crash later on when it tries to assign to an index in a QString that has not been allocated. Fixes: QTBUG-81950 Change-Id: Ia0b5648a18f15594eeca07d234bedadcfeb266ac Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove misplaced backslash from documentationVolker Hilsheimer2020-02-251-1/+1
| | | | | | | | A \c{} section is already rendered using monospace, no need to escape the \nullptr keyword explicitly. Change-Id: I004a409892809e968c7a73c68a5b3c54a4680425 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QAbstractItemView: Make sure to update the editor geometriesChristian Ehrlicher2020-02-231-1/+3
| | | | | | | | | | QAbstractItemView::setIndexWidget() does not trigger a relayouting when a new widget is set. This results in a wrong editor geometry under some circumstances. Fix it by triggering a delayed relayout. Fixes: QTBUG-81763 Change-Id: I75d0e19bd5e56d63effe4990d782d202fb39e3e6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix wrong DPI used by QStyle::pixelMetric()Friedemann Kleint2020-02-2220-56/+71
| | | | | | | | | Pass on the option or the widget in order to ensure usage of the correct DPI for High DPI scaling. Task-number: QTBUG-82356 Change-Id: I5df903a83f88adebd143e514e2fead367d39f015 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QStyle: Use primary screen DPI as default DPIMorten Johan Sørvig2020-02-211-0/+6
| | | | | | | | | | | | | | | | | Change d603ee68 made the default DPI be 96, for cases where a style option is not provided. This causes inconsistencies, since there are in fact several cases where QStyle API is called without a style option. Restore historical Qt behavior of using the primary screen DPI. Single-screen systems should now be consistent, as before. Task-number: QTBUG-82356 Change-Id: I849934ca2e5604b9fb2f045ed4f6058f3e0426ff Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix RollEffect misplacements in High DPI setupsFriedemann Kleint2020-02-181-5/+11
| | | | | | | | Pass the correct screen as parent of the roll effect widget. Fixes: QTBUG-82011 Change-Id: I25c163cb2e4c038e60ceced702a1ea6c18aa5424 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* QAbstractItemView: do not request illegal model indexesGiuseppe D'Angelo2020-02-141-9/+0
| | | | | | | | | | | | | | If a model is empty, there is no index (0, 0); requesting it is undefined behavior. Rather than protecting the calls with checks on rowCount/columnCount, remove the Q_ASSERTs altogether: they're trying to do some basic sanity checks on the model, something that doesn't belong to a view (but, say, to QAbstractItemModelTester). Change-Id: I0ea25604fdcf524a10f5922a03a4d0700447f6a7 Reviewed-by: Andre Somers <andre.somers@kdab.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QComboBox: send font change event to popup menu when font changedWang Chuan2020-02-071-1/+3
| | | | | | | | | | | | The font change in QComboBox might cause incorrect appearance of popup menu since it doesn't notify popup menu to relayout itself Fixes the issue by send font change event to the item view of popup menu when received a font change event in QComboBox Fixes: QTBUG-75846 Change-Id: I4821015cca95a7e233a22262596a6fbf27f10aef Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QPushButton: fix text truncating when icon+text+menu is drawnChristian Ehrlicher2020-02-061-1/+2
| | | | | | | | | When a QPushButton has an icon, text and menu, the text is truncated. In RTL mode the menu indicator is also drawn on the wrong side. Fixes: QTBUG-81784 Change-Id: I27ecb67d12c68ac939540f0f836b2e2875706b4b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* widgets: Don't create winId when the widget is being destroyedVaL Doroshchuk2020-02-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QWidget is being destroyed, its winId is cleared, and a QEvent::WinIdChange is sent. If a listener of this event reacted by calling winId() again, we might crash. A crash can be observed when this child widget is destroyed in dtor of its parent. E.g. here is a hierarchy of widgets: 1:QWidget 2:QObject 3:QWidget 4:QWidget If a listener subscribed for WinIdChange events from (4), and there is a connection to destroy (4) when (2) is destroyed. This will lead to infinite loop: 1. QWidget::~QWidget 2. QWidget::destroy 3. QWidgetPrivate::setWinId(0) 4. QCoreApplication::sendEvent(q, QEvent::WinIdChange); 5. eventFilter 6. QWidget::winId 7. QWidgetPrivate::createWinId (this=0x555555957600) at kernel/qwidget.cpp:2380 8. QWidgetPrivate::createWinId (this=0x55555596b040) at kernel/qwidget.cpp:2387 9. QWidget::create (this=0x5555558f2010, window=0, initializeWindow=true, destroyOldWindow=true) at kernel/qwidget.cpp:1163 10. QWidgetPrivate::createWinId (this=0x55555596b040) at kernel/qwidget.cpp:2387 11. QWidget::create (this=0x5555558f2010, window=0, initializeWindow=true, destroyOldWindow=true) at kernel/qwidget.cpp:1163 12. QWidgetPrivate::createWinId (this=0x55555596b040) at kernel/qwidget.cpp:2387 Fixes: QTBUG-81849 Change-Id: Ib4c33ac97d9a79c701431ae107bddfb22720ba0d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix 'the the' typo in commentsLinus Jahn2020-02-023-3/+3
| | | | | Change-Id: I00fcb1c2374e7ca168b6240f9d41c0323fb0867c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Windows style: Fix wrong color of non-editable combo boxFriedemann Kleint2020-01-301-1/+1
| | | | | | | | | | | Use QPalette::Button instead of Base as does QFusionStyle so that style sheets specifying colors for the non-editable case work correctly. Fixes: QTBUG-81573 Change-Id: I84cecb38a48a1450c82498558aa350f3e60a5df6 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Convert two QDateTime::toString() usages to QLocale::toString()Edward Welbourne2020-01-302-2/+2
| | | | | | | | | | | Qt::LocalDate has been deprecated for ages as an alias for Qt::SystemLocaleDate, which we intend to remove at Qt 6; and all use of them can (and should) be converted to use QLocale::toString(). So do that. Task-number: QTBUG-80441 Change-Id: I0a40fa287cb347c704ec3673d17ef18381063f7f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add missing \since for QTextEdit::markdownFriedemann Kleint2020-01-301-0/+1
| | | | | | | | | The property was introduced by 23c2da3cc23a2e04a0b3b3c8ad7fa9cc6126ff23. Task-number: PYSIDE-1208 Change-Id: I2b9c5f116ffb154458de88d0efa0ac81f625121b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QGraphicsProxyWidget: fix handling of proxy focusGiuseppe D'Angelo2020-01-291-1/+1
| | | | | | | | | | | If a widget inside a QGPW has a proxy focus, the code would keep sending focus in events to the proxy even if the proxy was already focused. Amend the check in place to prevent this from happening. Change-Id: Id28d3bfe4f396da5c9477df713441ca7d506662f Fixes: QTBUG-51856 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: Update the stylesheet reference for widgets and richtextVenugopal Shivashankar2020-01-271-0/+12
| | | | | | | | | | | Add the Qt-specific properites to the list. Fixes: QTBUG-37938 Change-Id: I178de6cd5e17cd282a20ccee9ce8355f540c38a1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QScrollArea: fix off-by-one error in ensureWidgetVisibleIndiana Kernick2020-01-251-2/+2
| | | | | | | | | | | | | | | If focusRect was 5 pixels past the right side of the viewport, then the scroll area would need to be scrolled by 5 pixels. The error arises because of this: focusRect.right() - d->viewport->width() == 4 focusRect.right() is still inside the rectangle but width is not. So one has to be added. Likewise for focusRect.bottom() and height. Change-Id: Ice47a7758d136b2e4bdcbe25a33a015b37f500c1 Fixes: QTBUG-80093 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Make sure the focus is passed on correctly when back-tabbingAndy Shaw2020-01-251-1/+2
| | | | | | | | | | | | When the tested widget has a focus proxy, then we should check if the current focus widget is not the same as that focus proxy before setting it to be the widget that gets focus. This ensures that when back-tabbing from a widget like QDoubleSpinBox that it will not get stuck inside that widget and will back-tab to the next correct one. Fixes: QTBUG-81097 Change-Id: I3f689c7715da7f3ce8c3d2f616041528f5778a2f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Prepare callers for QChar-to-QString change in some QLocale returnsEdward Welbourne2020-01-231-19/+29
| | | | | | | | | | | | | | The assorted characters making up numbers can potentially need surrogate pairs for their encoding, so Qt6 shall make the methods returning them return QString instead of QChar. Prepare callers of these methods to cope when that happens. This follows up on commit f91af791cc3be1dfb9645ed4ebba10a7d9f74134, which announced the intent to change the return type. Task-number: QTBUG-81053 Change-Id: I99896c1d4fc2e24758c6486eaca32fd915b9a673 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove unused parameters from default-synthesized membersVolker Hilsheimer2020-01-171-2/+2
| | | | | | | | Fixes build error with gcc when compiled with -Werror=unused-parameters. Change-Id: I12c3ecb30f489986b112f9736caec40aa50c7283 Fixes: QTBUG-81465 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Doc: Fix ButtonRole enum docs for QMessageBox and QDialogButtonBoxTopi Reinio2020-01-172-1/+8
| | | | | | | | | | | Multiple topic commands (in this case, \enum) do not work across different classes. Reuse the documentation comment via an \include statement instead. Fixes: QTBUG-78910 Change-Id: Ife83bdc9bbad650835fafc072180d10037648d0a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Correct non-link related qdoc compilation errorsNico Vertriest2020-01-143-3/+5
| | | | | | Task-number: QTBUG-79824 Change-Id: I94dc566c9fb11bc8c598c0d5c043b6f388ebdc80 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Add note about mac-specific behavior for setWindowIconPaul Wicking2020-01-141-1/+5
| | | | | | Fixes: QTBUG-74985 Change-Id: I7379865ab9564301c1e636ba1fda40cbb9e04c61 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QScrollBar: allow scrolling any scrollbar with any mouse wheelChristian Ehrlicher2020-01-131-2/+8
| | | | | | | | | | | | | | | The most common mouse wheel movement corresponds to angleDelta().y(). We have previously allowed the user to use either wheel to scroll either a horizontal or a vertical scrollbar when the mouse is hovering over it; but 7d29807296cb7ccc7f3459e106d74f93a321c493 changed it so that the vertical mouse wheel could no longer scroll a horizontal scrollbar. The behavior is now restored as it was in 59cc316620a2169d48e00822c97a96bd03079eed. Task-number: QTBUG-81007 Change-Id: Ieacdce539d5311499a86af645bbe0d5098e16be6 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Bump copyright yearJani Heikkinen2020-01-091-2/+2
| | | | | | Change-Id: I9468ef21a2cf03cf07c38f012a2aa9bae6d02a03 Reviewed-by: Johanna Äijälä <johanna.aijala@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove clearWidgetPaletteHash argument from setPalette_helperTor Arne Vestbø2020-01-092-6/+5
| | | | | | | | | | The argument is only used when the application palette is set, (as opposed to setting the palette for a specific widget class), and that code path is only triggered from QApplication::setPalette, which passes 'true' for this argument. Change-Id: I67a1cc3741f6f62653b0f95ff88d28228f9977d4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Move tracking of widget specific app palettes to QApplicationPrivateTor Arne Vestbø2020-01-092-25/+23
| | | | | Change-Id: I43cc25207026f174e46534baedf08e0c300728d1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Share updates to QGuiApplicationPrivate::app_pal via helper functionTor Arne Vestbø2020-01-091-5/+1
| | | | | Change-Id: I2f582358efaadcd33b39c52317222322c589423f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: Correct qdoc compilation errors qtbaseNico Vertriest2020-01-092-17/+18
| | | | | | Task-number: QTBUG-79824 Change-Id: I4be365d92b1adfde09efd04d088f75c506666a95 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Skip WA_DontShowOnScreen widgets when checking whether application can quitTor Arne Vestbø2020-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | QApplication tries to close all windows on quit using closeAllWindows, but closeAllWindows skips some windows, in particular any widget with WA_DontShowOnScreen set. QApplication then tries to verify that all windows have been closed, and that logic should skip the same kind of windows as closeAllWindows does. We include WA_DontShowOnScreen so that widgets that are proxied via QGraphicProxyWidget will not prevent the application from quitting. There's still some divergence between closeAllWindows and the logic in QApplication::event's quit handling, but aligning that requires more work than this particular fix, and should probably also be based on using the return value of tryCloseAllWindows() directly. Change-Id: I2555eeee0cb04b8e736109fed57f37150efd1964 Fixes: QTBUG-81107 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* QSystemTrayIcon: Fix geometry() to work with scaling enabledFriedemann Kleint2020-01-071-3/+8
| | | | | | | | | Add missing call to QHighDpi::fromNativePixels(), retrieving the screen from the menu. Task-number: QTBUG-79248 Change-Id: I9f358c8010615c3f96ed9dc3b6666013ae9a0ed9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix some issues of a clang-cl developer buildFriedemann Kleint2020-01-061-0/+4
| | | | | | | | | | | | | | - qeasingcurve.cpp: Add a cast, fixing: qeasingcurve.cpp(1515,25): error: implicit conversion between pointer-to-function and pointer-to-object is a Microsoft extension [-Werror,-Wmicrosoft-cast] - Disable copy and move of QMainWindowLayoutSeparatorHelper, fixing: qbasictimer.h(59,5): note: 'QBasicTimer' has been explicitly marked deprecated here QT_DEPRECATED_X("copy-construction is unsupported; use move-construction instead") Task-number: QTBUG-63512 Change-Id: I4d12a29cb1dcd68da9f9316c9e42992f218e6045 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QSS/QComboBox: set correct palette when drawing SC_ComboBoxArrowChristian Ehrlicher2020-01-051-0/+1
| | | | | | | | | | | | | | | When the dropdown button of a combobox is drawn with QStyleSheetStyle, not only the background color is used for drawing but also QPalette::Light/Dark/Shadow. Since the palette was not properly set up in some cases, the shaded frame around the button was drawn with the default colors instead the ones derived from the given background. Therefore we have to properly set up the palette before drawing the drop down button by calling QRenderRule::configurePalette() Fixes: QTBUG-80950 Change-Id: Ibf98fa28612b5c7527ef9dd6ae06c417315f2632 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QPlainTextEdit: make sure firstVisibleBlock() is validChristian Ehrlicher2020-01-051-1/+2
| | | | | | | | | | | | | Under some circumstances it's possible that firstVisibleBlock() returns an invalid block within QPlainTextEditPrivate::_q_textChanged() which results in a nullptr access later on. Therefore add a check similar to other places and test the validity of the returned block before accessing it. Fixes: QTBUG-80929 Change-Id: I1fd4643b10b842acfe1c356048379f0ba225dddf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix syncqt warning in qtestsupport_widgets.hTor Arne Vestbø2020-01-021-1/+1
| | | | | Change-Id: I4f350e3c209dc9a39e849c9c39c41da700abeb60 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix some qdoc warningsFriedemann Kleint2020-01-023-7/+7
| | | | | | | | | | | | | | | | | | | | | | src/corelib/tools/qhash.cpp:2596: (qdoc) warning: clang found diagnostics parsing \fn template <class Key, class T> template <class InputIterator> QMultiHash::QMultiHash(InputIterator begin, InputIterator end) error: 'QMultiHash' is not a class, namespace, or enumeration src/corelib/kernel/qobject.cpp:4593: (qdoc) warning: Undocumented parameter 'EXPORT_MACRO' in QObject::Q_NAMESPACE_EXPORT src/corelib/global/qfloat16.cpp:129: (qdoc) warning: Cannot tie this documentation to anything src/corelib/text/qlocale.qdoc:1204: (qdoc) warning: Overrides a previous doc src/corelib/text/qlocale.qdoc:1187: (qdoc) warning: (The previous doc is here) src/network/kernel/qhostinfo.cpp:597: (qdoc) warning: clang found diagnostics parsing \fn QHostInfo(QHostInfo &&other) src/printsupport/dialogs/qabstractprintdialog.cpp:346: (qdoc) warning: clang found diagnostics parsing \fn int QAbstractPrintDialog::exec(): error: out-of-line definition of 'exec' does not match any declaration in 'QAbstractPrintDialog' src/testlib/qsignalspy.qdoc:101: (qdoc) warning: clang found diagnostics parsing \fn QSignalSpy(const QObject *obj, const QMetaMethod &signal): error: expected unqualified-id src/testlib/doc/src/qttest-best-practices.qdoc:28: (qdoc) warning: Can't link to 'Q_VERIFY2()' src/widgets/kernel/qactiongroup.cpp:291: (qdoc) warning: Undocumented parameter 'b' in QActionGroup::setExclusive() src/widgets/kernel/qactiongroup.cpp:305: (qdoc) warning: Undocumented return value (hint: use 'return' or 'returns' in the text src/widgets/kernel/qshortcut.cpp:542: (qdoc) warning: No such parameter 'context' in QShortcut::QShortcut() src/widgets/widgets/qdatetimeedit.cpp:632: (qdoc) warning: No such parameter 'minimumTime' in QDateTimeEdit::setTimeRange() src/widgets/widgets/qdatetimeedit.cpp:632: (qdoc) warning: No such parameter 'maximumTime' in QDateTimeEdit::setTimeRange() src/widgets/widgets/qdatetimeedit.cpp:632: (qdoc) warning: No such parameter 'less' in QDateTimeEdit::setTimeRange() Change-Id: I9799b5135e84c4d811674b2d114ef27315bc12df Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Check platformNativeInterface pointer before dereferencingShawn Rutledge2019-12-312-0/+4
| | | | | | | | | QApplication::platformNativeInterface() returns null if started with -platform offscreen. Fixes: QTBUG-80946 Change-Id: I3ad03ad27148c8576bd3fab0b136827bb8d171ae Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QCommonStyle: make sure to pass the widget to pixelMetric()Christian Ehrlicher2019-12-281-6/+6
| | | | | | | | | | | QStyle::pixelMetric() expects the affected QWidget as third parameter. Some (external) styles rely on this to return the correct value. Therefore add the widget to the function calls where possible. Fixes: QTBUG-80971 Task-number: QTBUG-1857 Change-Id: I768ebb61a914cdba6e0549f841d46cf3edb0a2a6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QFileInfoGatherer: don't pass empty list to QFileSystemWatcherChristian Ehrlicher2019-12-231-1/+1
| | | | | | | | | | When an empty list is passed to QFileSystemWatcher::unwatchPaths() a warning is printed out. To avoid this, check if the container is not empty before calling unwatchPaths() Fixes: QTBUG-80965 Change-Id: I23a7946e1e16a8d899abf6cce6b75a6f3662ca0f Reviewed-by: David Faure <david.faure@kdab.com>
* Contain Qt::AA_SetPalette logic in QApplicationPrivate::setPalette_helperTor Arne Vestbø2019-12-211-3/+4
| | | | | Change-Id: I88b36e800139389895ecb1a15553207a24b3e3a4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Simplify QApplication::paletteTor Arne Vestbø2019-12-211-3/+2
| | | | | Change-Id: I1f1be554a72a385985eeee0b79b49acdfcf40d8e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix QAccessibleWidget::focusChild() to return focused descendantPeter Varga2019-12-193-5/+23
| | | | | | | | | | | | | | | This method should not ignore accessibility objects without corresponding widget. The widget may have parts with their own QAccessibilityInterface and these can be also focused. VoiceOver ignores them if they are not returned by focusChild(). QAccessibleTabBar::focusChild() has been implemented to demonstrate the concept and make tab titles of QTabBar readable by VoiceOver. Task-number: QTBUG-78284 Change-Id: Id7c62d86154bbd5d47d6bbee8cb7d05268c2e151 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Sync implementation of QGuiApplication and QApplication setPaletteTor Arne Vestbø2019-12-171-6/+3
| | | | | | | | | The two static setPalette methods in QApplication and QGuiApplication should have the same behavior in terms of what signals and events they emit. Change-Id: I54579d490e31f3783e2d4fea689ca799a070ff1d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Let sendApplicationPaletteChange() decide when it needs to exit earlyTor Arne Vestbø2019-12-171-3/+5
| | | | | Change-Id: I7a8e6c0b54d2a16a17b292a4102e05f743bcbe29 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Remove QApplicationPrivate::set_palTor Arne Vestbø2019-12-132-13/+6
| | | | | | | | | | Its purpose was to track the default palette set by the programmer, but after 8fb881900c this is tracked by the Qt::AA_SetPalette attribute. The palette itself is always reflected 1:1 in the palette tracked by QGuiApplicationPrivate::app_pal. Change-Id: If3e84c8b3ae6070b6c50be7a33adb38799b3f3a5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Explicitly polish palette instead of relying on QApplication::setPaletteTor Arne Vestbø2019-12-121-4/+4
| | | | | | | | | The only effect calling QApplication::setPalette will have is the polish, so opt for doing it explicitly instead of the weirdly looking no-op assignment. Change-Id: Ia80b3f60e3e513b68c2993ea8417966f9ab6721e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Clean up QApplication::style default style constructionTor Arne Vestbø2019-12-121-25/+24
| | | | | Change-Id: I9f01e7cc5fa90fd9b1f5d12c7ce694c231158c32 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>