summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-06-06398-8463/+11687
|\ | | | | | | Change-Id: Iac12a37fa6536ebe30e6548f7c54ec0c402c9f5d
| * QGestureManager: clean up cleanupCachedGestures()Marc Mutz2019-06-041-22/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - use logarithmic QMap::find() instead of iterate-and-compare-with-key (linear) - don't convert a QList to a QSet just to use QSet -=, just iterate over QSet::remove(): QSet::subtract() doesn't do anything more fancy, either (saves memory allocations) - replace Q_FOREACH with ranged-for, avoid copies Change-Id: I451f034767b079efa9ee19e2c1fe7dc4af2d9bea Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * QSharedNetworkSessionManager: clean upMarc Mutz2019-05-282-23/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under no circumstance must Qt code define a non-public qHash() overload of a public Qt type. If you can't provide a public qHash() for the type, you can't use QHash. Period. This is because if we don't provide a qHash() function, the user will have to provide one, and then we have an ODR violation, iow: UB. So, port away from QHash and qHash and use std::unordered_map, which allows to pass a custom hash function - just what we needed. Also fix other issues of the code: - Use a function object as the deleter of the QSharedPointer, to allow inlining the function call. - Avoid double lookup in case of a cache miss. - Don't use direct initialization syntax for pointer variables. That's just ... weird. Change-Id: Ica8bff728c1bd1cbb2fb43aa03a99bcb7ac2f7cc Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * QFile: fix coding style violationMarc Mutz2019-06-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amends dd8131e3b25a4ac60eb55022b69b374f0b9a476c. Change-Id: Ic7d440816ee7bada49740f15919e404860dd8ac7 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * Fix definition of QT_DEPRECATED_SINCEKai Koehne2019-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Otherwise any use of QT_DEPRECATED_SINCE will cause a warning: src/corelib/global/qglobal.h:382:77: error: expected unqualified-id before ‘)’ token This amends 220028d37c Change-Id: Ifa2be1dd8852e4aac0db83b0b4ae15d2f666c550 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
| * QLatin1String, QStringView: add containsAnton Kudryavtsev2019-06-044-5/+96
| | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QLatin1String] Added contains(). [ChangeLog][QtCore][QStringView] Added contains(). Change-Id: I19fd2e155180edd8620c520f4e60a1f86f0603ac Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Deprecate use of QTime as a timerEdward Welbourne2019-05-242-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | QElapsedTimer does the job better and without the DST kludges. Change-Id: Ic4a566f695648cbe069a21ea8d3e84562b665a3c Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Convert some deprecations to QT_DEPRECATED_XEdward Welbourne2019-05-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | To make their replacements easier to find. They're in the documentation, but weren't in the source. Change-Id: Iea936062feaead636e3dd8e93f0b4c82ed8876cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Convert the one extant use of QTime as a timer to use a local classEdward Welbourne2019-05-241-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | Use QDateTime::currentMSecsSinceEpoch() instead of a QTime with funky wrapping at midnight and potential DST glitches. Change-Id: I2455db5778635fc00b4ffdef6edee6d6793e50eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Regenerate Windows Time Zone ID tableEdward Welbourne2019-05-281-999/+1102
| | | | | | | | | | | | | | | | | | | | | | | | | | Re-ran util/locale_database/cldr2qtimezone.py to add new zones to the table. Change-Id: I70258a9abbe9815494291deff528f3c18703de40 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Move container block-size calculations to qarraydata.cppEdward Welbourne2019-05-293-104/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These were in qbytearray.cpp, which doesn't use them, is big and I intend to move it to a different directory than the header, qtools_p.h, that declares them. So move them to a small file that does use them. Change-Id: I5a4684f8c7628e617546019cc3f01d92d829f085 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Construct from an array instead of assigning just past a string's endEdward Welbourne2019-05-281-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assigning past the end used to be supported, but isn't a good way to do the job. Exposed by a qtxmlpatterns test that exercised this code, which gets a warning thanks to Giuseppe's recent changes to QCharRef. Task-number: QTBUG-76070 Change-Id: Ic254c7ffce60e3b2aafce76ab03ea5db8c68fafc Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * rtems: Fix pcre2 build (madvise undefined)Mikhail Svetkin2019-04-302-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RTEMS does not have madvise. We can use only posix_madvise Change-Id: Ia18b7cd2d7f9db84331f7e2350d060b9e85b30c8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * Markdown and HTML: support image alt text and titleShawn Rutledge2019-06-019-12/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a required CommonMark feature: https://spec.commonmark.org/0.29/#images and alt text is also required in HTML: https://www.w3.org/wiki/Html/Elements/img#Requirements_for_providing_text_to_act_as_an_alternative_for_images Now we are able to read these attributes from either html or markdown and rewrite either an html or markdown document that preserves them. This patch does not add viewing or editing support in QTextEdit etc. Change-Id: I51307389f8f9fc00809808390e583a83111a7b33 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * QGraphicsWidget: overload two margins-setters with actual QMarginsF overloadsMarc Mutz2019-05-274-60/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace manual memory management with unique_ptr and manual re-implementations of QMarginsF with The Real Thing™. The only noticeable difference should be that the checks for 0 now use qFuzzyCompare() (by way of QMarginsF::isNull() and its operator==). [ChangeLog][QtWidgets][QGraphicsWidget] Added QMarginsF overloads of setContentsMargins() and setWindowFrameMargins(). Change-Id: I6b3bb87015fa52fdde245b7528cca4b8f9ce41e1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * QTextBrowser: detect and load markdown rather than assuming HTMLShawn Rutledge2019-05-303-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So we add the QTextDocument::ResourceType::MarkdownResource enum value to indicate the type. QMimeDatabase is generally unable to detect markdown by "magic", so we need to use the common file extensions to detect it (the same extensions as declared in the mime database XML). Change-Id: Ib71f03abd535c17e5a8c99bd92d0a6062e972837 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * QEventDispatcherWin32: rework sending of posted eventsAlex Trotsenko2019-05-252-70/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since its initial implementation, QEventDispatcherWin32 manages a delivery of the posted events from the window procedure through WM_QT_SENDPOSTEDEVENTS message. That makes the implementation quite difficult and unclear. As a result, posted events get stalled, in case of using nested event loops or other recursion. The proposed solution is to send posted events at the beginning of processEvents() only once per iteration of the event loop. However, in case of using a foreign event loop (e.g. by opening a native modal dialog), we should leave the emission in the window procedure, as we don't control its execution. Task-number: QTBUG-74564 Change-Id: Ib7ce85b65405af6124823dda1451d1370aed9b1a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * QtCore: use qUtf16Printable and %ls, qErrnoWarning()Marc Mutz2019-05-298-25/+23
| | | | | | | | | | | | | | | | | | | | | | | | ... instead of qPrintable(), %s, and explicit qt_error_string(). Saves 2KiB in text size on optimized Linux AMD64 GCC 9.1 builds. Change-Id: I98b6717da1ed1b678f01167d704a96f10da47966 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * corelib/tools: use qUtf16Printable() and %lsMarc Mutz2019-05-294-9/+9
| | | | | | | | | | | | | | | | | | | | ... instead of qPrintable() and %s. Saves temporary QByteArray creation. Change-Id: Idd46c99a5da731e29c6d237dc914e256ac7b3fbd Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QDateTimeParser: use qUtf16Printable() and %lsMarc Mutz2019-05-291-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | ... instead of qPrintable() and %s. Avoids temporary QByteArrays. Saves 1.2KiB in text size on optimized Linux AMD64 GCC 9.1 builds. Change-Id: Ie626fc478667007ce9a6bc920b8d4ec0451f2cd0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * corelib/io: use qUtf16Printable(), %ls, qErrnoWarning()Marc Mutz2019-05-296-34/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | ... instead of qPrintable(), %s, explicit qt_error_string(). Saves temporary QByteArray creation, and 540b in text size on optimized Linux AMD64 GCC 9.1 builds. Change-Id: Id4e861683cf05a92faf51e4a9de9eb1dec4fc84a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QWindowsFileSystemWatcher: optimize qWarning() useMarc Mutz2019-05-291-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first two changes avoid creation of a temporary QString and QByteArray each, by realisiing that QChar is more-or-less wchar_t on Windows and so we can just use %ls to print the wchar_t array directly. In msgFindNextFailed(), remove the inline keyword and mark the function as cold (not sure this has any effect on Windows). When building the result, don't use QTextStream. Everything that is streamed is text, so just use QString::op+=. When using the result, use qUtf16Printable and %ls instead of qPrintable and %s, to avoid the creation of a temporary QByteArray. Change-Id: I09f576b894761fe342109b386c1de3532200e03c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QPropertyAnimation: share some codeMarc Mutz2019-05-301-5/+10
| | | | | | | | | | | | | | | | | | | | | | Collapse the two qWarnings() into one by just storing what is different between them. Saves more than 400b in text size on optimized AMD64 Linux GCC 9.1 builds. Change-Id: I16489d6165a550a9ad4ce6a77ca736a1d17a8c8a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * Use QStringView overloads of <QDate/Time>::toString()Marc Mutz2019-05-293-4/+4
| | | | | | | | | | | | | | | | | | | | | | There are no QLatin1String overloads, so using QLatin1String as the format string produced a temporary QString. Use QStringViewLiteral instead. Change-Id: I682eb8cfaa98fdcfb491edd290460db636a98a9f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * QFile: share some codeMarc Mutz2019-05-301-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | Pack four qWarning() calls into a separate cold function. Use qUtf16Printable(). Saves >600b in text size on optimized AMD64 Linux GCC 9.1 builds. Change-Id: Ib25ea473d1d77faaecaf8750726c83675d87279e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * Improve qHash(QFont)Marc Mutz2019-05-271-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the families member was added to QFontDef, it was included in op== and qHash(), however the seed was passed to two qHash() calls for subobjects. With xor used as the combiner, it could happen that the seed was xored out (e.g. on empty strings), leaving a slight opening for prediciable hash values. Fix by using QtPrivate::QHashCombine, which handles the seed in such a way as to avoid the issue. Change-Id: I8a3e4c2f368306446554249763695158df5ac634 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Add attribute to disable QSessionManagerDavid Edmundson2019-03-013-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Loading a session manager can be problemtatic for system services that are always auto-activated or small DBus activated helpers which shouldn't really be restored nor gain anything from a session. The current solutions is to connect to commitDataRequest and saveStateRequest and then reset a restart hint. It's very unintuitive and somewhat wasteful given the X session manager is full of slow blocking calls. Rather than changing the behavior of QGuiApplication and handling null pointers, this patch loads the base QPlatformSessionManager that is used by QPAs that don't have a session manager. Change-Id: I976521d551549e2d56076e968c6be5421e4a9c20 Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * Fix build without feature.labelTasuku Suzuki2019-05-262-3/+6
| | | | | | | | | | Change-Id: Ibe4d31d441ff691c4b354dde546e403653564ba4 Reviewed-by: David Faure <david.faure@kdab.com>
| * QCommandLineParser: add --help-all, to show Qt options as wellDavid Faure2019-05-156-14/+96
| | | | | | | | | | | | | | | | | | | | | | Sample output at http://www.kdab.com/~dfaure/2019/help-all-example.txt Fixes: QTBUG-41802 Change-Id: I7a3350200761d41481fcb10ec4328e96e548d246 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Fix gui build without feature.highdpiscalingTasuku Suzuki2019-05-261-0/+2
| | | | | | | | | | | | Change-Id: Ic206cb6fa1b9fae1db9923ef6596852e93b3cbe5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * Windows QPA: Replace Q_DISABLE_COPY by Q_DISABLE_COPY_MOVEFriedemann Kleint2019-05-2444-46/+46
| | | | | | | | | | | | | | | | | | | | | | Fix clang warnings like: warning: class 'QWindowsStaticOpenGLContext' defines a default destructor, a copy constructor and a copy assignment operator but does not define a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions Change-Id: I736d20476ef407100b6ecb654d1112106e545758 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * Windows QPA: Use nullptr consistentlyFriedemann Kleint2019-05-2813-32/+32
| | | | | | | | | | | | | | | | | | Change-Id: I09297e34bd62359e31c483199ade1d7a0baf7195 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * QSharedPointer: Fix build error for cross-built toolsFriedemann Kleint2019-05-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Guard friend declaration within QT_NO_QOBJECT. Amends 28ce318fcbccb5a117ca4e55322ee1c1dd8d05d4. Fixes: QTBUG-76056 Change-Id: I14fbe5457c16e8a366fecdc0a356b68b8609848b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * QAccessibleWidgets: re-enable NRVO in childWidgets()Marc Mutz2019-05-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | ... for poor compilers such as GCC. Change-Id: Ifcf603657ff6242599972c21b135d7b6a0af4c35 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * QStyleSheetStyle: do not bypass the base class' overridesGiuseppe D'Angelo2019-05-281-2/+2
| | | | | | | | | | | | | | | | | | Change-Id: Iae8e24dd6c511071724fde62277ea5054b9c5253 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
| * qhashfunctions.h: add specializations of std::hash for some Qt typesMarc Mutz2019-05-291-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a problem. Our types don't play well with the std unordered containers, because they do not specialize std::hash. We therefore force our users to come up with an implementation, hindering interoperability, since any two developers are unlikely to come up with compatible implementations. So combining libraries written by different developers will result in ODR violations. Now that we depend on C++11, and thus the presence of std::hash, we still face the problem that the standard does not provide us with a means to compose new hash functions out of old ones. In particular, we cannot, yet, depend on C++17's std::hash<std::string_view> to implement std::hash<QByteArray>, say. There's also no std::hash for std::tuple, which would allow easy composition by using std::tie(). So piggy-back on the work we have done over the years on qHash() functions, and implement the std::hash specializations for Qt types using the existing qHash() functions, with a twist: The standard allows implementations to provide means against predictable hash values. Qt has this, too, but the seed is managed by the container and passed to the qHash() function as a separate argument. The standard does not have this explicit seed, so any protection must be implicit in the normal use of std::hash. To reap whatever protection that std library has on offer, if any, we calculate a seed value by hashing int(0). This will be subject to constant folding if there's no actual seed, but will produce a value dependent on the seed if there is one. Add some tests. A question that remains is how to document the specialization. Can we have a \stdhashable QDoc macro that does everything for us? Task-number: QTBUG-33428 Change-Id: Idfe775f1661f8489587353c4b148d76611ac76f3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * qobject_p.h: Const-correctness fixKevin Funk2019-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: This function is being called inside GammaRay Change-Id: I4260d2b720d87eec829758cf3b86bc0593d964f2 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Use QtPrivate::QHashCombine in qHash(QSslError)Marc Mutz2019-05-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's the same operations as boost::hash_combine, but without explicit magic numbers. Change-Id: Id65b6f6b7be3070e4ec349ed0cc062af473a95b3 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * qtreeview.h: Fix minor typoKevin Funk2019-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I62d494c0bd784ef14a7b7c1cb3b005a7529ba43e Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
| * QtWidgets: eradicate some indexed loops [needing qAsConst()]Marc Mutz2019-05-292-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(). Change-Id: I9b5c23c723be024b314a7ad873e21ad63b44b348 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * Make QCoreApplicationPrivate's destructor virtual in bootstrapped buildsGiuseppe D'Angelo2019-05-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a bootstrapped build QCAP does not inherit from QObjectPrivate, meaning it won't get a polymorphic destructor, causing compile errors. This is necessary in preparation to add virtuals to QCAP. The "virtual" keyword is protected to avoid further warnings by compilers or linters telling that it's unnecessary because the base class' dtor is already virtual. Change-Id: Ifbd218154f74b4f1d2f2c5a3ef1fc31970f1c24b Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * Fix build without features.itemviewsTasuku Suzuki2019-05-122-4/+9
| | | | | | | | | | | | Change-Id: I9a7c3b2a3ad68ea76b1d6b79192b936e7cd1d44e Reviewed-by: David Faure <david.faure@kdab.com>
| * Update 3rdparty md4c libraryShawn Rutledge2019-05-243-1121/+1209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 0.3.3 plus a few more patches, including the one that adds MD_BLOCK_CODE_DETAIL::fence_char, which will enable smarter rewriting of code blocks (indented vs. fenced). Change-Id: Ibc892369947a8a8edfa4bc20b1df98a5c8153141 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * QTextMarkdownWriter: fix some bad cases with word wrapShawn Rutledge2019-05-241-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If any non-breakable content (such as a link) already went past 80 columns, or if a word ended on column 80, it didn't wrap the rest of the paragraph following. Change-Id: I27dc0474f18892c34ee2514ea6d5070dae29424f Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * 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-248-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Fix network build without feature.networkproxyTasuku Suzuki2019-05-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I832db8e9e13b93d7613bdf890fa6c16be78b3b28 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Headers cleanup in mac styleTasuku Suzuki2019-05-122-135/+80
| | | | | | | | | | | | | | | | | | | | | | Solve many duplication between _p_p.h and .cpp, sorted by module and header name, and move headers for each features at the end of includes. Change-Id: Ice9189c10d062bc473258b7ace279df057102167 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * QMessageLogContext: simplify constructionGiuseppe D'Angelo2019-05-221-10/+9
| | | | | | | | | | | | | | | | | | | | By using NSDMI. Change-Id: I171133b07ba2c7050e0d279caff0c393e03df182 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QMessageLogContext: rename and improve copy()Giuseppe D'Angelo2019-05-272-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "copy" name led me to mis-believe that it was a workaround to the class being non-copiable, and was missing copying a data member. This is instead deliberate; so rename the function to "copyContextFrom", documenting that version won't be copied. The function is still private API, so actually make it private; QMessageLogContext already befriended the only user. Finally, make it return *this (so that it can be chained, if necessary) and noexcept. Change-Id: I3deb3c8edc863a88ac0c37467b144ec2e20db5ca Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>