summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
...
* Ensure override style properly clears out previous style if setTor Arne Vestbø2019-12-121-18/+14
| | | | | | | | | | QApplication::setStyle has quite a bit of logic to clean up from the old style before setting a new one. If a style has been set before the application is created, it's not enough to just delete the existing style, we need to treat it like a normal style switch. Change-Id: I2bcc2eb75567bf1bc8a32ac31467b22315a70a0b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Update system palette on application init if neededTor Arne Vestbø2019-12-121-0/+6
| | | | | | | | | | A style may have been set before the application was created, which would have resulted in setting the system palette based on the style's palette. Once the application is initialized and we have a platform theme we need to reset the system palette. Change-Id: Ia48f57d3983535c8633741d8027f75bc0c214018 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Unify system palette initialization during style changeTor Arne Vestbø2019-12-121-15/+16
| | | | | | | | | | | | | We let initSystemPalette() do all the work, instead of leaving the first time initialization of the system palette to the caller, which makes the logic harder to follow. This also means first time initialization of the system palette will pick up a platform theme if available and resolve the palette using that, which was missing from the original logic. Change-Id: I84da557caf8ecedf6d96d87ebee93168ea9d73ba Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Clarify call to initializeWidgetFontHash in QApplication::setStyleTor Arne Vestbø2019-12-121-1/+7
| | | | | | | | | | The call was added in c49c96fbb13912, "Reinitialize system palette when setting a new style", but adding it along with the palette code seems like a mistake. The potentially dirty widget font hash needs to be reset for all style changes. Change-Id: I411f56bb833819213c5485d7585fc5e3e9bd8983 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Doc: Fix qdoc compilation errors qtbaseNico Vertriest2019-12-121-1/+1
| | | | | | Task-number: QTBUG-79824 Change-Id: I6557de598de1931fc30556951d35783d02b83abe Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* wasm: fix getOpenFileContent docLorn Potter2019-12-111-2/+2
| | | | | | | The callback should be named the same as the function expects Change-Id: I4ca73958313c93c0d68e7205d8641c4104247e0c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Add "checkable" state to accessible menu itemAndre de la Rocha2019-12-101-0/+2
| | | | | | | | | | The information about whether a menu item may be checked is necessary to allow the platform code (in particular, Windows UI Automation layer) to make this information available to screen readers. Task-number: QTBUG-80551 Change-Id: Ibfcc4f2da1ebc68e7dc5df2cd46bbfc0a177da12 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix QPushButton style sheet style for overlay (content) imageEirik Aavitsland2019-12-101-0/+1
| | | | | | | | | | | | | | | | | Unlike comparable widgets like QLabel or QFrame, QPushButton would not render a content image specified in the stylesheet, unless a border style was also specified. Fix by explicitly rendering the content image, if set, in the native-border codepath also. Although the doc warns about the QPushButton border style having to be set in order for the background styling to take effect (since the native border painting otherwise hides it), the previous behavior does seem unexpected. Fixes: QTBUG-72029 Change-Id: I8b979b010515dab4dcf2f00344a187c87eeec096 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QAbstractItemView: add a note about ToolTipRole in dataChanged()Christian Ehrlicher2019-12-091-0/+2
| | | | | | | | | | Qt::ToolTipRole is not honored by dataChanged() which may be a little bit surprising. Therefore add a small note about this behavior. Fixes: QTBUG-78726 Change-Id: Ic4361f55e55ab59d5bae2fdb98907a62055604c5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QPushButton: fix icon + text layouting in RTL modeChristian Ehrlicher2019-12-092-64/+15
| | | | | | | | | | | | | | The fusion style did not properly handle the text layouting for a QPushButton in RTL mode. Also the menu indicator was not adjusted in this case. Fix it by calling the base class implementation as QCommonStyle does it mostly right. Since Fusion does not handle State_On or State_Sunken but QCommonStyle does, explicitly mask them out. Fixes: QTBUG-80083 Change-Id: Ide7bf997b4f4a5b61fcb8ea4a1a152122daef1e2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Move the tooltip out of the way of very large mouse cursorsVolker Hilsheimer2019-12-091-15/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Users that have large mouse pointers configured in their settings can not see tooltips, as they are obscured by the pointer. Native applications on Windows and macOS have the same problem, which includes the tooltips for the minimize/maximize/close controls in the window frame of e.g. Explorer. Introduce QPlatformCursor::size that returns a value that is based on the user's settings, or a default value. We can then use that value to move the tooltip out of the way. On Windows, the calculation of the cursor size is based on experimenting with the settings, which are in logical independent pixels. The placement of the tooltip attempts to keep existing behavior, and to not end up with a tooltip that's very far away from the tip of the arrow even for very large mouse cursors. [ChangeLog][QtWidgets][QToolTip] Make sure that the tooltip is not obscured by very large mouse pointers on Windows and macOS. Change-Id: I8e13b7a166bfe8b59cef4765c950f90fefeaef9d Fixes: QTBUG-79627 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Doc: Clarify ownership of added menu for QMenuBar::addMenu(QMenu *)Alexander Volkov2019-12-091-1/+2
| | | | | | Change-Id: Iaafba9557ece36607c86d5be4fbb5e4ac2e459d3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Avoid crash in menu that was previously shown as submenuAlexander Volkov2019-12-091-0/+2
| | | | | | | | | | Reset sloppyState for the previous submenu, so that if it will be shown as a menu, it will not use an incorrect pointer. Fixes: QTBUG-80528 Change-Id: If2ba8c3a664983ee76eb90d2c9a8096e2bd0a4e6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QWidget: React to platform surface being created or destroyedTor Arne Vestbø2019-12-091-0/+17
| | | | | | | | | | | | | The platform window may create or destroy its surface from other entry points than the QWidget API, in which case QWidget needs to sync up its own state to match. In particular WA_WState_Created and the winId needs to be recomputed. Fixes: QTBUG-69289 Fixes: QTBUG-77350 Change-Id: I769e58ead3c2efcf8c451c363108848feade9388 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix updating the text cursor position after editingSona Kurazyan2019-12-061-0/+6
| | | | | | | | | | | | | 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>
* Tell the truth about QDateTimeEdit's range-of-values propertiesEdward Welbourne2019-12-061-85/+115
| | | | | | | | | | There were factual errors. Important details were omitted. The \sa blocks were haphazard and cluttered. Change-Id: I76ceb00830c36699c48529b64808844faf09391e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix sizeHint of QProgressDialog to have enough space for window marginsVolker Hilsheimer2019-12-061-7/+10
| | | | | | | | | | | | | | | | | | Some styles, notably QMacStyle, use different margins for widgets and for windows. For these margins to be returned correctly, we have to tell the style that we want them for a toplevel widget. This was done correctly when laying out the dialog, but not when calculating the sizeHint, leading to a default size of the dialog that was too small to fit the text. As a drive-by, change variable names in the sizeHint method to be a bit more readable. Change-Id: Ib4168c7be176fa816241ebcc5f9235db4a7f982f Fixes: QTBUG-80272 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 13bbb1d9b9411e6eb65848efa8c0d481109b8868) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Item views: do not clip items horizontally in dragging iconEirik Aavitsland2019-12-062-2/+6
| | | | | | | | | | | | | | | | | | | | The dragging icon is created from the visible items in the selection. It would be clipped to the parts visible in the viewport. That meant that items on the edge could be rendered illegible, even though they were part of what was being dragged. Fix by dropping the horizontal clipping to the viewport. Items fully outside the viewport are already filtered away, so this should at most make a difference to the bottom and/or top items in the set. Keep the vertical clipping, since items may easily be very wide, so an unclipped icon would be unwieldy. Done-With: Sona Kurazyan <sona.kurazyan@qt.io> Fixes: QTBUG-77336 Change-Id: I2d29cb0ca69c1058635106aa0c67e9f7e140d1cd Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QStyleSheetStyle: properly honor checkmark size when drawing a QMenuChristian Ehrlicher2019-12-051-3/+6
| | | | | | | | | | | | When drawing a QMenu which is checkable but does not have an icon somewhere, the width of the (possible) checkmark was not considered during drawing and the text was drawn over the checkmark. Also the wrong state was checked for drawing the checked icon (if one was given). Fixes: QTBUG-80506 Task-number: QTBUG-78238 Change-Id: Icf8aa37aab424564054d3549defee93eb0d7c1a4 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QPlainTextEdit: update internal palette on QEvent::EnabledChangeChristian Ehrlicher2019-12-051-0/+1
| | | | | | | | | | | | | QEvent::EnabledChange did not update the palette of the internal QPlainTextEditControl which lead to a wrong text color when the QPlainTextEdit was disabled e.g. due to a QGroupBox. Fix it the same way it is done in QTextEdit - set the new palette also to the internal control when QEvent::EnabledChange is received. Fixes: QTBUG-80150 Change-Id: Icbeddf3d6cd4877a3d8d4a06b2da69383dd776d2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QTreeView: Reset the pressed index if the decoration was pressed onAndy Shaw2019-11-291-0/+2
| | | | | | | | | | | We need to reset the pressed index when the decoration was pressed on otherwise if the mouse ends up over an already selected item that was previously clicked on. This prevents it from thinking that the mouse has been released on this item right after pressing on it. Fixes: QTBUG-59067 Change-Id: Iab372ae20db3682ab0812661f86533079ba4083c Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QWidget: don't set WA_PendingMoveEvent when geometry does not changeChristian Ehrlicher2019-11-271-3/+8
| | | | | | | | | | | | | | When the geometry of a hidden widget was set with setGeometry(), WA_PendingMoveEvent and WA_PendingResizeEvent were set unconditionally even if the crect already had the correct value. This lead to unneeded Move/Resize events within sendPendingMoveAndResizeEvents(). Fixes: QTBUG-75475 Fixes: QTBUG-79906 Change-Id: Ibbe03882f039948b6b7c04887420741ed2e9c0f7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QDial: use correct button colorChristian Ehrlicher2019-11-261-3/+6
| | | | | | | | | | When the pixmap for the QDial was cached, the button color for the knob was not properly set Fixes: QTBUG-19855 Change-Id: Ib09ac12f0b11c47a0d05f01759fc6eeadbeab06c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: Improve explanation of QLineEdit input maskEirik Aavitsland2019-11-261-9/+24
| | | | | | | | | | The explanation of the input mask syntax and behavior was somewhat unclear. Task-number: QTBUG-76320 Change-Id: I45dc4a883c491d3dc08125b0f7efad46f2a9a33f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: improve Using Model Indexes in Model View Programming guideSamuel Gaist2019-11-192-6/+14
| | | | | | | | | | | The current example using QFileSystemModel doesn't take into account the asynchronous nature of that model. This puts people on the wrong path on how to use it. This patch improves the snippet as well as the explanation steps. Change-Id: I5c7a3c19aad48847f0b965b5eb69b492d6263f51 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QLineEdit: Fix End key for input masksDaniel Teske2019-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | Consider this simple example: QLineEdit edit; edit.setInputMask( "9-9-9-9-9-9" ); edit.show(); Without any input, m_text will contain: " - - - - - ". text() removes the input mask's mask characters from that and returns " ". A string with 6 spaces. Thus currently the End key jumps to position 6, which is in the middle of the string. Using m_text the End key jumps to the actual end. [ChangeLog][QtWidgets][QLineEdit] Fixed End key in combination with certain input masks. Task-number: QTBUG-16187 Task-number: QTBUG-20414 Change-Id: Ibb30a1dfa2f78103611b5afc9971dc43e8bdcc4a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QTreeView: make sure to not ask the old model during setModelChristian Ehrlicher2019-11-141-0/+2
| | | | | | | | | | | | Within QTreeView::setModel() the header might emit columnCountChanged which then tries to update the geometries based on the old model which is wrong. Fix it by setting geometryRecursionBlock to true so QTreeView::updateGeometries() will not ask the old model for it's data. Fixes: QTBUG-75982 Change-Id: Ia0dd36cd7c6c5347fbc285deac43da6941accbe7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix rendering of markdown in QLabelEike Ziller2019-11-132-14/+25
| | | | | | | | | | | | | | Since 65314b6ce88cdbb28a22be0cab9856ec9bc9604b there is a TextFormat for MarkdownText, and QWidgetTextControl supports that, but QLabel does it in its own way and sets plain text or rich text on the text document itself. Add a code path for MarkdownText there. [ChangeLog][QtWidgets][QLabel] Markdown is now a supported textFormat for QLabel. Fixes: QTBUG-79766 Change-Id: Ib9370ef300089af2c4d6070e545c5470f32833a8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QTableWidget: Fix -Wdeprecated-copy warningAlbert Astals Cid2019-11-122-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | In file included from ../../include/QtCore/qlist.h:1, from ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/kernel/qobject.h:49, from ../../include/QtCore/qobject.h:1, from ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/kernel/qcoreapplication.h:46, from ../../include/QtCore/qcoreapplication.h:1, from /src/widgets/kernel/../../gui/kernel/../../corelib/global/qt_pch.h:66, from /src/widgets/kernel/../../gui/kernel/qt_gui_pch.h:48, from /src/widgets/kernel/qt_widgets_pch.h:48: ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/tools/qlist.h: In instantiation of ‘void QList<T>::node_construct(QList<T>::Node*, const T&) [with T = QTableWidgetSelectionRange]’: ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/tools/qlist.h:614:13: required from ‘void QList<T>::append(const T&) [with T = QTableWidgetSelectionRange]’ /src/widgets/itemviews/qtablewidget.cpp:2416:71: required from here ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/tools/qlist.h:471:35: warning: implicitly-declared ‘constexpr QTableWidgetSelectionRange& QTableWidgetSelectionRange::operator=(const QTableWidgetSelectionRange&)’ is deprecated [-Wdeprecated-copy] 471 | else *reinterpret_cast<T*>(n) = t; | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from /src/widgets/itemviews/qtablewidget.cpp:40: /src/widgets/itemviews/qtablewidget.h:52:24: note: because ‘QTableWidgetSelectionRange’ has user-provided ‘QTableWidgetSelectionRange::QTableWidgetSelectionRange(const QTableWidgetSelectionRange&)’ 52 | class Q_WIDGETS_EXPORT QTableWidgetSelectionRange | ^~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: Iad959315ad374ef288f5fffd15d6876cb63bce8e Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 127ed7e6e0f8939861cce7349e28a1dec9a7d6ed)
* Merge "Merge remote-tracking branch 'origin/5.13' into 5.14"Qt Forward Merge Bot2019-11-064-5/+23
|\
| * Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-11-064-5/+23
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Doc: Add notes about Qt Style Sheets taking precedenceLeena Miettinen2019-10-312-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | ...over setting properties on individual widgets. Task-number: QTBUG-28675 Change-Id: Ic7bfd723ed8970112a9892727170d3bacaa1903f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| | * Ensure that child windows are visible again when showing their parentAndy Shaw2019-10-292-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a window is closed, then it will cause the child windows to be closed as well as a result. Therefore in order to ensure that they are shown again as a result, we need to remove the WA_WState_ExplicitShowHide attribute if the widget was not already hidden before. This enables us to test for this attribute when calling showChildren(), so that if the window has a windowHandle then we can make sure that this widget is shown again. Fixes: QTBUG-73021 Change-Id: I1186242b889899dfcd38d782a67567348e2055ee Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | QAbstractItemView: don't toggle selection on mouse move on some indexChristian Ehrlicher2019-11-061-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | In single selection mode, the current selection toggled when the user pressed the left mouse + Ctrl key and then moved the mouse over the item. This was introduced with 28a21d98ef8d880a6dd86ee19dd803424bb5eae1 which added the possibility to deselect an item in single selection mode. Fix it by adding a check if the event was a mouse move event and use the old codepath for it. Fixes: QTBUG-77353 Change-Id: Id845ada302c92646885dfd966721b00d940f1260 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | Turn a local QHash into a QMultiHashMårten Nordheim2019-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 972a0402be4d7aed0ebbd0ff56b5018cda01599d was merged before one of its parent patches which changed this QHash into a QMultiHash. So in 5.14 it would overwrite values instead of adding new entries. No idea if it has caused or will cause any regressions. But it was an accident so let's fix it. Amends 972a0402be4d7aed0ebbd0ff56b5018cda01599d. Change-Id: I6623b0b7924024df148d5c83bcbb612f3e595f56 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.13' into 5.14"Qt Forward Merge Bot2019-10-291-2/+2
|\ \
| * | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-281-2/+2
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/serialization/qjson_p.h Change-Id: I83cea141a4de8b3998478bfded84ca9029f7a2a9
| | * QColorDialog: Fix memory leak when picking screen colorsFriedemann Kleint2019-10-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Pass the dialog as parent to the event filter class in QColorDialogPrivate::_q_pickScreenColor(). Fixes: QTBUG-53469 Change-Id: I9110c19a8f49a545a0fbf7cfdb3ded70fea4dcce Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | | QGraphicsItem: disable deprecated warnings during compilationChristian Ehrlicher2019-10-281-0/+6
|/ / | | | | | | | | | | | | | | The previous commits which deprecated the function forgot to add QT_WARNING_PUSH/QT_WARNING_POP around the affected code. Change-Id: I042a2bcd40afe2e5fe517954be26a02fd048b563 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Specify year in month name lookups for QCalendarWidgetEdward Welbourne2019-10-251-14/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compiler didn't complain at a QLocale::FormatType values being passed for the int year parameters of the month-name functions, which all have a default for their final QLocale::FormatType parameters. So we didn't notice that the year parameter was missing until the bug was reported. Removed some code duplication by giving QCalendarModel a monthName() method. Reworked QCalendarMonthValidator::text() to avoid repeated calendar calculations (and use fewer braces). This commit amends commit 2dee00621632ab8acd0b3d59bdba264afe2f32c1 Fixes: QTBUG-79495 Change-Id: Iad48c3b648a0139ab43511e6fb4e6a8f63a0495f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | QTableView: properly deselect row when column 0 is hidden/not visibleChristian Ehrlicher2019-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When the first column is hidden or not visible in the current viewport, it is not possible to deselect the current row. Fix it by passing the correct column to QItemSelectionModel::selectedRows() when testing if the current index is selected. Fixes: QTBUG-79092 Change-Id: I9d8082d2b29ad2f799156aee910c6ff6e3217771 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-245-23/+40
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstandardpaths_unix.cpp src/corelib/tools/qsharedpointer_impl.h tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: Iae95c5778dc091058f16f6db76f04a0178a9e809
| * Doc: Correct snippet about customizing QMenuBarNico Vertriest2019-10-111-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-79129 Change-Id: I1f8da3b429ab8543ca1f0b7079d0f50bbeea8eb5 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * Fix QGraphicsScene::update() performanceAndre de la Rocha2019-10-112-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | A previous fix has caused a performance degradation while adding a check for avoiding adding duplicated rectangles to the update list. This patch fixes it by using a std::set instead of a QList, avoiding duplication while using an O(log N) operation, instead of the O(N) used before. Fixes: QTBUG-77952 Change-Id: Ifa9fbf110e0bad60ee02a42d91281981fd98ceab Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * Drag'n'Drop: fix crash when widgets are destroyed during event handlingVolker Hilsheimer2019-10-101-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | Widgets might be destroyed when handling a dragMoveEvent, in which case the following code will operate on dangling pointers or null pointers. Use a QPointer to watch for the original event receiver to disappear, and add the necessary checks for the objects we deliver events to being null. Change-Id: I4ca2f182540ae21113f4bea4e5c569e983cc58bf Fixes: QTBUG-78907 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * Item views: fix regression causing unexpected widget overlappingEirik Aavitsland2019-10-101-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A certain geometry adjustment was (practically) introduced in Qt 5.11, and caused very surprising behavior, where item widgets will often overwrite neighbouring cells. This has resulted in a number of bug reports. Since the adjustment has such serious side effects, and does not seem to be relevant any longer for the issue for which it was intended, remove it here. More details: From early Qt 4 times, QStyledItemDelegate would do some automatic expansion of the geometry of editor widgets - but only if the layout was RightToLeft. Hence, the effect of it was rarely seen. QTBUG-37433 did, for Qt 5.10, and complained about it. However, the resulting code change did not remove the adjustment, but instead extended it to apply to the normal LeftToRight layout also. Hence, more users experienced it, and reported it as a regression. Also, now in Qt 5.13, it seems Qt has changed in other ways, and the geometry adjustment no longer seems to help (or indeed make any difference to) the original case in QTBUG-37433. Fixes: QTBUG-78495 Fixes: QTBUG-76011 Fixes: QTBUG-68476 Change-Id: I4a4e873969eb1d89843f98fc63d90371207515d1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | docs: clarify usage of css 'qproperty' in stylesheetsRichard Moe Gustavsen2019-10-211-0/+4
| | | | | | | | | | | | | | | | | | Clarify that the qproperty properties will only be evaluated once. Fixes: QTBUG-2982 Change-Id: Ie294ced118f740c7378c62c0b5a4924d5628e118 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | Propagate application termination requests through QPATor Arne Vestbø2019-10-191-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of having each platform plugin deal with application termination in their own weird ways, we now have a QPA API to signal that the system requested the application to terminate. On the QGuiApplication side this results in a Quit event being sent to the application, which triggers the default behavior of closing all app windows, and then finally calling QCoreApplication::quit(). The quit event replaces the misuse of a close event being sent to the application. Close events are documented as being sent to windows. The close events that are sent to individual windows as part of the quit process can be ignored. This will skip the final quit() of the application, and also inform the platform that the quit was not accepted, in case that should be propagated further. In the future the logic for closing windows should be unified between the various approaches in closeAllWindows, shouldQuit, and friends. Change-Id: I0ed7f1c0d3f0bf1a755e1dd4066e1575fc3a28e1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Set icon on the select-all action in the text edit context menu tooVolker Krause2019-10-172-0/+2
| | | | | | | | | | | | | | | | | | Makes this consistent with the rest of the actions here, and avoids dirty hacks like KIconTheme::assignIconsToContextMenu. Change-Id: I749f4d5f67efdbf595a52185dd507de5f87f6487 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Prepare for deprecating the QDesktopWidgetSona Kurazyan2019-10-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QDesktopWidget is marked as obsolete in docs, but it is not yet completely deprecated, some of its methods are still in use. Replace uses of the following methods marked as obsolete: - QDesktopWidget::screenNumber(QWidget*) -> QWidget::screen() - QDesktopWidget::screenGeometry(QWidget*) -> QWidget::screen()->geometry() - QDesktopWidget::availableGeometry(QWidget*) -> QWidget::screen()->availableGeometry() Task-number: QTBUG-76491 Change-Id: I2cca30f2b4caa6e6848e8190e09f959d2c272f33 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>