summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* QTextMarkdownImporter: don't keep heading level on following list itemShawn Rutledge2019-05-242-49/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When reading a document like # heading - list item and then re-writing it, it turned into # heading - # list item because QTextCursor::insertList() simply calls QTextCursor::insertBlock(), thus inheriting block format from the previous block, without an opportunity to explicitly define the block format. So be more consistent: use QTextMarkdownImporter::insertBlock() for blocks inside list items too. Now it fully defines blockFormat first, then inserts the block, and then adds it to the current list only when the "paragraph" is actually the list item's text (but not when it's a continuation paragraph). Also, be prepared for applying and removing block markers to arbitrary blocks, just in case (they might be useful for block quotes, for example). Change-Id: I391820af9b65e75abce12abab45d2477c49c86ac Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Support clicking to toggle checkboxes in QTextEditShawn Rutledge2019-05-242-0/+32
| | | | | | | | | | | | | | | | | | | Add QAbstractTextDocumentLayout::markerAt(pos) for hit testing. (Qt Quick TextEdit needs it too.) Finds out whether the position corresponds to a marker on a paragraph. I.e. it finds checkboxes in GitHub-flavored markdown. This enables editor classes to toggle checkboxes by clicking them. Use it in QTextEdit to add the checkbox toggling feature. Also show the "pointing finger" cursor when hovering a toggleable checkbox. Change-Id: I036c967ab45e14c836272eac2cc7c7d652543c89 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* QTextDocumentLayout: Avoid table border drawing artifactsNils Jeisecke2017-09-071-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As borders are always painted for single cells any rounding errors that occur when mapping from fixed point numbers to integers during raster painting will cause ugly drawing artifacts like extra pixels between cells or borders that overlap. To avoid this the following values are being rounded: - table offset - column positions and widths - row positions and cell heights For the column positions and widths the distribution constraints (total table width) are respected. Task-number: QTBUG-43589 Change-Id: I6308c113f8f9be3db8e9267629f26b5d65d2d7c7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix gui build without feature.regularexpressionTasuku Suzuki2019-05-224-3/+28
| | | | | | | | | | | Change-Id: Id27fc81af8d2b0355b186540f41d75a9c8d7c7f3 Reviewed-by: David Faure <david.faure@kdab.com>
* Merge remote-tracking branch 'origin/5.13' into devFriedemann Kleint2019-05-277-162/+128
|\ | | | | | | Change-Id: Ia279fc4a8226626041c772902a07b2f90f37b53b
| * Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-05-274-158/+122
| |\ | | | | | | | | | Change-Id: Iaf6bd52972b562b9c91d9e93a988d26b0eb9d3b4
| | * Write an anchor-type attribute when embedding images in an ODF documentAndrew den Exter2019-05-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Without this some readers will fail to display the image or position the image at the start of a paragraph rather than inline. Change-Id: I2b9257e3193e5e68eb20112017a0c23be1d06cb0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Avoid re-encoding embedded images when writing an ODF fileAndrew den Exter2019-05-131-19/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | If an embedded image is already encodeded as an png or jpg write the data as is instead of decoding to a QImage and re-encoding as a new image. Change-Id: I479ae1fddbf59900a500497dd1bdf7449c21f273 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * QHighDpi: Remove fromNativePixels()/toNativePixels() overloadsMorten Johan Sørvig2019-05-221-116/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace QWindow / QScreen / QPlatformScreen overloads with template functions that take a generic context argument. The API now no longer supports implicit conversions from QPointer<QWindow> to QWindow *, add explicit data() call to usage in qxcbdrag.cpp. Change-Id: I63d7f16f6356873280df58f4e7c924bf0b0eca5b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * QPA: Prevent QPlatformWindow::initialGeometry() from returning invalid ↵Friedemann Kleint2019-05-221-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | geometries When trying to find the screen, the function would always try to determine the screen by checking parents, despite QWindowPrivate::positionAutomatic being false. Determine the screen from the initial geometry when QWindowPrivate::positionAutomatic is false. Bail out when positionAutomatic and resizeAutomatic are false. Fixes: QTBUG-75940 Change-Id: I3cd1b16feab16c89d29856cf3e1bccf2c89280c7 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
| | * QHighDpi: Simplify top-level window handling codeMorten Johan Sørvig2019-05-142-40/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce origin(QWindow *), which returns the point around which coordinates should be scaled: the screen origin for top-level windows, and (0, 0) for child windows. The code paths for top-level and child windows can then be combined. Change-Id: I6b9cdbd9e7c2d9406e9137e325c4eb5c79e3ac9a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * | doc: improve QStandardItemModel code snippetSamuel Gaist2019-05-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The snippet currently uses hard coded values for looping which is not good practice. This patch fixes this using rowCount and columnCount. Change-Id: Ie532649353f757843426a18e9a50b86a2278f7a5 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-162-2/+4
| |\| | | | | | | | | | Change-Id: I1bdc28a3ae825ea35e83f20fe16d2409515e5a3d
| | * QMenu: show shortcuts in context menus by defaultRichard Moe Gustavsen2019-05-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change c2c3452ba introduced a new API in Qt to let QPA inform whether or not shortcuts should be shown in context menus. This was set to false by default, since by observation, this seemed to be the most common behavior across platforms. The problem is that it left no way for the application to override it; The attribute Qt::AA_DontShowShortcutsInContextMenus simply doesn't work when shortcuts are always off. And for some application, showing shortcuts is not just a matter of look-and-feel, but also important information to be able to use the application the way intended. This patch reverts the behavior back to how it was in Qt-5.9, where shortcuts where shown by default (except on macOS where we still keep them off). It's no so much because the "always off" logic is wrong, but because there is no (easy) way/work-around for an app developer to switch them back on (until Qt-5.13, where a new API is introduced to fix the situation: b1a9a77). And this lack of API can be a show-stopper for some when upgrading from e.g 5.9 LTS to 5.12 LTS. This downside of this patch, OTOH, is that it can cause more change that what is normally wanted in a patch release. But out of two evils, this is the best option. Those that wan't to hide shortcuts can set AA_DontShowShortcutsInContextMenus to true, which now will work. [ChangeLog][QtWidgets][QMenu] Shortcuts are again shown by default in context menus, except on macOS. They can be forced off by setting AA_DontShowShortcutsInContextMenus to true. Fixes: QTBUG-69452 Change-Id: Ibcc371395944ac5b19b1d20889940da271bf73d5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| | * Fix QRasterBuffer::scanLine miscalculation with big imagesJoni Poikelin2019-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scanLine is overflowing with big images. Similar change was made in 4f88475a962975ca45994cff9add350344fce4f9 to fix the same issue with QImage::scanLine. Fixes: QTBUG-75082 Change-Id: Ifedf28fa9a303c189dfcd12bd4ec11f438540c2e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Add documentation for the QTextBlockFormat::marker propertyShawn Rutledge2019-05-231-0/+44
| | | | | | | | | | | | | | | | | | | | | Amends 65314b6ce88cdbb28a22be0cab9856ec9bc9604b. Change-Id: I8f69030accb948055b0081f8a4f1daafbac824ce Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Fix font matching of typographic families on WindowsEskil Abrahamsen Blomfeldt2019-05-233-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9204b8c31ea1b5f0c05870c5b5d74c33b1a4f622 broke font matching on Windows. This was then attempted fixed by bcd2fa484a4fe93e77743195d7f72cce9e580d43, but this caused an infinite recursion for some cases, so it was reverted again by 9d1905da9c59e9062a157199c81c076efc20eb28. The original issue was that if we populate a specific face of a family, such as "Arial Black", then the typographic/preferred name will be detected as "Arial" and this family will be set as populated=true, even though we have not yet registered any additional subfamilies. In this case, we need to call populateFamily() for the typographic family name to ensure we get Windows to enumerate all the subfamilies in that family before it sets it as populated=true. But this broke for some fonts where the font naming was unconventional. In particular, "Yu Gothic" would have its Japanese name as the typographic name, and there would be no font in the system where the old-style font family name matched the typographic name. In that case we would go into a loop where we would try populating "<Japanese font name>", Windows would translate this to "Yu Gothic", we would translate it back to "<Japanese font name>", ad infinitum. In order to avoid the infinite recursion, we add a recursion guard as well, ensuring that we never call populateFamily() for the main family we are currently populating. [ChangeLog][Windows][Fonts] Fixed a bug where it would be impossible to request different faces of a font family after a specific type face has been in use. Task-number: QTBUG-74748 Task-number: QTBUG-74983 Change-Id: Ibe6239f67c45d67ebf75947c8f231cfa177e347f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Fix qdoc warnings for Qt 5.14Friedemann Kleint2019-05-214-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/corelib/tools/qstring.cpp:9505:clang found diagnostics parsing \fn int QLatin1String::indexOf(QLatin1String l1, int from Qt::CaseSensitivity cs) const error: expected ')' error: out-of-line definition of 'indexOf' does not match any declaration in 'QLatin1String' src/corelib/tools/qstringview.cpp:723:clang found diagnostics parsing \fn qsizetype QStringView::indexOf(QLatin1String l1, qsizetype from Qt::CaseSensitivity cs) const error: expected ')' error: out-of-line definition of 'indexOf' does not match any declaration in 'QStringView' src/corelib/tools/qstringview.cpp:822:Unknown command '\t' src/corelib/tools/qstringview.cpp:825:Unknown command '\t' src/corelib/tools/qstringview.cpp:826:Unknown command '\t' src/corelib/tools/qstringview.cpp:831:Unknown command '\t' src/corelib/global/qnamespace.qdoc:2448:Undocumented enum item 'MarkdownText' in Qt::TextFormat src/corelib/tools/qstringmatcher.cpp:183:No such parameter 'pattern' in QStringMatcher::QStringMatcher() src/network/ssl/qsslerror.cpp:58:Undocumented enum item 'CertificateStatusUnknown' in QSslError::SslError src/gui/kernel/qevent.cpp:5321:Undocumented parameter 'screenOrientation' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/kernel/qevent.cpp:5321:Undocumented parameter 'screen' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/kernel/qevent.cpp:5321:No such parameter 'orientation' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockCodeLanguage' in QTextFormat::Property src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockQuoteLevel' in QTextFormat::Property src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockMarker' in QTextFormat::Property src/gui/text/qtextdocument.cpp:3294:Undocumented parameter 'features' in QTextDocument::toMarkdown() src/gui/painting/qcolorspace.cpp:659:Undocumented parameter 'colorSpace1' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:Undocumented parameter 'colorSpace2' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:No such parameter 'colorspace1' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:No such parameter 'colorspace2' in QColorSpace::operator!=() examples/widgets/doc/src/icons.qdoc:269:Command '\snippet (//! [43])' failed at end of file 'widgets/icons/iconpreviewarea.cpp' src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogRetryButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogYesToAllButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogIgnoreButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogNoToAllButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogAbortButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_RestoreDefaultsButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogSaveAllButton' in QStyle::StandardPixmap src/testlib/qtestcase.qdoc:439:Undocumented parameter 'TestClass' in QTest::QTEST_HIGHDPI_SCALING_MAIN src/testlib/qtestcase.qdoc:452:Undocumented parameter 'TestClass' in QTest::QTEST_NO_HIGHDPI_SCALING_MAIN Change-Id: Ib0e9bf81c5caaa6b1fc644ac92085af47c600e0e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | QtGui: get rid of the last Java-style iteratorMarc Mutz2019-05-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trivial. Java-style iterators are going to be deprecated. Change-Id: Ie94658be988cc095fb3b05d0d4ef6e7e3bf9a2af Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | QPainterPath: convert manual memory management to std::unique_ptrGiuseppe D'Angelo2019-05-142-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | And default the destructor, now that it's empty. Change-Id: I868d4fa04f8e82bc35f2364073d07fa47659b89c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QPainterPathPrivate: code tidiesGiuseppe D'Angelo2019-05-141-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Honor the RO3, doing copies of the members where it belongs (and not in its subclass), and properly handling the refcounting by disabling the copy assignment * Clean up construction of QPainterPathData by using ctor-init-lists, getting rid of a warning because the base class copy constructor wasn't being called by the subclass' copy constructor. * Mark everything for cleanup in Qt 6. Change-Id: I143a322dc816e2e12b454a9e5ffe63f1a86009a5 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | rtems: Disable features which RTEMS does not supportMikhail Svetkin2019-05-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | build: - shared - use_gold_linker - large file support QtCore: - systemsaphore - process - processenvironment QtGui: - clipboard - multiprocess Change-Id: I641b37d0b603bbe6f0a839019f458f8138c73d34 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | QFileDialog: mark obsolete enum DontUseSheet as deprecatedChristian Ehrlicher2019-05-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFileDialog::DontUseSheet is obsolete since 4.5 and not used anywhere inside the Qt code base. Mark it as deprecated and remove the last usage in the examples. Change-Id: If3d23fd5906314e6ebc7080efa79da14a2aa2720 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | QtCore: mark obsolete enumerations as deprecatedChristian Ehrlicher2019-05-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following enumerations were obsolete for a log time but not marked as deprecated: - WA_NoBackground - WA_MacNoClickThrough - WA_MacBrushedMetal - WA_MacMetalStyle - WA_MSWindowsUseDirect3D - WA_MacFrameworkScaled - AA_MSWindowsUseDirect3DByDefault - AA_X11InitThreads - ImMicroFocus mark them as deprecated and remove the usage inside QtBase so they can be removed with Qt6 Change-Id: Ia087a7e1d0ff1945286895be6425a6cceaa483fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | Fix race in colorspace LUT generationAllan Sandfeld Jensen2019-05-163-10/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code did not prevent concurrent writes to the LUTs by separate threads, each finding lutsGenerated to be false. Let's consider whether the change is safe now: the storeRelease(1) comes before the QMutex::unlock(), but since it is release semantics no writes may be ordered past it. We have two releases, and their order doesn't matter, since nothing else happens in-between. Could we use a normal relaxed store? No, because the unlock() of the mutex only synchronizes with the lock() of the same mutex, which doesn't happen if the loadAcquire() succeeds. For loadAcquire() to happen-before a write to the luts, we need a storeRelease() on the atomic. So, everything is correct, and minimal. But maybe, to save the next reader from having to do the same mental exercise again, add a manual locker.unlock() in front of the storeRelease()? Again no: that opens a gap where the luts are already generated on T0, and the mutex unlocked, but the atomic not set. If another thread T1 gets to execute the function, it will enter the critical section, then writing new values to the LUT. Meanwhile, the T0 sets generate to true and a T2 enters the function, sees the final write from T0 and starts using the luts -> data race with the writes concurrently done by T1. Change-Id: Id278812a74b6e326e3ddf0dbcbb94b34766aa52e Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Liang Qi2019-05-155-4/+74
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-155-4/+74
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qfloat16.cpp src/corelib/global/qfloat16.h src/plugins/platforms/windows/qwindowswindow.cpp Change-Id: I0938aaa6a9771f55e48c95ed29f6f5291431b947
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-05-144-4/+56
| | |\| | | | | | | | | | | | | Change-Id: Id3d16035c9692af42e9c1bf512218f3c836ae2eb
| | | * Fix QWindow::mapToGlobal()/mapFromGlobal() for multi-screen windowsMorten Johan Sørvig2019-05-134-4/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make these functions handle the case where a window spans multiple screens, and high-DPI scaling is enabled, and the local position (in the window) is not on the window primary screen (as returned by QWindow::screen()). This is done by detecting the case, and then calculating the correct position using the native coordinate system. [ChangeLog][QtGui] QWindow::mapToGlobal()/mapFromGlobal() now handle windows spanning screens correctly. Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io> Task-number: QTBUG-73231 Change-Id: I3c31b741344d9e85e4f5d9e60bae75acce2db741 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-121-0/+18
| | |\| | | | | | | | | | | | | Change-Id: I0c00ffe0eabebc919f22d6faa4bf958b288e8fd9
| | | * Add unvectorized fallback in case FP exceptions are not maskedAllan Sandfeld Jensen2019-05-101-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an application enables FP exceptions our FP-based unpremul will raise the INVALID exception. Since disabling them locally might be slow just take a slow path when detected. Fixes: QTBUG-75592 Change-Id: Ie22a032a4f62229f68ad21ede359c62291adc9bf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | QFontMetricsF: add noexceptGiuseppe D'Angelo2019-05-151-2/+2
|/ / / | | | | | | | | | | | | | | | Change-Id: I0b32ff72f22c4014441a86c135927e52ddc999cd Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QFontEngine: replace QLinkedList with std::listMarc Mutz2019-05-142-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The object is never copied, so there's no point in using a cow'ed list implementation. Also port two explicit-iterator loops to ranged-for, as one is necessary (because of constBegin()) and the other is for consistency. Change-Id: Ia7f080060d6b675a76b55d197af08161389082a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QPainterPath: amend a commentGiuseppe D'Angelo2019-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Casting towards more derived classes is "downcasting", not "upcasting". Change-Id: I1373a073ba81fb2c2b77c35ac1916a53ce30b86c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Clean up qtriangulator_p.hMarc Mutz2019-05-141-24/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the bogus default constructor and copy special member function of the structs there. They just disable move semantics and the compiler will be happy to generate them for you when you let it. These classes are all pure inline, so remove the export macros. Last, not least, remove the broken assignment operator of QVertexIndexVector. The copy constructor was implicitly declared, so was doing something completely different (the correct thing, I might argue), while the hand-rolled, useless op= checked this->t to check which of the vectors to copy (instead of checking other.t, which it later copies). Change-Id: I696f01602e02c0ddb2e5348ec85fd2a622544226 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QGradient: de-inline dtorMarc Mutz2019-05-142-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | As exported classes, their dtors should be out-of-line, lest we can never add something to them afterwards. Change-Id: I706281ca3fb285f9f00152f2e3fb34795699d69f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-1315-83/+79
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-097-72/+68
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qlocale_data_p.h (Regenerated by running the scripts in util/local_database/) src/gui/opengl/qopengltextureuploader.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
| | * Fix possible endless loop when stroking curvesEirik Aavitsland2019-05-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bezier shifting algorithm compared coordinates exactly, and so could end up in an endless loop when values were at the edge of the number resolution. Fix by using fuzzy comparison instead. Fixes: QTBUG-75522 Change-Id: I61346edbd87389f66965a906ac337fc1f5300e5c Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * Fix swizzling when rendering QPainter on QOpenGLWidget with AngleDmitry Kazakov2019-05-071-13/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenGLES specification does not support GL_TEXTURE_SWIZZLE_RGBA, it supports only per-channel calls. And since Qt supports QpenGLES, it should use the latter approach only. The regression was introduced in Qt 5.12 by commit ede3791df8330ed8daae6667d025ad40219a9f5f Task-number: QTBUG-74968 Change-Id: I9c531b248715992fb30df6af95dfa605e2ee2a25 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * Fix QTextEngine::shapeText casing of surrogate pairsJüri Valdmann2019-05-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The high part was not copied to output. Fixes: QTBUG-75559 Change-Id: I9350e52d256510f52b3fcc0015bf879d2c609532 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| | * Use "monospace" as fallback system FixedFont in KDE theme; loggingShawn Rutledge2019-05-071-32/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also de-duplicate the "monospace" string in qgenericunixthemes.cpp, and add tst_QFontDatabase::systemFixedFont() to verify that QFontDatabase::systemFont(QFontDatabase::FixedFont) really returns a monospace font across platforms. Replace commented-out qDebug()s with qt.text.font.match and qt.text.font.db logging categories to troubleshoot when the test fails (among other uses). Add qt.qpa.fonts logging category to unix themes to show default system and fixed fonts (font engines on other platforms are already using this category). Fixes: QTBUG-54623 Change-Id: I2aa62b8c783d9ddb591a5e06e8df85c4af5bcb0c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * Document how to use CMake on Qt Core, Qt GUI's central pagesKai Koehne2019-05-073-21/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add documentation on how to use a module from CMake, alongside the existing documentation about qmake. Separate generic info from module-specific examples, to make it possible to use one include file in all modules. While at it, also remove the mentioning of the central include; it is not something we should actively advocate anymore. Instead, the documentation of every class gives the correct include to use. Task-number: QTBUG-73058 Change-Id: I6b3c0e5ea218dd9c06a491c8fb799a7fcf42dd92 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| * | Doc: replace even more null/0/nullptr with \nullptr macroChristian Ehrlicher2019-05-088-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | Try to replace all wordings like '.. to 0' with '.. to \nullptr'. Also checked for 'null pointer' and similar. Change-Id: I73341f59ba51e0798e816a8b1a532c7c7374b74a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Markdown: blockquotes, code blocks, and generalized nestingShawn Rutledge2019-05-086-42/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Can now detect nested quotes and code blocks inside quotes, and can rewrite the markdown too. QTextHtmlParser sets hard-coded left and right margins, so we need to do the same to be able to read HTML and write markdown, or vice-versa, and to ensure that all views (QTextEdit, QTextBrowser, QML Text etc.) will render it with margins. But now we add a semantic memory too: BlockQuoteLevel is similar to HeadingLevel, which was added in 310daae53926628f80c08e4415b94b90ad525c8f to preserve H1..H6 heading levels, because detecting it via font size didn't make sense in QTextMarkdownWriter. Likewise detecting quote level by its margins didn't make sense; markdown supports nesting quotes; and indenting nested quotes via 40 pixels may be a bit too much, so we should consider it subject to change (and perhaps be able to change it via CSS later on). Since we're adding BlockQuoteLevel and depending on it in QTextMarkdownWriter, it's necessary to set it in QTextHtmlParser to enable HTML->markdown conversion. (But so far, nested blockquotes in HTML are not supported.) Quotes (and nested quotes) can contain indented code blocks, but it seems the reverse is not true (according to https://spec.commonmark.org/0.29/#example-201 ) Quotes can contain fenced code blocks. Quotes can contain lists. Nested lists can be interrupted with nested code blocks and nested quotes. So far the writer assumes all code blocks are the indented type. It will be necessary to add another attribute to remember whether the code block is indented or fenced (assuming that's necessary). Fenced code blocks would work better for writing inside block quotes and list items because the fence is less ambiguous than the indent. Postponing cursor->insertBlock() as long as possible helps with nesting. cursor->insertBlock() needs to be done "just in time" before inserting text that will go in the block. The block and char formats aren't necessarily known until that time. When a nested block (such as a nested quote) ends, the context reverts to the previous block format, which then needs to be re-determined and set before we insert text into the outer block; but if no text will be inserted, no new block is necessary. But we can't use QTextBlockFormat itself as storage, because for some reason bullets become very "sticky" and it becomes impossible to have plain continuation paragraphs inside list items: they all get bullets. Somehow QTextBlockFormat remembers, if we copy it. But we can create a new one each time and it's OK. Change-Id: Icd0529eb90d2b6a3cb57f0104bf78a7be81ede52 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | Change QTextMarkdownWriter to pass by const pointer and QAIMShawn Rutledge2019-05-084-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | - QObjects are always passed by pointer not by reference, by convention - writeTable() takes QAIM rather than QATM to make testing via QStandardItemModel possible in the future Change-Id: I5bc6b8cd9709da4fb5d57d98fa22e0cb34360944 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | Markdown: deal with horizontal rules (thematic breaks)Shawn Rutledge2019-05-082-1/+5
| | | | | | | | | | | | | | | Change-Id: I14d4bcfe1a6c3bd87d1328f0abb81b2138545e4e Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | Markdown: fix several issues with lists and continuationsShawn Rutledge2019-05-084-27/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Importer fixes: - the first list item after a heading doesn't keep the heading font - the first text fragment after a bullet is the bullet text, not a separate paragraph - detect continuation lines and append to the list item text - detect continuation paragraphs and indent them properly - indent nested list items properly - add a test for QTextMarkdownImporter Writer fixes: - after bullet items, continuation lines and paragraphs are indented - indentation of continuations isn't affected by checkboxes - add extra newlines between list items in "loose" lists - avoid writing triple newlines - enhance the test for QTextMarkdownWriter Change-Id: Ib1dda514832f6dc0cdad177aa9a423a7038ac8c6 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | Remove 3rdparty include from QTextMarkdownImporter header fileShawn Rutledge2019-05-082-47/+47
| | | | | | | | | | | | | | | | | | | | | | | | It's a private header; but to be able to use it in a test, it has to be as clean as a public header. Change-Id: I868372406e62acc24051a6523fee89bb911a61f9 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | Deprecate conversion functions between QList and QSetLars Knoll2019-05-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users should use range constructors instead to do the conversion. Keep conversion methods between QList and QVector as these will turn into a no-op in Qt 6, whereas forcing people to use range constructors would lead to deep copies of the data. Change-Id: Id9fc9e4d007044e019826da523e8418857c91283 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>