summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* QWidgetTextControl: Ignore unconsumed mouse release eventsAxel Spoerl7 days1-7/+18
| | | | | | | | | | | | | | | | | | | | | | QWidgetTextControlPrivate::mouseReleaseEvent() has early returns implemented, e.g. when link has been right clicked or no selection anchor has been found. These early returns, however, still consume the event. This leads to events getting lost instead of getting propagated: As an example, a QLabel with rich text uses QWidgetTextControl. While it propagates mouse press events back to its parent, mouse release events get lost. A QLabel with plain text propagates both events back correctly. This patch adds QEvent::ignore() to the early return. Since no test class exists for QWidgetTextControl, it adds a test in tst_QLabel. Fixes: QTBUG-110055 Pick-to: 6.5 6.4 Change-Id: I950f8c3f135793b01c59832835bb429db2282169 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QGraphicsView: remove even more vestiges of QtDeclarative1Giuseppe D'Angelo10 days3-12/+6
| | | | | | | | The field is never set and thus never used meaningfully. Change-Id: Ia45afa6339d38316d76766a736ba8cb1ce9f58fa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QGraphicsItem: remove QtDeclarative 1 vestigesGiuseppe D'Angelo10 days3-127/+0
| | | | | | | This code is completely unused at this point. Change-Id: Id0ecd0125e59b08904ae722ad4319c5ff15620a6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Simplify description of QKeySequenceEdit::maximumSequenceLengthKai Köhne10 days1-6/+2
| | | | | | | | | | | | | Main purpose is to limit the number of keys a user can enter, so let's be explicit about this. 'Truncation' seems to happen only if the program programmatically sets a longer sequence to the edit, which is arguably a programming error and also shows up as a warning in the logging API. Pick-to: 6.5 Change-Id: I7b2b74e8dab44c5ad16ffefc25c5610708139353 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Fix build with -no-feature-menubarTasuku Suzuki11 days1-0/+2
| | | | | | Pick-to: 6.5 Change-Id: I72bd07dbdcfe07badaadce9f19949ee3e352b13e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QCommonStyle code cleanupAxel Spoerl11 days1-84/+102
| | | | | | | | | | | | | | | | | | | Consistently use int (instead of uint) type for alignment/text formatting flags passed to QStyle::drawItemText (and overrides). Clean variables in QCommonStyle::sizeFromContents - use self-explaining variable names - rename misleading variables - define one variable per line - use consts whereever possible - insert new lines to make code easier to read - correct wrong indentations - use auto in qstyleoption_castis to respect maximum of 100 characters per line Pick-to: 6.5 Change-Id: Ie145c089606436213c813227154fac29962825d0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix build with -no-feature-dialogbuttonboxTasuku Suzuki11 days1-1/+0
| | | | | | Pick-to: 6.5 Change-Id: Ia6ac9e6acffda80794a5949793fddc3ab849a98a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build with -no-feature-buttongroupTasuku Suzuki11 days1-1/+1
| | | | | | | | | | | .../qabstractbutton.cpp: In member function ‘virtual void QAbstractButton::keyPressEvent(QKeyEvent*)’: .../qabstractbutton.cpp:1010:58: error: incomplete type ‘QGuiApplicationPrivate’ used in nested name specifier Pick-to: 6.5 Change-Id: Ia71bb481d125087aa813c891f9508755f435f4d2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build with -no-feature-menuTasuku Suzuki11 days1-0/+2
| | | | | | Pick-to: 6.5 Change-Id: Ie18d896799dd99c74dcdf00cd43c2aedcd9b8d1c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build with -no-feature-draganddropTasuku Suzuki11 days3-5/+27
| | | | | | Pick-to: 6.5 Change-Id: I88ecd9a84d7fb9f6cb78027cc51e34089e211ff2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build with -no-feature-messageboxTasuku Suzuki11 days3-0/+8
| | | | | | Pick-to: 6.5 Change-Id: I4c34f6aa2106afc528f182d7925442acf82b7000 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build with -no-feature-imageformat_pngTasuku Suzuki11 days1-1/+1
| | | | | | Pick-to: 6.5 Change-Id: Ib742665b2c379ff600b6a99432c89567a3f7765b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Move QApplication::autoSipEnabled() to public scopeTasuku Suzuki12 days1-1/+1
| | | | | | | | | | | | | | | | The method is not meant be a slot. warning: getter QApplication::autoSipEnabled possibly mismarked as a slot [clazy-const-signal-or-slot] [ChangeLog][QtWidgets][Potentially Source-Incompatible Changes] bool QApplication::autoSipEnabled() is no longer a slot. Code such as using QObject::connect() to connect to it as a slot or accessing it through meta object system will have to be rewritten. Pick-to: 6.5 Change-Id: I892a51120478f3c90e5834c8e3e00bc836b84c52 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build with -no-feature-shortcutTasuku Suzuki12 days2-0/+4
| | | | | | | | qplatformtheme.h complains about Q_GADGET without <QtCore/QKeySequence> Pick-to: 6.5 Change-Id: I7561bd3e2484c44842cd25ab12aacb9c00ebedfd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build with -no-feature-toolbarTasuku Suzuki12 days1-0/+2
| | | | | | Pick-to: 6.5 Change-Id: I9a76ff0896545dff0e945daaec0aeae2236c1e42 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build with -no-feature-cssparserTasuku Suzuki12 days1-1/+3
| | | | | | Pick-to: 6.5 Change-Id: I146ac61f92acdcd22c46ca27a1fca48c47817e3c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtWidgets: Disambiguate static functions/variables and definesFriedemann Kleint2023-01-149-52/+27
| | | | | | | | | | | | | They cause clashes in CMake Unity (Jumbo) builds. Properly prefixing the childWidgets() function also prevents it from cluttering static builds. Task-number: QTBUG-109394 Pick-to: 6.5 Change-Id: Idd2b1ec748f33cfae8f3213847c43b3fb0550377 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QWidgetTextControl: deal with empty formats list properlyTimur Pocheptsov2023-01-131-1/+2
| | | | | | | | | | Do not call first on it. A regression was introduced by 56f0ebfe860e440dcbba8997f44836debc901119. Fixes: QTBUG-110070 Pick-to: 6.5 6.4 Change-Id: I7c969da889b6c7ad3a67149fe99ca47830683073 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QFormLayout: don't access out-of-bounds layout dataVolker Hilsheimer2023-01-131-2/+16
| | | | | | | | | | | | | | | | When rows are hidden (implicitly or explicitly), then their layout data does not get fully updated. If rows get hidden after the layout data has been calculated once, then we must make sure that their indices are reset. Otherwise we might access array indices that are out of bounds when the layout data structure gets resized to fit only visible rows. For good measure, skip entirely over hidden rows when accessing the layout data when arranging the widget. Fixes: QTBUG-109237 Pick-to: 6.5 6.4 Change-Id: I4d6943b6a110edb61f60ce78d31f0fc64b5cc03d Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QCalendarWidget: Add reset functions for minimum/maximumDateVolker Hilsheimer2023-01-132-2/+14
| | | | | | | | | | QDateTimeEdit has such reset functions for the minimum/maximum range properties, this makes QCalendarWidget consistent with the simpler editors. Fixes: QTBUG-62448 Change-Id: Iabb89f599e4996f00488a885a5b8a009471838b3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Add tracing metadata to QEvent and QImageFormatAntti Määttä2023-01-131-1/+177
| | | | | | | | | | | Modify qtcore and qtwidgets to use the new tracing metadata features. This allows showing the event types and image formats used in traces as text instead of just numbers. Task-number: QTBUG-106399 Pick-to: 6.5 Change-Id: I267d03a696dc95e8b1d36657d7339dd09d92de3b Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* QKeySequenceEdit: fix typo in parameter nameVolker Hilsheimer2023-01-091-1/+1
| | | | | | | | | | | Amend 1ea0d399b3787d486d6fc59aaaf498cbf6bd66b2. Pick-to: 6.5 Change-Id: I0762beb1da201006ddffc6c05ac204b710055d3f Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> Reviewed-by: Matthias Rauter <matthias.rauter@qt.io> Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Don't override QDialog::setVisible() to implement native dialogsTor Arne Vestbø2023-01-096-44/+52
| | | | | | | | | | | | | | | | | | Clients who called the base-class implementation in QDialog would as a result start hitting the canBeNativeDialog code path at the start of QDialog::setVisible(), which would show the native dialog, but without updating the QWidget visibility state. To keep things 100% compatible, we shuffle the implementation of QDialog::setVisible() into QDialogPrivate, which allows us to override it in QMessageBoxPrivate and QErrorMessagePrivate. The existing subclasses of QDialog that override setVisible have been left as is, to not cause any unintended behavior change. Pick-to: 6.5 Change-Id: Icafe31a7b84a75049365e4e04b80492de08614d2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Fix linking to 'Drag and Drop' topicTopi Reinio2023-01-092-4/+4
| | | | | | | | | | | | | | Linking to 'Drag and Drop' target will link to a page local to Qt Widgets with that section title. The intention is to link to the topic page located in Qt GUI module. Add a descriptive keyword to the correct target page and use that for linking. Pick-to: 6.5 6.4 6.2 Fixes: QTBUG-109289 Change-Id: Ib6a39b43f9080cf5bb72fb07ab163e75eefb4da9 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Fix deprecation of QApplication:setActiveWindow()Kai Köhne2023-01-061-3/+2
| | | | | | | | | | | | | The method is now deprecated in Qt 6.5, not Qt 6.4. Also, keep the documentation for now, but mark it as deprecated there, too. This amends 2436e259ced3. Pick-to: 6.5 Change-Id: Iff3e2c170a8fdb8834c0283de9554b503ed3aca4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add resetTransform to see also of setTransform in QGraphicsViewLeon Zhang2023-01-061-1/+1
| | | | | | Pick-to: 6.5 6.4 Change-Id: I4a38d44f2109f8b92069651c23717da02f5b3091 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Drop link to deleted pagePaul Wicking2023-01-051-3/+1
| | | | | | | | The standard accelerators page was deleted, drop the link to it. Pick-to: 6.5 6.4 Change-Id: I2fa9a94200d0e5f8895bb8c6981c73b3e9dd159e Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* QListView: Prevent infinite loop when wrapping text of item with null-iconVolker Hilsheimer2023-01-042-5/+18
| | | | | | | | | | | | | | | | | | If an item in a list view has a null icon, then the decorationSize gets calculated as -1, -1. The style would then try to wrap the text to a lineWidth of -1, ending up in an infinite loop in viewItemTextLayout. To prevent that, don't set the HasDecoration flag of the style option when the icon is null, and don't fall back ot the decorationSize unless the flag is set. Add a test for this particular item configuration. This also fixes the widget baseline test with styles that don't provide all standard icons. Pick-to: 6.5 Change-Id: I691db6abede9a9b2ad300f3ee7fbfdae5fb6097f Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* Fix a warning about extra semicolon in qstylepainter.hJoni Poikelin2023-01-041-1/+1
| | | | | | Pick-to: 6.5 6.4 6.2 Change-Id: I104037ff58ade4b2ceffd73687355a5d237ab571 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix improper ELF versions of certain symbolsThiago Macieira2022-12-291-2/+2
| | | | | | | | | | | | | | | | They got marked as Qt6_PRIVATE_API because of these private header defining classes that don't follow Qt's naming convention ("mutex", "condition_variable", "ControlElement"). We have an exclusion for classes whose name start with Q. Introduced by 5d903a64aca37ee7c2836e479e175336e9b7ca87 in the old Perl syncqt and ported over. Pick-to: 6.5 Fixes: QTBUG-109605 Fixes: QTBUG-109604 Change-Id: I69ecc04064514f939896fffd173369623c960bcc Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Fix size calculation of unplugged dock widgetsAxel Spoerl2022-12-291-4/+19
| | | | | | | | | | | | | | | When unplugging a dock widget, it still grows by the separator size when dragged upwards or to the left. The unplugged dock widget's size can become too small to drag it or to access window handles. This patch corrects the size offset for all drag directions. It expands the target size to a minimum size, making sure that title bar and window handles can be accessed after unplugging. Fixes: QTBUG-106531 Pick-to: 6.5 6.4 6.2 Change-Id: Ie771a9338ebfb4c0eafd3b3b4205de730cbd20ac Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QWidgetLineControl: Add missing emit keywordsLu YaNing2022-12-281-2/+2
| | | | | | | Add emit keyword to avoid misunderstanding Change-Id: Iec3a896b75769a0bbc791e186d335ed0f728434f Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* wasm: align QWasmLocalFileAccess API with 6.4Morten Sørvig2022-12-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | This API is undocumented, but by keeping unchanged makes it easier to use from external projects. openFile(): Copy the accept/filter list parsing function from 6.4. It makes sense to implement this behind the API, so that user code doesn't have to reimplement it. saveFile(): Slightly more complicated; the new variant which takes a QByteArray is better since the implementation can then keep a reference to the data for as long as it needs, without copying the data. Add the const char * variant to keep existing code going for now. Adjust the calling code in widgets. Pick-to: 6.5 Change-Id: I1899ebffdb90e40429dcb10313ccc5334f20c34f Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* QGraphicsProxyWidget: Don't unnecessarily check focusWidget twiceLu YaNing2022-12-211-1/+1
| | | | | | | Amends commit bf5011815d917e07ae7cf45e5768f1775f70e90d Change-Id: I18a8d26b08b4035d7a76fc51873696590292b181 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Android: Set EnterKeyNext as default type for QLineEditBartlomiej Moskal2022-12-211-0/+16
| | | | | | | | | | | | | | | | | Behavior of EnterKey for virtual keyboard need to be changed for QLineEdit. Before this commit, ImeOption was set to IME_ACTION_DONE. Because of that, setting any text in QLineEdit automatically accept QDialogs. That was annoying, when more than one QLineEdit need to be set. [ChangeLog][Widgets][Android] EnterKey type is now changed from EnterKeyDefault to EnterKeyNext for virtual keyboard in QLineEdit. It is done only if the focus can be moved to widget below. Fixes: QTBUG-61652 Change-Id: I98a7686f9f675fccf0112b8d27d48ad8fd7a887f Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Map toolbar drag delta from native pixelsAxel Spoerl2022-12-191-1/+7
| | | | | | | | | | | | | | | | | | | | The delta (drag distance) for dragging a tool button with in a tool bar was calculated by subtracting the global mouse press position from the drag event's global position. This has lead to a miscalculation when dragging the button across screens with different resolutions. The new relative position within the tool bar became negative, which eventually has lead to resizing of other tool buttons in the same tool bar. This patch calculates the delta based on native pixels, which ensures a correct value in all cases. It falls back to the existing calculation if no window handle can be established from the tool bar. Fixes: QTBUG-103720 Pick-to: 6.5 Change-Id: I09168b597f6c43a119041d00f5b07e1895fdf4b3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Doc: Add link to Tools Examples from the Qt Widgets module front pageLeena Miettinen2022-12-191-0/+1
| | | | | | | | The example docs were difficult to find. Pick-to: 6.4 6.5 Change-Id: Id7003b140275e722dad2c41767eabc24fef728e5 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix QWidget::restoreGeometry when restored geometry is off screenAxel Spoerl2022-12-162-10/+67
| | | | | | | | | | | | | | | | | | | | | | | If a widget's geometry is restored to a screen, which is smaller than the one it was saved from, - the widget could appear (partly) off screen - the widget's title bar and resize handles could be inaccessible This patch refactors and documents checkRestoredGeometry. In a first step, the restored geometry's size is checked against a given screen size. It is corrected if necessary. In a second step, the restored geometry is moved inside the screen, if necessary. It makes the function a static member of QWidgetPrivate in order to expose it for auto testing and adds a respective test function to tst_QWidget. Fixes: QTBUG-77385 Fixes: QTBUG-4397 Task-number: QTBUG-69104 Pick-to: 6.5 6.4 Change-Id: I7172e27bfef86d82cd51de70b40de42e8895bae6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Treat the accessible non-editable combobox as ButtonMenu on macOSMikolaj Boc2022-12-161-0/+1
| | | | | | | | | | | | | | Following the system design, we should treat the non-editable combobox as a ButtonMenu. All of the similar elements in macOS's UI are called ButtonMenu with the screen reader. This fixes the case when ctrl+option+space does not invoke the popup menu with options. Fixes: QTBUG-106162 Change-Id: I0b439c56d72d1fe5b32a60eb7c001f863c00adc1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Cleanup QWizard Windows implementationYuhang Zhao2022-12-163-204/+114
| | | | | | | | | | Since DWM composition is now always enabled and can't be disabled, The code for VistaBasic style is now dead code in reality, just remove them. Change-Id: Iab2ba9b11ed573b240814ab5e26dec656de42ed2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Widgets: Deactivate effect on destructionChristian Ehrlicher2022-12-141-0/+1
| | | | | | | | | | | | If a QGraphicsEffect is active during destruction, the corresponding widget does not inform it's parent about this change which leads to artefacts of the old effect. Therefore trigger an update through effectBoundingRectChanged() if the graphics effect source changes. Fixes: QTBUG-109165 Pick-to: 6.5 6.4 Change-Id: Ib3fd9bec2134ed61f098c4ce6629ebcc5df90787 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't hide object replacement char except in rich textEskil Abrahamsen Blomfeldt2022-12-141-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The object replacement character (U+FFFC) is used to represent inline objects such as images in rich-text. To enable this, we have special handling of it in QTextEngine. For classes where inline images are not supported, it will just be hidden from the visual text, which is unexpected. Instead of always special-casing it, we make this dependent on whether the document layout has registered any object handlers. If they have not, then there will be no visual representation of the object, and it is better to show the glyph for it. For anything based on QTextDocument, there will always be the image handler, so U+FFFC will still have special handling there, but for non-rich labels and plain text editors the glyph will be shown instead. Note that there was also a bug in QLineEdit, where the object replacement character was always replaced by a space. This was introduced in 2007, in a patch which replaced a !ch.isPrint() with a check for "the most obvious non-printable characters" to reduce the number of characters that were not shown. However, U+FFFC is a printable character and would thus not have been filtered by the !isPrint() condition, so I think this was a mistake at the time. However, due to the special-casing of the character in Qt, it would not have had any effect until now. This also changes the QTextLayout::cursorToXForInlineObject() test to actually test proper inline objects, as this was previously using a hack which depended on the inline object code to be used even for plain QTextLayouts with no handlers for these. [ChangeLog][Text] The object replacement character (U+FFFC) is now only filtered out in rich text controls, where they represent inline objects. In other controls, its glyphs will be shown as with other text. Pick-to: 6.5 Fixes: QTBUG-101526 Change-Id: I7fcaf2b10918feb41589e1098016efbf79a0e62d Reviewed-by: Lars Knoll <lars@knoll.priv.no> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix the focus frame on MacGiuseppe D'Angelo2022-12-141-1/+12
| | | | | | | | | | | | | | | | The Mac style uses focus in/out events (sent by QApplication) in order to update the focus frame. If a proxy style is installed, these events never reach the Mac style object. Amends 5d8a7652b995124495ef4f4a43fd8cf461367d62 , by making the forwarding limited to the events for which we want it to happen, and not just *any* event. Fixes: QTBUG-109375 Change-Id: I6df49aa81d6ebb8dbaf00b9ba99e2a7c006e1181 Pick-to: 6.4 6.5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QStackedWidget: remove unused memberDavid Faure2022-12-131-1/+0
| | | | | Change-Id: I109d9753fc7466163aac10921911fc036eb5924e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Rename QMessageDialogOptions::Icon to StandardIconTor Arne Vestbø2022-12-133-4/+4
| | | | | | | | To clarify its use as a pre-defined standard icon, which is a separate use-case from providing a user-defined QIcon. Change-Id: I187ce2e5f125a7392b1279c9bd1e871790c8065f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add static_cast for QKeyEventLu YaNing2022-12-138-10/+10
| | | | | | | | Use static_cast to convert a QEvent to a QKeyEvent, replacing (QKeyEvent*)e Change-Id: I52ac3f46aec42600251cf737db2e71c04f2b45c7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove note about QSystemTrayIcon menu on macOS not emitting aboutToHideTor Arne Vestbø2022-12-121-3/+0
| | | | | | | It works perfectly fine nowadays. Change-Id: I519a581ef4c815fc82a6c82c517cf1350b7b5c67 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Clean up dead codeLu YaNing2022-12-102-17/+12
| | | | | | | Amends commit ce73b4db62574fc966192e6a4f65b7e2b2280e38 Change-Id: I4ed0fc817882e06b16aa9eed959d4a10730d37ac Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Beautify QApplication::compressEventAxel Spoerl2022-12-091-27/+41
| | | | | | | | | | | Replace if-statement to check compressable event types with a switch. Replace if / else if sequence dispatching to type specific compression code paths with a switch. Replace iterated for loop with a ranged one. Task-number: QTBUG-107808 Change-Id: I9054b625f1898fa793f78de1b477a2113a4e33f0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Port QDateTimeEdit internals to QTimeZoneEdward Welbourne2022-12-092-105/+109
| | | | | | | | | | | | | | | | | | | | | In the process, centralize the creation of date-time values, where doing so requires catching invalid results caused by spring-forward gaps; this saves some repetition and extends the treatment to more places that did need it. Also, de-inline two overrides of virtuals; being inline does them no good. Replace the Qt::TimeSpec member of QDTEPrivate with a QTimeZone so that creation of values can be streamlined and to make it easier to add support for (currently unsupported) OffsetFromUTC and TimeZone timespecs in the public QDTE API. This greatly simplifies a lot of the code, while preparing it for a long-needed extension to its functionality. Task-number: QTBUG-80417 Task-number: QTBUG-108199 Change-Id: I0ac2c78025013bf89899e3ef1a56e89392f67ce5 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>