summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* QTreeWidget::setHeaderItem: fix off-by-one in signal emissionsGiuseppe D'Angelo2017-11-301-4/+4
| | | | | | | | | | | | | | | | | | | When setting a header item (that is, the item that provides the QTreeWidget's column) the widget needs to manipulate the underlying tree model and add or remove columns. This requires calling the right QAbstractItemModel APIs for structural model changes. The calculations done resulted in a off-by-one error: * if the model had N columns and needs to grow to M(>N), then one needs to begin insertion from N to M-1 (and not M); * if the model had N columns and needs to shrink to L(<N), then one needs to begin removal from L to N-1 (and not N). Add the -1s needed. Change-Id: Ic669788825a1c480376a08df0d7c9c10f91552ef Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* QTreeWidgetItem::insertChildren: ignore out of bounds indexesGiuseppe D'Angelo2017-11-301-0/+3
| | | | | | | | | | | | | | | | QTreeWidgetItem::insertChildren should behave like a more-optimized QTreeWidgetItem::insertChild. Unlike the latter, the former lacks out-of-bounds checks, resulting in successful insertions even when using an invalid index (say, bigger than the row/column count). Reintroduce some sanity checks instead. This allows to fix a "fixme" left in the autotest. [ChangeLog][QtWidgets][QTreeWidgetItem] QTreeWidgetItem::insertChildren now ignores insertions happening at invalid indices, for consistency with QTreeWidgetItem::insertChild. Change-Id: I1532597768cc6aff96a6e8f356bc6075b582801d Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-307-31/+41
|\ | | | | | | | | | | | | | | | | Conflicts: src/corelib/thread/qsemaphore.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Id35b535e88df63fdfe4007ea92ed4a39c4b6d707
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-236-31/+41
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstandardpaths_win.cpp src/plugins/platforms/ios/qioswindow.mm src/plugins/platforms/ios/quiview.mm tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: I5deb0a0176a454a9c566e924d074ba60ce04f0bc
| | * QHeaderView: Simplify and fix layoutChange handlingStephen Kelly2017-11-221-24/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A layoutChange indicates that anything can have moved to anywhere else, including as a result purely of new items being added. It can also indicate that items are removed. The old code here incorrectly assumed that the section count remained constant over this operation by setting the size of the oldSectionHidden QBitArray - whose size is the size before the layoutChange operation - and then calling setBit with model rows numbered after the layoutChange operation. As the two are not necessarily the same dimensions, this can result in asserts from the setBit call. Simplify the handling of layoutChanged entirely by clearing section information, and using the QPersistentIndexes which indicate hidden state to restore that state after re-population. Task-number: QTBUG-53221 Change-Id: I3cda13e86b51b3029b37b647a48748fb604db252 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
| | * QTreeView/Fusion style : Draw child indicator correct in RTL-modeChristian Ehrlicher2017-11-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fusion style did not honor direction option when drawing the child indicator. This lead to a wrong rendering of QTreeView in right-to-left mode. Task-number: QTBUG-63396 Change-Id: I2d5de03d7c831e3caabcc9269617eecb9338f163 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * CMake: Set SKIP_AUTOMOC/AUTOUIC where neededKevin Funk2017-11-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure we don't run into warnings for CMake 3.10 Task-number: QTBUG-63442 Change-Id: Ida004705646f0c32fb4bf6006036d80b1f279fd7 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Sebastian Holtermann <sebholt@xwmw.org> Reviewed-by: Rolf Eike Beer <eb@emlix.com>
| | * Start from the first visible item when doing a searchAndy Shaw2017-11-221-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the first item in a treeview might be hidden, start from the first visible item in the view when starting or wrapping round during a keyboard search. Task-number: QTBUG-63869 Change-Id: I202bea567c6d4484c3ffaf8a5f9af8ea2e13708d Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
| | * QTreeView: recalculate row heights in hide/showColumn()Christian Ehrlicher2017-11-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling QTreeView::hideColumn() the row heights are not recalculated. This can lead to rows which are unnecessarily high due to hidden columns may contain large (e.g. multiline) content. The same applies to showColumn() - there the row might be to small. Hiding columns directly via QTreeView::header()->hideSection() is not covered by this patch since QHeaderView has no way to inform about newly shown/hidden sections. Task-number: QTBUG-8376 Change-Id: I20b1198e56e403ab8cf649af76e5e2280821dd68 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * QTableView: do not draw grid behind last sectionChristian Ehrlicher2017-11-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTableView::paintEvent() drawed the grid lines behind the last section when the region to repaint contained rects which were completely behind the last section. This also lead to unnecessary repaints for cells inside rect.top() to rect.bottom() Task-number: QTBUG-60219 Change-Id: I42bb42bea504dfd3c92352ac5c65a43c246a05af Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * QToolBar: Don't crash on macOS with 'minimal' QPA pluginGabriel de Dietrich2017-11-171-0/+2
| | | | | | | | | | | | | | | | | | | | | 'minimal' doesn't provide any native interface. Change-Id: I116c9905977ccc6ededf0c6c41b92b6f785f2875 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
| * | Doc: review Star Delegate ExampleNico Vertriest2017-11-201-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | - update screenshot - minor corrections description example Task-number: QTBUG-60635 Change-Id: I2351160ee9ec0a926fddb122e720c887f851dba5 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-2314-162/+203
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/qhttp2protocolhandler_p.h src/network/kernel/kernel.pri src/network/ssl/qsslkey_qt.cpp src/plugins/platforms/cocoa/qcocoascreen.mm src/plugins/platforms/windows/accessible/iaccessible2.cpp src/plugins/platforms/windows/accessible/iaccessible2.h src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h src/widgets/widgets/qmenu_p.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/other/qaccessibility/tst_qaccessibility.cpp tests/auto/testlib/selftests/expected_cmptest.lightxml tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/testlib/selftests/expected_cmptest.xml Done-with: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I4217cc7d840cbae3e3dd28574741544469c4c6b9
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-171-1/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also blacklist tst_QNetworkReply::ioHttpRedirectErrors(too-many-redirects) on RHEL 6.6 in CI. Conflicts: tests/auto/network/access/qnetworkreply/BLACKLIST tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp Task-number: QTBUG-64569 Change-Id: I7514fc0660c18fd3a3e1d0d0af3f15d879e3c6f4
| | * QAbstractButton: don't clear 'pressed' flag unless left button is releasedRichard Moe Gustavsen2017-11-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As it stood, we would set 'pressed' to false regardless of which button that was released. This would end up wrong if pressing the left button, and at the same time, did a click with the right button. This would clear the flag prematurely, and cause a release signal not to be emitted when later releasing the left button. tst_QAbstractButton: adding autotest Adding tests to simulate the bug report's cases: 1) left press button 2) click right/middle key 3) move mouse out of button's boundary 4) test if the released() signal triggered properly Taks-number: QTBUG-53244 Change-Id: Ifc0d5f52a917ac9cd2df5e86c0475abcda47e425 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * | QMenu: Refactor insertion of action in QPA menuGabriel de Dietrich2017-11-152-54/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | First, remove a bit of code duplication around the creation of the platform menu item. Then, we move copyActionToPlatformItem() inside QMenuPrivate to get rid of one parameter. Change-Id: I5a33103566367f2313930479844365e79773d82f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * | QMenu: Update menu action sizes if popup is (not)caused from menu barBłażej Szczygieł2017-11-152-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Menu width differs if it contains key shortcuts or not. Amends 6634c424f8ca0e3aed2898507d5f9f4b774c4602 Task-number: QTBUG-49435 Task-number: QTBUG-61181 Task-number: QTBUG-64449 Change-Id: I8c479af550128069ca91dd089dfc7bd8c24c66ba Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-098-103/+129
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qwindow.cpp src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowssystemtrayicon.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp tests/auto/widgets/kernel/qaction/tst_qaction.cpp Change-Id: Ifa515dc0ece7eb1471b00c1214149629a7e6a233
| | * QMainWindow: Clear menubar parent when new one is setGabriel de Dietrich2017-11-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QMainWindow::setMenuBar(), we hide and schedule the current menubar, if any, to be deleted later. However, it remains installed as its whole ancestry's event filter, which could conflict with the newly assigned menubar until the old menubar is destroyed. In our case, we have noticed issues with the Cocoa QPA plugin. We force uninstalling the old menubar as event filter by setting its parent to null, pending its deletion shortly after. This fixes BigMenuCreator's empty menubar when calling it with only the "--new-menubar" option. It also fixes QTBUG-34160 example which was not behaving as well as it should. Task-number: QTBUG-34160 Change-Id: Ifefb72affad01e7b7371005442074afd6a39a5b8 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| | * QMenuBar: Update title on changeGabriel de Dietrich2017-11-072-24/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When one of the menubar actions changed, we would omit to update several properties on the platform menu, most notably its title. Manual tested with BigMenuCreator, where the sequence menu->addAction(action); // A-operation action->setMenu(submenu); // S-operation would result in an "Untitled" menubar item on macOS, and this regardless of when the submenu is populated. Change-Id: I43989f36f6bf3f0b7056310ac986c06f8e02f128 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * QMenuPrivate: Use in-class initializers where possibleGabriel de Dietrich2017-11-071-56/+31
| | | | | | | | | | | | | | | | | | Change-Id: I5347cb41443baf96e28bd399c84983a801b10fcd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QMenuPrivate: Rearrange member variablesGabriel de Dietrich2017-11-071-53/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | This saves 32 bytes per instance on 64-bit macOS, from 888 down to 856 bytes. Change-Id: I2592631aa3566d2eab72bad338aacfe76bee8ef3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QWidget: Propagate window file path after createTor Arne Vestbø2017-11-071-0/+2
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-63340 Change-Id: Ic21964a33ee2910200627fe8a8c8ec2454e2e20c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * QHeaderView: Skip hidden sections on cascading resizeChristian Ehrlicher2017-11-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a section is hidden, QHeaderViewPrivate::cascadingResize() does resize a section even it is hidden. This leads to space between the neighbor sections and also some unneeded calculations. Task-number: QTBUG-54601 Change-Id: Ie139417ae2c77ef25e66cf628bfe400185f88ee8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * QHeaderView: Honor maximumSectionSize property during resizeSections()Christian Ehrlicher2017-11-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resizing a QTreeeView section with double click or resizeColumnToContents() does not respect the maximumSectionSize when the resize mode is Interactive or Fixed. Since the documentation of maximumSectionSize states that it should honor this property for those cases either the documentation or implementation is incorrect. This patch fixes the latter. Task-number: QTBUG-64036 Change-Id: Ic14c8e444d50b9c50a117efed19d0bca7ec1cf82 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * Windows: Use SM_CXSMICON instead of SM_CXICON for the tray icon sizeFriedemann Kleint2017-11-041-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | Partially reverts b465fe759695bb7e1de693c3d4d20acfd2c49779. Task-number: QTBUG-63447 Change-Id: Iaf8a54b59a054e33811f65f64322af3aa746885e Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| | * QListView: make sure to respect grid size during dataChanged() handlingChristian Ehrlicher2017-11-041-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the dataChanged() signal is handled by QIconModeViewBase, the size of the items are recalculated. During this operation the optional grid size is not taken into account which leads to a screwed up layout. This patch adds the missing check similar it is done in doStaticLayout()/doDynamicLayout(). Task-number: QTBUG-45427 Change-Id: Iba7adb44b1510c511a69c289ccb4f168992a6871 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * Disable window shortcuts if there is a window modal dialogElvis Angelaccio2017-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a window is blocked by a WindowModal dialog, it should not be possible to trigger window shortcuts on that window if it receives a WindowActivate event. This currently happens if the blocked window gets clicked, because the window becomes the active_window and then QApplication sends it a WindowActivate event (this doesn't happen with application modal dialogs). The correctWidgetContext() function calls QApplicationPrivate::tryModalHelper() only if the shortcut context is ApplicationShortcut. This patch makes it call even if the shortcut context is WindowShortcut. Change-Id: Iff87d85bcae603a6a24128e0cedfa9d33b6485fd Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-304-4/+7
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowswindow.cpp tests/auto/widgets/kernel/qaction/tst_qaction.cpp Change-Id: Ia017a825ed2ca2d53ac586f4ae48df6f65818d40
| | * Make sure that QAccessibleWindowContainer::childCount is validFrederik Gladhorn2017-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When embedding foreign windows, we won't be able to return a valid child accessible interface, so do not report it at all. Supporting foreign windows properly is platform specific and something to consider, but at least we shouldn't crash. Task-number: QTBUG-63451 Change-Id: I19350cf97dc8d0c3f3052411eba0eee5f750dbab Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| | * QWizard: Do not remove the Next button's shortcutMaciej Czarnecki2017-10-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently on Windows, the Next button's shortcut doesn't work, because QWizard overrides it with an empty key sequence. The key sequence should be changed only if isVistaThemeEnabled() returns true. Task-number: QTBUG-46894 Change-Id: I54f26388b167973cc8065a867d9e771c1e6a2a72 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * QAction: fix ::setData() always emits changed()Yulong Bai2017-10-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QAction::setData() always emits changed() even without actual data change. Original code lacks a guard to check if the data changes. According to http://doc.qt.io/qt-4.8/signalsandslots.html, adding guard also benefits to prevent infinite looping in case of cyclic connections. Task-number: QTBUG-62006 Change-Id: I776369b668082f9f02e4502a36b1ae234ee7e079 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * Add clarifying documentation for QLayout::removeWidget()Andy Shaw2017-10-241-1/+2
| | | | | | | | | | | | | | | Change-Id: I6c256c6c5cdfed6ceb45758d708fdc8f74d2939f Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | Remove a few more uses of deprecated QDesktopWidget APIsTor Arne Vestbø2017-11-172-2/+4
| | | | | | | | | | | | | | | | | | Change-Id: I3834ba7ce8f9bd7026f3d59f15d268b4c03e364a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Fix accessibility info for tri-state checkboxesAndre de la Rocha2017-11-142-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The state information provided by QAccessibleInterface::state() was not correctly reflecting the state of tri-state checkboxes: checkStateMixed was never set. This change fixes this issue and also adds accessibility update notifications for changes in checkStateMixed, which were missing. Change-Id: Ia4a114559d5a957ca85bf2f169a6cece2c98d077 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | | Deprecate QDesktopWidget in favor of QScreenTor Arne Vestbø2017-11-087-40/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtWidgets] QDesktopWidget has been deprecated. Use the corresponding QScreen functions instead. Task-number: QTBUG-62094 Change-Id: I0941d2aa27a06ec650ca52d6467e5bfb0ad43459 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-051-0/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/minimum-linux.S src/network/access/qhttpthreaddelegate.cpp src/widgets/kernel/qwidgetwindow.cpp Change-Id: Id2e817e85f85c68f5482c9a12912d35590f9d5f8
| * | Fix -no-opengl buildTimur Pocheptsov2017-10-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A follow-up patch for 8e70241dccaf5a9e5c79c8d6da5665b881c5914d: Make 'shareContext' conditionally included/compiled (protected by QT_CONFIG(opengl)). Change-Id: Ieaeea6b146b47fba7a77e2576ae0a33042280199 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | Remove references to obsolete platformsJake Petroules2017-11-052-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ultrix and reliant have not seen a release since 1995. dgux not since 2001. bsdi not since 2003. irix not since 2006. osf not since 2010. dynix... unclear, but no later than 2002. symbian needs no mention. All considered obsolete, all gone. sco and unixware are effectively obsolete. Remove them until someone expresses a real need. Change-Id: Ia3d9d370016adce9213ae5ad0ef965ef8de2a3ff Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | qwidgetwindow: remove seemingly stray QApplicationPrivate::mouse_buttonsGatis Paeglis2017-10-271-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes mouse_buttons related code from qwidgetwindow.cpp as it does not belong there for the following reasons: - The commit (ed2a2dc6dae0a2523cecfd272609d322ace16145) that added it in Qt5 says that the logic was copied from qapplication_x11.cpp (filename in Qt4 repository). Other qapplication_*.cpp platform implementations did not have this kind of logic; thus having it in cross platform location qwidgetwindow.cpp does not make sense. - According to the documentation, QApplicationPrivate::mouse_buttons: "Returns the current state of the buttons on the mouse. The current state is updated synchronously as the event queue is emptied". So the only place where changing this variable makes sense is in QGuiApplicationPrivate::processMouseEvent, which is *when the event queue is emptied*. There are other places in source code where this variable is changed, but all of those are hacks and should be cleaned out eventually: // a hack due to insufficient QWindowSystemInterface API plugins/platforms/windows/qwindowsdrag.cpp // a hack to support code that bypasses QWSI API when sending mouse events // via qApp->notify(). widgets/kernel/qapplication.cpp - AFACT, the released button bit will be already unset by the time mouse release event reaches QWidgetWindow::handleMouseEvent. Change-Id: Ifb2b3b443ffff0274545e5d3c631cf1e77160502 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | QWidgetTextControl: allow context menu to open for a QTextEdit with ↵Richard Moe Gustavsen2017-10-271-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt::NoFocus set Currently a context menu will only open when right-clicking on a text edit that has input focus. This means that you cannot e.g bring up the context menu to copy text for a text edit that doesn't accept input focus (but you are still allowed to select text with the mouse, which feels a bit contradictory). This is different from how QLineEdit works, and also different compared to how native applications work, at least after testing on macOS and Ubuntu. This patch will change this behavior, so that the context menu always open on both QPlainTextEdit and QTextEdit, even when they don't accept focus. Task-number: QTBUG-63868 Change-Id: Ibc4cbcc900077546828690ddc958820677211a5a Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2017-10-2411-13/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowsmousehandler.cpp src/plugins/platforms/xcb/qxcbimage.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/manual/qtabletevent/regular_widgets/main.cpp Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io> Done-with: Mårten Nordheim<marten.nordheim@qt.io> Change-Id: I5b2499513a92c590ed0756f7d2e93c35a64b7f30
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-231-1/+3
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/direct2d/direct2d.pro src/plugins/platforms/ios/qiosclipboard.mm src/plugins/platforms/windows/windows.pro Change-Id: Idffa03b3990bd642784f528821c5446b2e1008ef
| | * QShortcut: Fall back to cross platform code in absence of QPA menuGabriel de Dietrich2017-10-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On macOS, absence of a QPA menu means that we should be using our own internal logic since there's no entity on the QCocoaMenuDelegate to take care of the shortcuts. Change-Id: I35ed8f0b55445f61d0528709d4debb636a502002 Task-number: QTBUG-61039 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | Fix implementation of spell check underline stylesDmitry Shachnev2017-10-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QTextCharFormat documentation said that the used style is based on QStyle::SH_SpellCheckUnderlineStyle style hint, however in fact the implementation (drawTextItemDecoration in qpainter.cpp) uses themeHint(QPlatformTheme::SpellCheckUnderlineStyle) instead since Qt 5 (see commit 1f9ae50457a3750f). Make the documentation match that behavior, and update QPlatformTheme to use the correct default value. Also, switch Cocoa theme to use DotLine, as that is what native macOS applications use. Change-Id: I2a6bb3da6c7b0686dca87ed2c251b6abc006123c Task-number: QTBUG-50499 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
| * | MinGW: Globally define WINVER and _WIN32_WINNT to enable Windows 7 APIOrgad Shaneh2017-10-191-2/+0
| | | | | | | | | | | | | | | Change-Id: I637b33ba6d05f40486d8da927ae5cc5148299348 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * | QAbstractItemView: Make it easier to drop above and below itemsThorbjørn Lund Martsum2017-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch a very accurate drop position below or above an index was needed. Therefore it was not that easy to do. This patch increases the above/below area to be about 18% of the item (still leaving the most space for the item). An average user will likely be 2-3x faster with dropping below or above (while not losing much when dropping on items). [ChangeLog][QtWidgets][ItemViews] Made it easier to drop above and below items. Change-Id: I47f0f80c76878c17ebf3f93d0a0cc82755971c2a Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * | Doc: qtwidgets index page: wrong name for image fileNico Vertriest2017-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | windowsvista-treeview.png --> windows-treeview.png Change-Id: I19ccec1ff5fadf2107ad47109d65f170df4b0505 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * | Doc: correct filename png filesNico Vertriest2017-10-182-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | qpushbutton.h:55: warning: Missing image: windows-pushbutton.jpg widgets.qdoc:28: warning: Missing image: windowsvista-treeview.png Change-Id: I2ebf2aa809f8d532f597624f6ed2f9d636e860a6 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * | Doc: replace screenshot widgets tutorial with more updated versionNico Vertriest2017-10-181-0/+0
| | | | | | | | | | | | | | | Change-Id: I2b4fcd02c13fcd6569ebf035197da361aba40afd Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>