summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qfontdialog.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Widgets: Improve usage of string view typesAnton Kudryavtsev2024-04-081-1/+1
| | | | | | | Use string views in QFontDialog, QColorDialog and QCommonStyle Change-Id: I22f4b4694e2d18b784aaa85aebff8d92b8f0b871 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QFontDialog: Use pmf-style connectsChristian Ehrlicher2024-01-101-21/+30
| | | | | | | | Port all string-based signal/slots connections to pmf-style connects. Pick-to: 6.7 Change-Id: Ic7ecfd1efb8eb76239598e48f25251357040f814 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Unify QDialog WA_WState_ExplicitShowHide handlingTor Arne Vestbø2023-10-231-2/+1
| | | | | | | | | | | | | | | | Instead of checking it inside QDialogPrivate::setVisible and its overrides, we can check it in QDialog::setVisible, up front. The logic in QDialogPrivate::setVisible related to modality that was executed prior to the WA_WState_ExplicitShowHide is now skipped in the case the WA_WState_ExplicitShowHide condition hits, but this makes sense as the modality logic has a second part at the end of the function, restoring the modality, and this part was never executed as the code was prior to this change. Change-Id: I9580e91dbc5a981c83538d765b86138afee44f14 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* dialogs: use const methods moreAnton Kudryavtsev2023-09-081-1/+1
| | | | | | | | to avoid implicit detach Change-Id: I2d46696a29f2a454452239e0400af2e2de534cbb Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Dialogs: clean up native dialogs when object gets destroyedVolker Hilsheimer2023-09-061-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | QWidget::setVisible is virtual, and called via hide() by both the QDialog and the QWidget destructor. A dialog that becomes invisible when getting destroyed will at most execute the QDialog override. Subclassing QDialog and overriding setVisible() to update the state of the native platform dialog will not work, unless we explicitly call hide() in the respective subclass's destructor. Since e0bb9e81ab1a9d71f2893844ea82, QDialogPrivate::setVisible is also virtual, and gets called by QDialog::setVisible. So the clean solution is to move the implementation of the native dialog status update into an override of QDialogPrivate::setVisible. Add test that verifies that the transient parent of the dialog becomes inactive when the (native) dialog shows (and skip if that fails), and then becomes active again when the (native) dialog is closed through the destructor of the Q*Dialog class. The test of QFileDialog has to be skipped on Android for the same reason as the widgetlessNativeDialog. Fixes: QTBUG-116277 Pick-to: 6.6 6.5 Change-Id: Ie3f93980d8653b8d933bf70aac3ef90de606f0ef Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QtWidgets: Disambiguate static functions/variables and definesFriedemann Kleint2023-01-141-2/+2
| | | | | | | | | | | | | 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>
* Add static_cast for QKeyEventLu YaNing2022-12-131-1/+1
| | | | | | | | 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 noop modification of QDialogPrivate::nativeDialogInUseTor Arne Vestbø2022-11-111-1/+0
| | | | | | | | | The modification was inside a nativeDialogInUse == false condition already. Task-number: QTBUG-108153 Change-Id: Ice5f48fc5d2548085b063060817e2c4eeaf00452 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtWidgets: Use strcmp instead of equality operatorMate Barany2022-09-261-3/+1
| | | | | | | | | | Addressing some findings from the review of QTBUG-98434, use strcmp instead of the equality operator. This saves one strlen() per QL1SV constructor and takes L1 out of the picture. Task-number: QTBUG-103100 Change-Id: Iffe8ce4c4dd9a3ee590d4bb8a14b950241b835e2 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QFontDialog: Check if native dialog is in use before usingTor Arne Vestbø2022-07-081-8/+16
| | | | | | | | | | | | | A call to platformFontDialogHelper() will lazily create the helper, and is not enough to distinguish whether the helper is actually in use. The explicit nativeDialogInUse flag also takes properties like DontUseNativeDialog into account, which may be set after the dialog is first constructed. Fixes: QTBUG-104696 Pick-to: 6.2 6.3 6.4 Change-Id: Ia00a39bba4aaae8c99ae0cdd6543c2e451f72ea6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@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>
* QtWidgets: replace remaining uses of QL1String with QL1StringViewSona Kurazyan2022-05-021-2/+2
| | | | | | | Task-number: QTBUG-98434 Change-Id: If20e217e6e4fecd18c7707bf94650f5ba856893f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QtWidgets: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-05-021-10/+12
| | | | | | Task-number: QTBUG-98434 Change-Id: I310ea8f19d73a79d985ebfb8bfbff7a02c424360 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QFontDialog: Fix crash when passing QFont constructed from empty ↵Friedemann Kleint2021-03-291-1/+1
| | | | | | | | | | | | | string/stringlist The standarddialogs example showed a crash when opening the font dialog due to the empty list. Amends d8602ce58b6ef268be84b9aa0166b0c3fa6a96e8. Pick-to: 6.1 Change-Id: I93191485c72712d9b2d3ea0ae104f5edb9621f0c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Font style name 'Normal' and 'Regular' have the same meaningOliver Eftevaag2021-03-021-0/+8
| | | | | | | | | | | | | | Some popular fonts on linux systems follow a naming convention, where font styles are named 'Regular', 'Italic', 'Bold' and 'Bold Italic'. Qt so far only accepts the words Italic and Oblique interchangably, but not with Regular and Normal. This change will make sure that Regular is interpreted the same as the Normal font style. Fixes: QTBUG-90396 Pick-to: 6.0 6.1 5.15 Change-Id: Ibbaf086de742c91f4d380c937ca80e846aa32a2e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Canonical pointer usageHou Lei2021-02-091-1/+1
| | | | | | | | Other affected rows have also been fixed. Change-Id: Ie0a32f724bd2e40e7bfacfaa43a78190b58e4a21 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QFont: Prefer setFamilies() over setFamily()Andy Shaw2020-11-201-2/+2
| | | | | | | | | | | | | | | | By depending on setFamilies() then we can be sure that font names with spaces, commas, quotes and so on are correctly handled without being misinterpreted. For now it will split on the comma when a string containing one is passed to setFamily. But from Qt 6.2 this will be removed to preserve the family string as a convenience function. [ChangeLog][QtGui][QFont] Indicated that setFamilies/families is preferred over setFamily/family to ensure that font family names are preserved when spaces, commas and so on are used in the name. Change-Id: Id3c1a4e827756a4c928fed461a4aafa5a0f06633 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-161-1/+1
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Deprecate QFontDatabase constructorVolker Hilsheimer2020-11-031-3/+3
| | | | | | | | Move private methods into the private class. Fixes: QTBUG-88114 Change-Id: I92fa52980ed5a0675eee310359d8875f614921e6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Get rid of all instance usage of QFontDatabaseVolker Hilsheimer2020-11-031-11/+9
| | | | | | | | All QFontDatabase APIs are static, use them accordingly. Task-number: QTBUG-88114 Change-Id: I0e4a7508646037e6e2812611262eed8b6d7ad3de Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix QFontDialog::selectedFont() does not return actual selected fontZhang Yu2020-10-191-1/+1
| | | | | | | | | "QFontDialog::accepted" was emitted before setting "selectedFont" to current font. So when calling "QFontDialog::selectedFont()" in slot of signal "QFontDialog::accepted",it does not return actual selected font. Fixes: QTBUG-87483 Pick-to: 5.15 Change-Id: Ic9303e3df73ddd876fc78a0038f9379dbdf1853c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-10/+10
| | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-201-1/+1
| | | | | | | | | This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-121-1/+1
|\ | | | | | | Change-Id: Icaabf08f9af539ddf844d96bc9c3a2d09408ba8a
| * [Doc] Fix minor typosSze Howe Koh2019-07-101-1/+1
| | | | | | | | | | Change-Id: I7e74806218dcc07d800f4ec08e94abce32483f5e Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* | QtWidgets: Fix static method invocationsFriedemann Kleint2019-06-281-2/+2
|/ | | | | | | | | | | | | | | | | | | | | Apply fixits by Creator and results of manual search focusing on QCore/Gui/Applicaton(Private) methods and variables to prepare for splitting out some classes. Task-number: QTBUG-69478 Task-number: QTBUG-76497 Task-number: QTBUG-76493 Change-Id: Iaf468166793e0cabb514b51c827b30317bf45a2d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Deprecate QFont::lastResortFamily() and QFont::lastResortFont()Eskil Abrahamsen Blomfeldt2018-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | These functions have not been used by the font selection algorithm in Qt 5. Calling lastResortFamily() always gave you "helvetica" and lastResortFont() would actually crash. Since we cannot remove them before Qt 6, we deprecate them for now and update the documentation to give a more accurate description of how the font matching works in Qt 5. Note that in the non-native QFontDialog, it tries to implement its own font matching algorithm and therefore was calling lastResortFamily(). Since fixing QFontDialog is not within the scope of this patch, I have just replaced the call by "helvetica" directly, so that it will continue to behave the same. [ChangeLog][QtGui][Text] Deprecated QFont::lastResortFamily() and QFont::lastResortFont() which are not in use in Qt 5 and did not provide any useful information. Task-number: QTBUG-60813 Change-Id: Id8fe7bfdd427292ef86bc8405de03cb466b9b62a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make overloaded function appear in assistant indexJarek Kobus2018-10-011-1/+0
| | | | | | | | | | When there are overloaded function for one class, at least one of them mustn't possess \overload command, otherwise it won't appear at all in doc index. Task-number: QTBUG-59506 Change-Id: I650a3969cb45c1a5efdfc3a654e01d113c398f16 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-191-1/+1
| | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Convert features.fontdialog to QT_[REQUIRE_]CONFIGStephan Binner2017-07-111-4/+0
| | | | | Change-Id: Iebc091ffd023595278fa177b7f205b6e0cd7ec52 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-301-3/+3
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network-chat/peermanager.cpp src/widgets/util/qsystemtrayicon.cpp src/widgets/util/qsystemtrayicon_qpa.cpp src/widgets/util/qsystemtrayicon_win.cpp src/widgets/util/qsystemtrayicon_x11.cpp Change-Id: I1c026df83818c0ccaf956980370e7522960627db
| * Make sure features are defined before testing themPaul Olav Tvete2017-01-251-3/+3
| | | | | | | | | | | | | | | | | | Include the file defining the feature before testing whether the feature exists. Also use the new feature macro to make sure this bug doesn't happen again. Change-Id: I204836fee59b143a7ce7d256a7aed223c4d0ceb1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Doc update: reflect use of native font dialog by default on macOSPierre Rossi2017-01-081-2/+1
|/ | | | | | | | | The documentation still stated that the Qt standard font dialog was used. Task-number: QTBUG-47572 Change-Id: Iff4262869efde2d9fefb38264b2f6f8a9d2f7483 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-291-1/+3
|\ | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/uikit/xcodebuild.mk tests/auto/other/lancelot/tst_lancelot.cpp tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp Change-Id: Ia0ae2de86094120281abd445138877c2cc3e882c
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-231-1/+3
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qlogging.cpp Change-Id: I9cc8f25ad897efab6a42cb5c5161b1c9402952f0
| | * Q(Font|Color|File)Dialog: Fix several UBs (invalid cast/member call) in ↵Marc Mutz2016-09-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Private::canBeNativeDialog() Found by UBSan: qfontdialog_p.h:77:5: runtime error: downcast of address 0x7ffc3ceadc90 which does not point to an object of type 'QFontDialog' 0x7ffc3ceadc90: note: object is of type 'QDialog' fc 7f 00 00 38 5f a8 27 fc 2a 00 00 60 e2 14 02 00 00 00 00 10 61 a8 27 fc 2a 00 00 00 00 00 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QDialog' #0 0x2afc24d29490 in QFontDialogPrivate::q_func() const qfontdialog_p.h:77 #1 0x2afc24d29490 in QFontDialogPrivate::canBeNativeDialog() const qfontdialog.cpp:1033 #2 0x2afc24c93f56 in QDialog::setVisible(bool) qdialog.cpp:696 #3 0x2afc24c7b27a in QDialog::~QDialog() qdialog.cpp:357 #4 0x2afc24d286a6 in QFontDialog::~QFontDialog() qfontdialog.cpp:339 #5 0x2afc24d481a2 in QFontDialogPrivate::getFont(bool*, QFont const&, QWidget*, QString const&, QFlags<QFontDialog::FontDialogOption>) qfontdialog.cpp:402 #6 0x2afc24d483f1 in QFontDialog::getFont(bool*, QWidget*) qfontdialog.cpp:396 #7 0x407652 in tst_QFontDialog::testGetFont() tst_qfontdialog.cpp:120 qcolordialog.cpp:86:5: runtime error: downcast of address 0x7ffdf50c1ec0 which does not point to an object of type 'QColorDialog' 0x7ffdf50c1ec0: note: object is of type 'QDialog' fd 7f 00 00 d8 6e c7 23 b7 2a 00 00 50 c1 af 01 00 00 00 00 b0 70 c7 23 b7 2a 00 00 00 00 1a 1e ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QDialog' #0 0x2ab720e4ec97 in QColorDialogPrivate::q_func() const qcolordialog.cpp:86 #1 0x2ab720e4ec97 in QColorDialogPrivate::canBeNativeDialog() const qcolordialog.cpp:1865 #2 0x2ab720e84ed6 in QDialog::setVisible(bool) qdialog.cpp:696 #3 0x2ab720e6c1fa in QDialog::~QDialog() qdialog.cpp:357 #4 0x2ab720e2b276 in QColorDialog::~QColorDialog() qcolordialog.cpp:2187 #5 0x2ab720e5e2c6 in QColorDialog::getColor(QColor const&, QWidget*, QString const&, QFlags<QColorDialog::ColorDialogOption>) qcolordialog.cpp:2148 #6 0x2ab720e5e473 in QColorDialog::getRgba(unsigned int, bool*, QWidget*) qcolordialog.cpp:2176 #7 0x407180 in tst_QColorDialog::testGetRgba() tst_qcolordialog.cpp:118 qfiledialog_p.h:112:5: runtime error: downcast of address 0x7ffd6858cc60 which does not point to an object of type 'QFileDialog' 0x7ffd6858cc60: note: object is of type 'QDialog' a1 2b 00 00 d8 1e 5e 0c a1 2b 00 00 b0 af 01 20 a1 2b 00 00 b0 20 5e 0c a1 2b 00 00 00 00 46 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QDialog' #0 0x2ba10980a9e7 in QFileDialogPrivate::q_func() const qfiledialog_p.h:112 #1 0x2ba10980a9e7 in QFileDialogPrivate::canBeNativeDialog() const qfiledialog.cpp:695 #2 0x2ba1097efe36 in QDialog::setVisible(bool) qdialog.cpp:696 #3 0x2ba1097d715a in QDialog::~QDialog() qdialog.cpp:357 #4 0x2ba109854c4b in QFileDialog::~QFileDialog() qfiledialog.cpp:380 #5 0x4179dc in tst_QFiledialog::init() tst_qfiledialog.cpp:175 Fix by replacing Q_Q with the the equivalent expression for QDialog. We can't re-use QDialogPrivate::q_func() here, since that is private, and probably should stay like that. Also fix an invalid member call in QColorDialogPrivate::canBeNativeDialog(): qcolordialog.cpp:2050:5: runtime error: member call on address 0x7ffdf50c1ec0 which does not point to an object of type 'QColorDialog' 0x7ffdf50c1ec0: note: object is of type 'QDialog' fd 7f 00 00 d8 6e c7 23 b7 2a 00 00 50 c1 af 01 00 00 00 00 b0 70 c7 23 b7 2a 00 00 00 00 1a 1e ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QDialog' #0 0x2ab720e4e5ea in QColorDialog::options() const qcolordialog.cpp:2050 #1 0x2ab720e4e8c8 in QColorDialogPrivate::canBeNativeDialog() const qcolordialog.cpp:1870 #2 0x2ab720e84ed6 in QDialog::setVisible(bool) qdialog.cpp:696 #3 0x2ab720e6c1fa in QDialog::~QDialog() qdialog.cpp:357 #4 0x2ab720e2b276 in QColorDialog::~QColorDialog() qcolordialog.cpp:2187 #5 0x2ab720e5e2c6 in QColorDialog::getColor(QColor const&, QWidget*, QString const&, QFlags<QColorDialog::ColorDialogOption>) qcolordialog.cpp:2148 #6 0x2ab720e5e473 in QColorDialog::getRgba(unsigned int, bool*, QWidget*) qcolordialog.cpp:2176 #7 0x407180 in tst_QColorDialog::testGetRgba() tst_qcolordialog.cpp:118 by accessing the data member directly instead of through the Public API. Fix the same code in QFileDialog, even though the autotest coverage is too limited for UBSan to point that one out explicitly. Change-Id: Idd278744961435e417d91fb2f89b6d91a94e0c71 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-08-291-8/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cf53aa21bf0f8fbd13c0ce2d33ddf7bc63d0d76a and 3aaa5d6b32130d3eeac872a59a5a44bfb20dfd4a were reverted because of reconstruction in 5.7. defineTest(qtConfTest_checkCompiler) in configure.pri is smart enough to cover the case in a9474d1260a8c8cc9eae14f2984098919d9684e5. DirectWrite: Fix advances being scaled to 0 Since 131eee5cd, the stretch of a font can be 0, meaning "whatever the font provides". In combination with ec7fee96, this would cause advances in the DirectWrite engine to be scaled to 0, causing the QRawFont test to fail. Conflicts: configure mkspecs/features/uikit/device_destinations.sh mkspecs/features/uikit/xcodebuild.mk src/corelib/global/qglobal.cpp src/corelib/global/qnamespace.qdoc src/plugins/platforms/cocoa/qcocoamenuitem.h src/plugins/platforms/windows/qwindowsservices.cpp src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp src/widgets/kernel/qapplication.cpp tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp Change-Id: I4656d8133da7ee9fcc84ad3f1c7950f924432d1e
| * | Dialogs: don't create platform helpers unconditionallyJ-P Nurmi2016-08-171-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No matter if Qt::AA_DontUseNativeDialogs was set, both QFileDialog and QColorDialog were always unconditionally creating the platform helper at construction time: QFooDialog() -> QFooDialogPrivate::init() -> QFooDialogPrivate::platformFooHelper() -> QDialogPrivate::platformHelper() Only QFontDialog had the platformHelper() calls guarded with canBeNativeDialog(). => Move the canBeNativeDialog() check inside QDialogPrivate::platformHelper() where the platform helper instance is created. Task-number: QTBUG-55276 Change-Id: I84b595fbd009c70a3a1976ddbb32a835270c5203 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | QtWidgets: Introduce delegating constructors.Friedemann Kleint2016-05-021-3/+1
| | | | | | | | | | | | | | | | | | | | | Reduce code duplication by chaining constructors. Change-Id: I0229556a417153063ac6d14d35765c85e6fe1fe8 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-04-111-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qobject.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I74e1779832f43d033708dcfd6b666c7b4f0111fb
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-071-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/qftp.cpp src/widgets/itemviews/qheaderview.cpp src/widgets/itemviews/qlistview.cpp tests/auto/network/access/qftp/tst_qftp.cpp Change-Id: I9f928f25d45d8944dd60bb583f649fc1615bc5d9
| | * QFontDialog: re-enable X close button in window decorationMarc Mutz2016-04-061-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: Id8d9dab7a0e4cf22abefd9bdc7bf2fd4cba1f445 Task-number: QTBUG-32240 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | QtWidgets: Remove Windows CE.Friedemann Kleint2016-04-071-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove Windows CE-specific files, #ifdef sections for Q_OS_WINCE and wince .pro file clauses in library, examples and tests. Task-number: QTBUG-51673 Change-Id: I102745aaca9d9737f2108fe7618111743d5ae980 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Q{File,Font,Color,Message}DialogOptions are no value classesMarc Mutz2016-03-011-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These classes are only held in QSharedPointer, so optimize for that: 1. Disable default ctor, copy ctor and assignment operator, destructor and swap for public users. 2. Add create() to return an instance in a shared pointer. 3. Allocate public and private classes in one memory block, use QSharedPointer::create() to also add the QSharedPointer control block to the same memory allocation. As a consequence, this reduces the creation of a Q*DialogOptions into a shared pointer by two memory allocations. Add a macro to enable atomic updates to QtQuick and other users outside QtBase. [ChangeLog][QtGui] [QFileDialogOptions/QFontDialogOptions/QMessageDialogOptions/QColorDialogOptions] This class no longer has value semantics, but needs to be held in QSharedPointer (as it always was). To copy an instance, use the clone() method. Change-Id: I4c81220e0a8286a310df1c224a30eca34824c4e6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Add attribute Qt::AA_DontUseNativeDialogs.Friedemann Kleint2016-02-171-3/+4
| | | | | | | | | | | | | | | | | | | | The attribute can be set to suppress native dialogs for example for testing purposes. Task-number: QTBUG-51074 Change-Id: I35611e07e00b7a060f22b49d6ab6f3b8627f8aca Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@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 devFrederik Gladhorn2016-01-081-0/+10
|\| | | | | | | | | | | Based on merge done by Liang Qi Change-Id: Id566e5b9f284d29bff2199f13f9417c660f5b26f
| * QFontDialog: optimize allocation of QFontDialogOptionsMarc Mutz2016-01-061-1/+2
| | | | | | | | | | | | | | | | Use QSharedPointer::create(), to fuse control block and payload into a single memory allocation. Change-Id: I8d87c73566c3be960e957ec0b5419a77da2fc8c9 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Unbreak ubsan developer-buildMarc Mutz2016-01-061-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 5.3's undefined-behavior sanitizer checks that the declared type of the object is a base class of the dynamic type of the object on each access to a member of a class type. It therefore requires the typeinfo for these types, which for polymorphic types is emitted in the TU where the vtable is emitted, too. QFileDialogPrivate is a polymorphic non-exported class, so this failed at link-time. Ditto for the other cases. Fix by autotest-exporting the classs. Also, where applicable, de-inline the dtors, so the vtable (and typeinfo) are pinned to one TU, and the ctor, just because it's the correct thing to do. Change-Id: I2b7dba776282a2809c80eb2bc36440d7d698f926 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QtWidgets: replace some Q_FOREACH loops with C++11 range-forMarc Mutz2015-12-161-1/+2
|/ | | | | | | | | | | | | | | | | | This needs to be handled a bit carefully, because Qt containers will detach upon being iterated over using range-for. In the cases of this patch, that cannot happen, because all containers are marked as const (either by this patch or before). Separate patches will deal with other situations. Range-for loops are much more efficient than foreach loops. This patch shaves almost 3K of text size off an optimized Linux AMD64 GCC 4.9 build. Change-Id: I7b1d41db4d9b5db8b515cb75686dc5135177da68 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>