summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-02-133-4/+83
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/graphicsview/boxes/scene.h src/corelib/Qt5CoreMacros.cmake src/corelib/Qt6CoreMacros.cmake src/network/ssl/qsslsocket.cpp src/network/ssl/qsslsocket.h src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp src/testlib/CMakeLists.txt src/testlib/.prev_CMakeLists.txt tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp Disabled building manual tests with CMake for now, because qmake doesn't do it, and it confuses people. Done-With: Alexandru Croitor <alexandru.croitor@qt.io> Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
| * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-042-4/+80
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/widgets/widgets/imageviewer/imageviewer.cpp src/corelib/text/qchar.cpp src/corelib/time/qdatetime.cpp Change-Id: I9762f5c4ff650799219729d6aee79ac07ce9024a
| | * Markdown importer: properly set hyperlinksGiuseppe D'Angelo2020-02-032-2/+78
| | | | | | | | | | | | | | | | | | | | | | | | The "title" in markdown is the tooltip, not the name attribute of a link. Also, tell the char format that it's an anchor. Change-Id: I2978848ec6705fe16376d6fe17f31007cce4b801 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| | * Markdown importer: use Unicode decodingGiuseppe D'Angelo2020-02-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given we feed UTF-8 data into the importer, it must be able to cope with Unicode. Build md4c with UTF-8 support, advertise it at usage site, and change a couple of broken decodings. Driveby: the textedit example used the wrong codec to decode a Markdown file. While the Markdown spec doesn't deal with encodings, using the default one for HTML is certainly wrong. Port the loading of both markdown and plaintext to UTF-8, as that what _saving_ via QTextDocumentWriter would use by default. Change-Id: I51c6214cfe45ebfc5a67a7366f7866a5328366ec Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | Suppress deprecation warnings for QFont::ForceIntegerMetricsEskil Abrahamsen Blomfeldt2020-02-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This flag has been deprecated, but until we remove it completely we need to continue supporting it, so we just suppress the warnings for now. Change-Id: I464e1cce42f78af76d46ec12eeb3e8d53d64d6a3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Fix sorting of fallback fonts based on writing systemsHikaru Terazono (3c1u)2020-02-121-6/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now qt_sort_families_by_writing_system checks all writing systems for sc ript. This makes Japanese text look properly on macOS. Task-number: QTBUG-81924 Change-Id: Id2a149eb84c5992414505b079be4e707f7f8c6c7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | Remove comments about destructors needing to be emptyJan Arve Sæther2020-02-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Not important, but removes some ### Qt6 comments from my radar Change-Id: Ifd1bf44c44ece8fa1314d3c7e0e95d1bd37ae0ea Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-2812-63/+65
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsettings.cpp src/corelib/kernel/qvariant.cpp src/corelib/serialization/qjsoncbor.cpp src/corelib/serialization/qjsonvalue.cpp src/corelib/tools/tools.pri src/gui/image/qimage.cpp src/gui/kernel/qguivariant.cpp src/widgets/kernel/qshortcut.cpp tests/auto/tools/moc/allmocs_baseline_in.json tests/auto/tools/moc/tst_moc.cpp src/opengl/qglframebufferobject.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Leander Beernaert <leander.beernaert@qt.io> Change-Id: Ie7f5fa646c607fe70c314bf7195f7578ded1d271
| * | Doc/QtGui: replace some 0 with \nullptrChristian Ehrlicher2020-01-262-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace some 'is 0' or 'are 0' where 0 referes to a nullptr with 'is \nullptr' and 'are \nullptr' Change-Id: Ic18d0c8bcf64159b4c8fae8c9499839954a98884 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
| * | Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-239-54/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Deprecate QFont::ForceIntegerMetrics and QFont::OpenGLCompatibleEskil Abrahamsen Blomfeldt2020-01-232-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ForceIntegerMetrics flag was added in Qt 4.7 specifically because of WebKit, which was rounding text metrics and getting mismatches with the underlying font engine whenever it supported fractional advances. For backwards compatibility with how the CoreText engine worked before this, we added a flag to allow rounding all metrics. Rounding advances gives very broken rendering and is hopefully not used by anyone anymore, so lets remove this flag in Qt 6. As for OpenGLCompatible, this flag is not used anywhere. I am not exactly sure what this flag did, but all fonts are "OpenGL-compatible" at this point. [ChangeLog][QtGui][QFont] Deprecated QFont::ForceIntegerMetrics and QFont::OpenGLCompatible, with the intention of removing them in Qt 6.0.0. Change-Id: I0a492c153348023f00d561bab8ab4b5104c6c7c4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-191-33/+37
|\| | | | | | | | | | | Change-Id: I68702c9f9680772d332b5bb777ddd2663168abd5
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-181-33/+37
| |\| | | | | | | | | | Change-Id: I12148e7b20bcdb72d9b328035d528c99633b1e92
| | * Doc: Update text that refers to deprecated member function width()Paul Wicking2020-01-171-33/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add see also links from the deprecated function to the replacement. * Change introduction text to reflect new function name rather than the old and deprecated width(). * Change see also and inline references to width(), so that they now refer to horizontalAdvance(). Task-number: QTBUG-65141 Change-Id: Iadfbc517e5df96e32058516f8795bd210cc4c5e4 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-161-2/+12
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qshortcut.cpp tests/auto/network/access/spdy/tst_spdy.cpp Change-Id: If76c434beac2c0a393440aa365f89f77439774ce
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-151-2/+12
| |\| | | | | | | | | | Change-Id: I8dbcf23835d52d3aa7d018ed250814d60c68aa83
| | * Remove empty block at beginning of imported markdownRainer Keller2020-01-131-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An empty QTextDocument already contains a block; so when the formatting is fully determined, if the document is still empty, then instead of inserting a new block, we can set formatting on the cursor, which affects the pre-existing block, before inserting text. This avoids leaving a blank line (the default block) above the inserted content. Fixes: QTBUG-81060 Change-Id: I14e45e300a602493aa59680417d74d4c2b25862d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-091-4/+2
|\| | | | | | | | | | | Change-Id: I7be168303fc4fec5892f20f8dcbdf1bdfcd4986f
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-071-4/+2
| |\| | | | | | | | | | Change-Id: I6c81e3cb6272adc5c3de2513792bd48604ff4dd0
| | * QTextDocument: Set the font family to be after the families setAndy Shaw2020-01-061-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This amends a1f4321bbba2f3bff24d753ce766be738dbfa61a as the font families should take precedence over the font family set. If the font family is already included in the families then it should keep its placement. Otherwise it should be appended. Task-number: QTBUG-80475 Change-Id: I0049189c88b6879e57619815ec780960e9c0a300 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-01-072-26/+14
|\| | | | | | | | | | | Change-Id: Ia2ce994c42adc010c453edaeea57f672556958f6
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-062-26/+14
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qvariant.h Change-Id: I8f3873e74b9795ac889e7c7ec5de2619bca92160
| | * QTextDocument: Give fontFamily() precedence over fontFamilies()Ulf Hermann2020-01-022-26/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the singular fontFamily() is given, then this is obviously the one to be preferred over any plural fontFamilies(). Make sure it always ends up first in the list of emitted font families. Change-Id: I1e3b1ba29721c8298b1a0d4a1e1da49ba5b4e7ac Fixes: QTBUG-80475 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-01-045-11/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qvector.h Make QVector(DataPointer dd) public to be able to properly merge 5b4b437b30b320e2cd7c9a566999a39772e5d431 from 5.15 into dev. src/widgets/kernel/qapplication.cpp tests/auto/tools/moc/allmocs_baseline_in.json Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de> Change-Id: I929ba7c036d570382d0454c2c75f6f0d96ddbc01
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-12-271-0/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/plugins/platforms/xcb/qxcbscreen.cpp src/widgets/accessible/qaccessiblewidget.cpp Change-Id: Ib3138e61ba7981610940509a7ff02ba2dd281bf0
| | * QTextDocument: compile with QT_NO_PRINTERChristian Ehrlicher2019-12-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of QTextDocument::print() is not available when QT_NO_PRINTER is defined but the declaration was so when someone is using this function (and QT_NO_PRINTER) a linker error will occur. Fixes: QTBUG-56916 Change-Id: I49aaaa643c4d8587a66fc95733060cea11994872 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | Replace usages of QVariant::value by qvariant_castOlivier Goffart2019-12-152-9/+9
| | | | | | | | | | | | | | | | | | | | | This is done automatically with a clazy check Change-Id: I3b59511d3d36d416c8eda74858ead611d327b116 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | QTextDocument: Change use of QMap::unite to QMap::insertMårten Nordheim2019-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | None of the code I could see handles the map like a multimap. Change-Id: I9d51da6dafed4317e801703599e83fb038c22a1d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Avoid initializing QFlags with 0 or nullptr in macOS-specific codeFriedemann Kleint2019-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | It is being deprecated. Change-Id: If1b0b058140e197d41efae93025c4eefc2ed9bbd Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-112-1/+14
|\| | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp Change-Id: I6b82507bf9a80a374c40393e72f4843f1557de89
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-12-102-1/+14
| |\| | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/network/kernel/qnetworkinterface/BLACKLIST Change-Id: I1e8866c63b54bcd95fc2a044276ee15b7f60e79a
| | * Fix updating the text cursor position after editingSona Kurazyan2019-12-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases when editing the text (for example when removing the selected text, or pasting a text block) the text cursor position is updated, but its visual x position is not updated. This causes the next cursor movements to start from a wrong position. Force the update for those cases. Fixes: QTBUG-78479 Change-Id: Ia496be62beec58660f5e1695e5aafae09c79684e Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
| | * Copy formatting attributes when cloning an empty QTextDocumentSona Kurazyan2019-12-051-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cloning a QTextDocument, the text fragment of the original document is copied into the new one, which results into copying also the formatting attributes. However, when the text document is empty, the corresponding text fragment is also empty, so nothing is copied. If we want to transfer the formatting attributes for an empty document, we need to set them explicitly. Fixes: QTBUG-80399 Change-Id: I382cd0821723436120af47c06ec7bfa849636307 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-0925-244/+244
|\| | | | | | | | | | | Change-Id: Ia24cc8b86def0d9d9c17d6775cc519e491b860b1
| * | Tidy nullptr usageAllan Sandfeld Jensen2019-12-0625-244/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-053-4/+8
|\| | | | | | | | | | | Change-Id: I9d63a4c4b229a831b5369f6ec74ac97ba6d6556a
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-12-043-4/+8
| |\| | | | | | | | | | Change-Id: Ia70e81943ef097941339f9ef9ace28592a2eb740
| | * Fix assert in QTextDocument CSS parser on "border-width: 1pt"David Faure2019-12-033-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code was assuming that if the parsing of the value worked, then it must be a list of 4 variants. But in this case it's just a single length. This came from <td> using 4 values for border-width while other elements use a single value. But the storage is shared. So the fix is to use 4 values everywhere. When reading 4 and there's only one, it gets duplicated, so the caller can just use the first one in that case. Task-number: QTBUG-80496 Change-Id: I682244b6e3781c4d673a62d5e6511dac263c58e8 Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2019-11-272-4/+4
|\| | | | | | | | | | | Change-Id: I5bdfe94f7eec1ba328c4a4b54d12dbc0da7fc3ac
| * | Improve QTextDocumentPrivate cursor performanceLangonda Agag2019-11-252-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cursors in QTextDocumentPrivate are held in a QList. This becomes a serious performance problem with lots of extra selections due to a call to QTextDocumentPrivate::removeCursor() from the QTextCursor destructor. Given the following test program: QPlainTextEdit *editor = ... std::list< QTextCursor> list; for(int i = 0; i < 100000; ++i) { QTextCursor c(editor->document()); c.setPosition(std::rand()%100); list.push_front(c); } list.clear(); // <-- clear calls hangs for 3+ seconds // due to time spent in // QTextDocumentPrivate::removeCursor() // due to QList::removeAll() call Note the push_front because it exacerbates the issue because the entire list will be traversed. The change submitted changes the structure to a set, removing the issue. In theory, this limits that a cursors cannot be in the structure twice, but this neither happens nor would it make sense. Change-Id: I817dc5d1bda1d98c6725a531b32d1c711a029a34 Reviewed-by: Langonda Agag <namezero@afim.info> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-2515-54/+98
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qhash.h src/gui/kernel/qevent.h src/widgets/kernel/qshortcut.cpp src/widgets/kernel/qshortcut.h Change-Id: If61c206ee43ad1d97f5b07f58ac93c4583ce5620
| * | Avoid initializing QFlags with 0 or nullptr in further casesFriedemann Kleint2019-11-223-24/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Amends qtbase/af2daafde72db02454d24b7d691aa6861525ab99. Where applicable, port over to member initialization, thus also fixing nullptr warnings. Change-Id: Iaaf2dbbbcf2952253390b8839fd15a1b17be32c0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * | Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-208-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Fix kerning with fractional pixel sizeEskil Abrahamsen Blomfeldt2019-11-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since most of our APIs for pixel size are integer-based, we would assume it was when passing it to Harfbuzz. But QRawFont (and the internal APIs in Qt and Harfbuzz) support floating point pixel sizes. The result would be that setting e.g. pixel size 20.25 would give the same glyph positions as 20.75, but the glyphs would be some fraction of a pixel larger. Using floats instead should have no impact on the common case where the pixel size is an integer, but it should also enable the other case, where QRawFont is used (or potentially future APIs that do not have the integer limitation.) [ChangeLog][QtGui][Text] Fixed a problem where pixel sizes would be truncated before calculating glyph positions. Fixes: QTBUG-67091 Change-Id: Ib066b1330ddcf52d4b344412e350aa9a60c847ff Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| * | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Qt Forward Merge Bot2019-11-151-0/+4
| |\ \
| | * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-151-0/+4
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/rhi/qshader.cpp tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp Change-Id: I1c4ae718eb3592a0a0a90af9d11553f3ab68cad5
| | | * Use default QTD font size for mono font when importing markdownEike Ziller2019-11-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFontDatabase::systemFont(FixedFont) determines the font for inline code and code blocks in a markdown document. Now we change the size of that font to the same size as QTextDocument::defaultFont() so that the user has the ability to customize the font size in each document instead of only system-wide. Change-Id: Ief7367336f7613e88695dbb08bcb7e9f50db8961 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | | QStyleSheetStyle: add new property to QPushButton: iconRichard Moe Gustavsen2019-11-142-0/+34
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is currently no proper way to change the icon of a pushbutton from css. But there is a need for doing so (QTBUG-2982), and the typical work-around is to instead use the css property 'qproperty-icon'. But setting qproperties from the style is not a good idea in the first place, since it modifies the state of the widget it draws. Moreover, such properties are only set once (in QStyle::polish()), and will not have any effect on pseudo states, like hover. To close this gap, this patch will add a css property 'icon' that can be set on a QPushButton. This property will follow normal css cascading, and respect pseudo states, equal to any other css property. [ChangeLog][QtWidgets][QStyle] You can now set the CSS property 'icon' on a QPushButton to override which icon to draw. Fixes: QTBUG-79137 Change-Id: Ie7e0b0fa4f19471f51108cd4ca931356219d562e Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-084-9/+28
| |\| | | | | | | | | | Change-Id: I963b5f48b5d6f3500ca379fbd7f1a4290b570175
| | * Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-11-062-2/+8
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/features/mac/default_post.prf src/corelib/tools/qsimd_p.h src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm util/qfloat16-tables/gen_qfloat16_tables.cpp Change-Id: If48fa8a3bc3c983706b609a6d3822cb67c1352a4