summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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-301-1/+19
| | | | | | | | | | | | | | | | 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>
* Fix build without feature.labelTasuku Suzuki2019-05-262-3/+6
| | | | | Change-Id: Ibe4d31d441ff691c4b354dde546e403653564ba4 Reviewed-by: David Faure <david.faure@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>
* 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>
* Fix build without features.itemviewsTasuku Suzuki2019-05-121-4/+1
| | | | | | Change-Id: I9a7c3b2a3ad68ea76b1d6b79192b936e7cd1d44e Reviewed-by: David Faure <david.faure@kdab.com>
* Support clicking to toggle checkboxes in QTextEditShawn Rutledge2019-05-246-0/+64
| | | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.13' into devFriedemann Kleint2019-05-2713-30/+143
|\ | | | | | | Change-Id: Ia279fc4a8226626041c772902a07b2f90f37b53b
| * Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-05-279-16/+120
| |\ | | | | | | | | | Change-Id: Iaf6bd52972b562b9c91d9e93a988d26b0eb9d3b4
| | * QMenu size fix - Mark items dirty on screen changeThorbjørn Lund Martsum2019-05-223-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems like an optimization on the itemsDirty flag caused a bug to be re-introduced. When a popup is shown on a new screen, the itemsDirty must however be set to ensure that new correct sizes are calculated. Task-number: QTBUG-59794 Change-Id: Ifb5c233b1f9d4d38bd0cd7a9a71cc32ad3212f8c Reviewed-by: Morten Kristensen <msk@nullpointer.dk> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
| | * Avoid rounding of the size in QGraphicsPixmapItem::boundingRect()Alexander Volkov2019-05-091-2/+2
| | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-75458 Change-Id: Ib240ddc0b490ae3c0348b6bfa290ad1f51b1e071 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * QCompleter: Fix completion on QFileSystemModelFriedemann Kleint2019-05-211-5/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the condition introduced by that determines whether a completion is started on signal QFileSystemModel::directoryLoaded() (introduced by 416ec00e7c859a844a5bcb24c7a31147aed974c / Qt 4). Observe case sensitivity and the native separator and return true for root directories. Task-number: QTBUG-38014 Task-number: QTBUG-14292 Change-Id: Ie425c04d2df256248e84250ba777793a8106a738 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * dockwidgets: Unbreak moving floating dock widgets with custom titlebarSergio Martins2019-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f1033567aa4 improved resize of windows with custom titlebar by adding more margin, but the check was too tight. d2d6c6f7813 tried to fix the regression, but not totally The mode is only set *after* the mouse press. It will always be NoWhere the first time, so that check will always discard the mouse press, making moving the window always fail the first time. Also, if the rect+range contains the press, then surely the mode won't be nowhere once set. There's still room for optimization, like bailing out early it was the right button instead of the left button, but that's out of scope for this bug fix, and also not worth for 5.12 branch. To reproduce the bug, simply: - Run examples/widgets/mainwindows/mainwindow - Click the red button of the blue dock widget, to make it float - Drag the title bar (not too slow). Fixes: QTBUG-66454 Change-Id: I0eebfb932dab95267ebadccd757de11a8bfe419d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Nathan Collins <nathan.collins@kdab.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
| | * Emit QMenu::aboutToShow() before platform specific codeMassimiliano Gubinelli2019-05-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Send the aboutToShow() signal to QMenu before synchronising the widgets for the menu items. This fixes a bug where if new QWidgetActions are added to the menu from a slot triggered by the menu's aboutToShow() signal, then such new actions do not shows up correctly on Mac. Other platforms are not affected by the change. Fixes: QTBUG-75826 Change-Id: Ic245d3fbc7ddde6944cca6cdb8e8951380c846ec Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | * Don't try to retranslate strings for native color dialogsTor Arne Vestbø2019-05-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the native color dialog is in use we haven't created any of the widgets and will crash when trying to update them. Change-Id: I6c43cc47359110c3b9db7cacb62581446cc6f7a3 Fixes: QTBUG-75858 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * Qt Widgets: Document CMake macrosKai Koehne2019-05-162-0/+65
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-72159 Change-Id: Ib9fdf852583964cf07c4d26e0a6c74f0058e29f1 Reviewed-by: Kevin Funk <kevin.funk@kdab.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| * | QAbstractSpinBox: fix some ui glitchesChristian Ehrlicher2019-05-103-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix some ui glitches for QAbstractSpinBox: - update geometry when buttons are toggled on/off - calc button size with subControlRect instead hardcoded 20px - when buttons are not shown, don't add the button size in sizeFromContents for common and macOS style Fixes: QTBUG-39713 Fixes: QTBUG-75303 Task-number: QTBUG-67126 Change-Id: Ibf330c76deb16358a481bba6bd429fff6a5d57ae Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-161-1/+2
| |\| | | | | | | | | | Change-Id: I1bdc28a3ae825ea35e83f20fe16d2409515e5a3d
| | * Don't render PE_PanelItemViewRow under tree decoration if style says noShawn Rutledge2019-05-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fusion style's SH_ItemView_ShowDecorationSelected hint is hard-coded to 1, but in QCommonStyle::drawPrimitive (which QFusionStyle inherits) it only asked its own QFusionStyle::styleHint() before drawing the background that happens to be under the tree row decoration (arrow thingy or +/- symbol). And the style doing the rendering does not know about QStyleSheetStyle so by the time we get to QCommonStyle::drawPrimitive() it's too late to check. Therefore QTreeView needs to avoid calling it in this case. Fixes: QTBUG-73251 Change-Id: I2d0ed4d3b2ee805a5602122273387982caa564f8 Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | QToolBox: replace a QList with a std::vector<std::unique_ptr>Marc Mutz2019-05-231-35/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This user of QList depended on the stability-of-reference guarantee of QList. Make that explicit by using a vector of unique_ptrs. Adapt to new API. This patch does not intend to fix any pre-existing problems with the code, such as double-lookups. It is focused on getting rid of this questionable use of QList, so the code doesn't explode when QList temporarily becomes QVector in wip/qt6. Not more, not less. Change-Id: I33847f33aa9f411ad9cd6c046653b7ab22a733cb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Remove usages of Q_OS_WINCEJoerg Bornemann2019-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This platform is history. Change-Id: Iddfab008a509f4828c321730414c8204055cf7af Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | | QTextBrowser: set base URL and document URL before loading contentShawn Rutledge2019-05-221-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setHtml() or setMarkdown() can result in attempting to load resources such as images that are needed to render the page. Whenever the resource has a relative URL, loading depends on the baseURL having already been set so that a complete URL can be constructed. QTextDocument::resource() is called to load images, and uses baseUrl(). A little later, QTextBrowserPrivate::resolveUrl() is given an URL that already has been extended with the baseURL if known; but it has its own logic to resolve the resource URL against currentURL, or else to treat it as a local file path if a file exists at that location. The autotest was relying on this fallback to the local relative file path before; but now it tests both with a local filename in the current directory for the source HTML and also with a fully resolved source URL containing the complete file path. Also made minor style improvements in tst_QTextBrowser's TestBrowser class. Change-Id: I46a850015d0e9c5bc5f13b9e37179a9323ab1980 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Fix qdoc warnings for Qt 5.14Friedemann Kleint2019-05-211-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | QGestureManager: don't abuse a QMap for a setMarc Mutz2019-05-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The filterEvents() implementations used a QMap<GestureType, int> for tracking whether a given type was already seen. The mapped_type was completely unused. Since the expected number of gesture types is very low, go directly to QVarLengthArray, not QSet, as the reduced number of allocation will dwarf the low overhead of O(N) search vs. O(1) for QSet or O(logN) for QMap. Change-Id: I98b6af69f11cca753e3c7c4fbb58e8f2e935e0d5 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | 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-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | QComboBox: do not bypass the base class' overridesGiuseppe D'Angelo2019-05-151-1/+1
| | | | | | | | | | | | | | | Change-Id: I01bb84a39d15231878ff267cfcb0f13167defd47 Reviewed-by: David Faure <david.faure@kdab.com>
* | | QSplitter: do not bypass the base class' overridesGiuseppe D'Angelo2019-05-151-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: Ie58025191bb250914c13385d6e374e8d0c3f99b6 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Add shortcut for select all in QSpinBoxFrederik Gladhorn2019-05-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This adds the shortcut to spinboxes and date edites. Fixes: QTBUG-48231 Change-Id: I91400e1990e4b1d7d971198c1e2a64149c2a835e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-152-6/+25
|\| | | | | | | | | | | | | | | | | | | | | | | | | | 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-141-6/+19
| |\| | | | | | | | | | Change-Id: Id3d16035c9692af42e9c1bf512218f3c836ae2eb
| | * Make sure QAccessibleTableCell is valid before referenceFrederik Gladhorn2019-05-131-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are some cases (model resets in weird positions) where we would crash due to accessing invalid model indices. Fixes: QTBUG-61416 Fixes: QTBUG-71608 Change-Id: Ibfedcbd921a3145f3e1596ac424a77f2319a5c46 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-121-0/+6
| |\| | | | | | | | | | Change-Id: I0c00ffe0eabebc919f22d6faa4bf958b288e8fd9
| | * Reset QWidget's winId when backing window surface is destroyedTor Arne Vestbø2019-05-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already reset it though e.g. QWidget::destroy, but if the backing window is destroyed spontaneously or via another API we need to catch that and send a WinIdChange event so clients who pulled out the original winId will not think the pointer is still valid Change-Id: I8556940ee871e81a51f73daeb2064f95bf41371c Fixes: QTBUG-69289 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | QTableView: replace QLinkedList with std::listMarc Mutz2019-05-142-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The object is never copied, so there's no point in using a cow'ed list implementation. Apart from the usual API adaptions (isEmpty() -> empty(), append() -> push_back()), alse replaced two foreach-loops with ranged-for. The first one does not call into out-of-line functions, and doesn't modify the container it iterates over, so is safe. The second does call into out-of-line functions, but they are const. The loop does not modify the container it iterates over, either, so is also safe (except for some fishy const_cast somewhere, or const being lost due to shallowness of const). Also replaced explicit-iterator loops with ranged-for where possible. Change-Id: I60b0f2d356846d527bfbaa6a0ecbb8395013b852 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QTableView: don't convert QSet to QList just to iterate over itMarc Mutz2019-05-132-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both in drawAndClipSpans(), as well as callee QSpanCollection::spansInRect(), a QSet is used to ensure uniqueness of elements. In both cases, the QSet is converted to QList, and the list is iterated over. Just iterate over the QSet directly... Change-Id: I8c7d17246a3cf836659026bfeadb987f37e476bb Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-1316-31/+48
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
| * | Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into ↵Liang Qi2019-05-094-2/+19
| |\ \ | | | | | | | | | | | | refs/staging/5.13
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-094-2/+19
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | | * QWidgetTextControl: Emit cursorPositionChanged() when handling IM eventVova Mshanetskiy2019-05-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWidgetTextControl and consequently QTextEdit did not emit cursorPositionChanged() signal when cursor position was changed by a QInputMethodEvent with a QInputMethodEvent::Selection attribute. This is especially important on Android because QAndroidInputContext uses such events extensively to move the cursor and also relies on cursorPositionChanged() signal being emitted by the focus object. If the signal is not emitted, QAndroidInputContext does not notify the virtual keyboard about cursor position change which results in various glitches. Change-Id: I7edd141258c483e6f103adcd6e40049b49c13387 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * Accessibility: Improve handling of read-only stateFrederik Gladhorn2019-05-073-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have been rather sloppy in how read-only versus editable is handled. According to the definition, editable signifies that in principle a widget allows the user to change its text. Read-only means that this ability is (currently) disabled. Task-number: QTBUG-75002 Change-Id: I5d71843abcdaac52f4a60a1abcac2604341f6c96 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * | | Fix: style sheet styling of background of triangular QTabWidget tabsEirik Aavitsland2019-05-091-2/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | The triangular tab shape is not reproducible with setting style border options, so it should be painted with the usual code path, also when a custom background has been set. Fixes: QTBUG-72096 Change-Id: I7bc1c0579386b8ea7266ce6456534c2519d9addf Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
| * | Doc: replace even more null/0/nullptr with \nullptr macroChristian Ehrlicher2019-05-0811-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Fix bug with QLayout::replaceWidget(a, a)Jan Arve Saether2019-05-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | It should effectively leave the layout untouched Fixes: QTBUG-69706 Change-Id: I4d8232895bf1d1ae0d1b73156ef6ec6001d8968a Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | | Migrate Windows system libs to external dependenciesJoerg Bornemann2019-05-081-1/+4
| | | | | | | | | | | | | | | | | | Started-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Change-Id: I211ce3252b836894aeeac1c85eb316d9596bca57 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Fix notification of QDockWidget when it gets undockedDmitry Kazakov2019-05-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before the patch the notification was emitted only when the docker was attached to the panel or changed a position on it. It looks like the old behavior was documented in a unittest, so this patch might actually be a "behavior change". Change-Id: Id3ffbd2018a8e68844d174328dd1c4ceb7fa01d3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | Deprecate conversion functions between QList and QSetLars Knoll2019-05-076-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>