summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-1918-163/+217
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp src/network/access/qnetworkaccessmanager.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h src/widgets/widgets/qlineedit_p.cpp src/widgets/widgets/qlineedit_p.h src/winmain/winmain.pro tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp tools/configure/configureapp.cpp Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
| * Merge remote-tracking branch 'origin/5.6.1' into 5.6Liang Qi2016-05-191-1/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qnativesocketengine_winrt.cpp Change-Id: I8edb72f8ba958d80c3d7993b3feaaae782ca8d9c
| | * Doc: Remove repository name from examplesinstallpathTopi Reinio2016-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Examples in binary packages now directly match the install path. Change-Id: Ic1487bc766cfd3b0a0a340cc4ae4ba49d953eaa6 Task-number: QTBUG-52953 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * | QMenuBar: nested parenting fixFelix Bourbonnais2016-05-182-25/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMenuBar now receives a parent changed event for each of its parent, grand-parent, ... This fixes a crash caused by an invalid QWidget pointer and makes sure the keyboard shortcuts events are relayed to the menu bar in all parenting/re-parenting cases by installing an event filter on each parent Task-number: QTBUG-53205 Change-Id: I419e6cbc52e28a67fb08a848a7161b4cb8ae4ae5 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
| * | QWidget::mapTo/FromGlobal(): Rewrite using a QTransform.Friedemann Kleint2016-05-141-46/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a function going up the widget hierarchy determining a QTransform for mapping the coordinates applying the transformations of any QGraphicsView instances found. In mapFromGlobal(), use the inverse of it. This fixes the case of widget hierarchies embedded into QGraphicsView with transformations. Increase fuzz in the tests due to float rounding errors. Task-number: QTBUG-41135 Task-number: QTBUG-50030 Task-number: QTBUG-50136 Task-number: QTBUG-52507 Change-Id: I507e0bccd546250fe9c2d1b74ef38657d61490b4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | Remove dead code from QColorDialogThiago Macieira2016-05-141-29/+6
| | | | | | | | | | | | | | | | | | | | | Detected by GCC 6. Change-Id: I24a735698d3c4a719fc9ffff1425f193511406f9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | QLineEdit: Fix icons being too small on a High DPI screen without scaling.Friedemann Kleint2016-05-123-22/+52
| |/ | | | | | | | | | | | | | | | | | | | | Remove the hardcoded size 16 from QLineEditIconButton. Replace QLineEditPrivate::iconSize() by QLineEditPrivate::sideWidgetParameters() returning a struct SideWidgetParameters containing icon size, widget size and margins. The 32x32 icon will then be used on a High DPI screen without scaling. Task-number: QTBUG-49374 Change-Id: I23c4a0cd078a58581c940aacfa65a3ad493c12dc Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
| * Document how to save an application using QUndoStackMitch Curtis2016-05-111-0/+2
| | | | | | | | | | | | Change-Id: Ic61374d5b6ce395dfe8d0b30813ea437b5e16e9d Task-number: QTBUG-52497 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| * QFileSystemModel: create nodes with correct QFileInfosAlexander Volkov2016-05-101-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create parent nodes with the corresponding paths, not with the absolute path of the child node. Otherwise we will get incorrect QFileInfo at least in the following case: QFileSystemModel model; model.setRootPath("/usr/bin"); QModelIndex idx = model.setRootPath("/usr"); qDebug() << model.fileInfo(idx).absoluteFilePath(); Without the fix it prints "/usr/bin". It's a regression triggered by 61cefb2f7a7cb16dfa2732e26d2319017039ef62 (De-inline QFileSystemModel::fileInfo() and implement it efficiently). Change-Id: I3b4e5f5b256711e27ad50824eaa8492dbc096808 Task-number: QTBUG-51586 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * Acknowledge QWidgetWindow::widget() may be nullGabriel de Dietrich2016-05-103-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We guard QWidgetWindow's widget with a QPointer to avoid sending it events during destruction (which may result in undefined behavior, since this originates from ~QObject and we expect the object to behave as a QWidget). Therefore, we need to harden all access to that widget since it can now be null, specially during destruction. As an example, QGestureManager may crash when we delete a top-level widget. The crash stack trace is: 1 QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::data() const 2 QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::pointer qGetPtrHelper<QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>>(QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>> const&) 3 QWidget::d_func() 4 QGestureManager::filterEvent(QWidget *, QEvent *) <-- the widget ptr is null 5 QGestureManager::filterEvent(QObject *, QEvent *) 6 QApplication::notify(QObject *, QEvent *) 7 QCoreApplication::notifyInternal2(QObject *, QEvent *) 8 QCoreApplication::sendEvent(QObject *, QEvent *) 9 QWindow::destroy() 10 QWidgetPrivate::deleteTLSysExtra() 11 QWidgetPrivate::deleteExtra() 12 QWidgetPrivate::~QWidgetPrivate() 13 QWidgetPrivate::~QWidgetPrivate() 14 QWidgetPrivate::~QWidgetPrivate() 15 QScopedPointerDeleter<QObjectData>::cleanup(QObjectData *) 16 QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::~QScopedPointer() 17 QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::~QScopedPointer() 18 QObject::~QObject() 19 QWidget::~QWidget() Task-number: QTBUG-53103 Change-Id: I1bb32648270c4f7791f668b8f0b639ddb4235703 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * QWidgetWindow: Guard reference to own widgetGabriel de Dietrich2016-05-102-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ~QWidgetPrivate() may end up calling QWidgetPrivate:: deleteTLSysExtra() which, in turn, calls QWindow::destroy(). This sends an event to the window itself. This reaches QWidgetWindow::event() which will forward the event to the widget. However, the widget has just been deleted since the sequence was initiated by ~QObject(). Task-number: QTBUG-53103 Change-Id: Ib511714a76bbc1e734d6f2800a983eb1459bbf0b Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * QTableView: Fix selection for reordered or hidden rows/columnsVyacheslav Grigoryev2016-05-091-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code sometimes made incorrect selections when rows or columns were hidden or moved. It used logical top left and bottom right indexes to create a selection rectangle. However on moved or hidden cells a wrong rectangle was made. This fix calculates a simple rectangle without hidden cells and makes use of the row/column select functionality provided by the selection model, to make the right selection. [ChangeLog][QtWidgets][QTableView] Fixed a selection bug when rows or columns were hidden (QTBUG-50171) Task-number: QTBUG-50171 Change-Id: Id186012af26da7b2051ff5eb1c13e6b7494cca77 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
| * QAccessibleMenuItem: Implement QAccessibleInterface::window().Friedemann Kleint2016-05-062-0/+16
| | | | | | | | | | | | | | | | | | The window is required to be able to determine the correct scale factor for the screen when High DPI scaling is active. Change-Id: I8f776684396d055754093f62e0d33bd7e23cb52b Task-number: QTBUG-52943 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
| * QAccessibleWidget: Retrieve window from native parent widget.Friedemann Kleint2016-05-061-2/+8
| | | | | | | | | | | | | | | | | | | | Query the native parent widget if the widget does not have a window handle. The window is required to be able to determine the correct scale factor for the screen when High DPI scaling is active. Change-Id: Ibaf5e8e7b07327ea635d2f726acea76c2c95bda3 Task-number: QTBUG-52943 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | Doc: corrected issues with non-existing image filesNico Vertriest2016-05-181-3/+3
| | | | | | | | | | | | | | Changed gtk- into fusion- in image file names Change-Id: I8d7beeda1f705aa4bb8ce53fd7189c2fca56fa62 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* | QWidgetTextControl: ensure we listen for changes to cursorFlashTimeChangedRichard Moe Gustavsen2016-05-092-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 3cdc02d actually "reverted" the behavior of listening for cursorFlashTimeChanged. The reason is that we sat "blinkingEnabled" directly to true in the constructor instead of calling "setCursorBlinking", which was responsible for setting up the connection. And as it turns out, after 3cdc02d, nobody is actually calling "setBlinkingCursorEnabled" anymore. From the widgets point of view, it should always blink when visible (unless QPA sets cursorFlashTime to zero). So we can remove the whole function, and set up the connection in "setVisible" instead. Change-Id: I577a5fbbbd9c56331ac7f8bb38567a684ca8c1df Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | Remove includes to qdatetime_p.h that aren't necessaryThiago Macieira2016-05-081-1/+0
| | | | | | | | | | | | | | | | Since I'm changing QDateTime's privates, it's easier to know what may be depending on it or not. Change-Id: Id5480807d25e49e78b79ffff144a53018d057e19 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-061-1/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/qtestlib/tutorial5/containers.cpp examples/widgets/tools/tools.pro src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/network/kernel/qdnslookup_unix.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp tools/configure/configureapp.cpp Change-Id: I838ae7f082535a67a4a53aa13a21ba5580758be8
| * QSplitter: Add note about ownership transfer to addWidget() and insertWidget()Stephan Binner2016-05-041-1/+5
| | | | | | | | | | Change-Id: I971db2c25e4e667a416f58d148e18c4f11c349f1 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Add Qt::ImInputItemClipRectangle support to widgetsJan Arve Saether2016-05-023-2/+15
| | | | | | | | | | | | | | | | Let widgets respond to ImInputItemClipRectangle inputMethodQuery and notify about potential changes with QInputMethod::update() Change-Id: I01b2c53273df207d26107b237a7096fe53d1b0a5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* | Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7Liang Qi2016-05-028-16/+17
|\ \
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-298-16/+17
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qml_module.prf mkspecs/features/qt_common.prf src/gui/text/qzip.cpp src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/windows/array.h src/testlib/qtestcase.cpp src/widgets/dialogs/qfilesystemmodel.h Change-Id: Ie41c5868415b81f7693c80e045497035504bb210
| | * Fix scroll regression near scroll-view endsAllan Sandfeld Jensen2016-04-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix regression in a7b0cb467ca5c4a9447d049910c9e3f0abc5897c which caused it to be hard to start scrolling at the ends of a scroll-view if using fine grained scrolling events. Change-Id: I55f3210150b993281545c3ad5a7356d892fa30b5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| | * qstyle: Make image description match the image.Sérgio Martins2016-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | | The image shows 9 combo boxes, not 8. Change-Id: If229332e1708f624ad9f50fab0b78c011d94f31e Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
| | * Unhide QObject::parent() from QFileSystemModel and QIdentityProxyModelAlexander Volkov2016-04-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was hidden by overridden parent(const QModelIndex &) methods. See also 63b5082ea8e3e750af986f815474f7207006cb46 (Unhide QObject::parent() from QAbstract{Table,List}model). Change-Id: I8b6d4d4175e4d43ff269eaeb0b2b1a9fb8f44bab Task-number: QTBUG-45393 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * Fix clang developer build due to -Winconsistent-missing-overrideSérgio Martins2016-04-281-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The existing code keeps the overrides from each base class together, so also move them to the correct group after adding Q_DECL_OVERRIDE. Change-Id: I5d89fb4e7f9454ab0c9c6383f8245e64b95e84e9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QFileDialog: Fix single-click activationPalo Kisa2016-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QFileDialogPrivate::_q_enterDirectory() the QStyle::styleHint() for QStyle::SH_ItemView_ActivateItemOnSingleClick was called w/o the widget. By such usage the possible StyleSheet setting was ignored, e.g. "QAbstractItemView { activate-on-singleclick: 1; }". Task-number: QTBUG-50871 Change-Id: I7a32c4841db7113f32c3823581c2becc1677e3cc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * Change scroll and text areas to respect native wheel focus ruleMarko Kangas2016-04-263-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtWidgets][QAbstractScrollArea,QTextEdit,QPlainTextEdit] Changed focus to Qt::StrongFocus. That respects platforms' native guidelines. Task-number: QTBUG-52559 Change-Id: I2aa25d25bbc15facce85ceb7d4a4c1d0ac7df962 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QWidgetTextControl: only show cursor when having focusRichard Moe Gustavsen2016-04-302-6/+18
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d3dcc6f introduced a regression to QTextEdit, leaving it to always show the cursor regardless of focus. The reason is that QTextArea used to toggle visibilty by setting the cursor blink rate. What it really wanted to do was to set cursor visibility explicit. This patch implements function setCursorVisible, and updates the places that used to call setBlinkingCursorEnabled to instead call setCursorVisible (where it makes sense). Change-Id: I58ea965178d4faaf5b09f6f6a37a37d5e8b99c97 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-275-52/+96
|\| | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_win.cpp src/widgets/itemviews/qheaderview.cpp Change-Id: I0a59ade9cd6e91f770fdf298a7d72a41e79fd761
| * QWindowsVistaStyle: Fix CE_MenuBarItem with QStyleSheetStyle.Friedemann Kleint2016-04-231-1/+1
| | | | | | | | | | | | | | | | | | Do not paint over CE_MenuBarItem when the palette is set to transparent by QStyleSheetStyle. Task-number: QTBUG-49115 Change-Id: Ib364017179d0852490daad094361eae0ead4fd5f Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
| * QFileSystemModel: fix updating QFileInfo for a node after a file renameAlexander Volkov2016-04-221-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the correct parent path for the renamed file when creating QFileInfo. It must be a path to the parent directory, not to the root directory of the model. Modify tst_QFileSystemModel::setData() to test renames in subdirs of the root directory of the model. Change-Id: I69d9e3a937616857a81617791ed118af3f6eea05 Task-number: QTBUG-52561 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * Fusion style: Observe text alignment of QGroupBox.Friedemann Kleint2016-04-221-1/+17
| | | | | | | | | | | | | | | | Take alignment into account in QFusionStyle::subControlRect(). Task-number: QTBUG-49068 Change-Id: Ia8f2d06c46b24761bff537247bbadd3323e41fa9 Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
| * QWidget::grab(): Use device pixel ratio.Friedemann Kleint2016-04-221-1/+3
| | | | | | | | | | | | | | | | | | | | Return pixmaps with device pixel ratio similar to QScreen::grabWindow(), cf c0963486ce689e778d59dafd26d36d8ef9e3ee74. Adapt kernel tests accordingly. Task-number: QTBUG-52137 Change-Id: I9ce276d5e2d87ae0d39c8639267d1ac283fed854 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * QHeaderView: fixing selection of reordered rows and columnsVyacheslav Grigoryev2016-04-211-48/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code incorrectly calculated visual region for a selection (specified by QItemSelection object) in case of reordered / swapped rows or columns. It used the leftmost and rightmost (upmost and downmost for vertical mode) logical indexes directly. However some middle logical index (in case of reorder) may be the leftmost or rightmost visual index. In such cases the repainting didn't work properly. This fix first checks whether reordering / swapping is in use. If it isn't (ie visual=logical) we use code similar to the old code. Otherwise the new code scans all selected logical indexes, translates them into visual ones and gets the correct leftmost and rightmost indexes. [ChangeLog][QtWidgets][QHeaderView] Fixed a repainting issue when items had been reordered. Task-number: QTBUG-50171 Change-Id: If6afabebf445cf32a8e0afe262b6ee149e7c4b2b Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7Liang Qi2016-04-268-85/+96
|\ \
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-258-85/+96
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/compile.test configure src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java src/corelib/global/qglobal.cpp src/widgets/kernel/qapplication.cpp src/widgets/styles/qwindowsvistastyle.cpp tests/auto/corelib/kernel/qobject/tst_qobject.cpp Change-Id: I067083f34e5290aa5f7565e40c30a069cc37b83a
| | * QMacPinchGestureRecognizer - fix totalScaleFactorTimur Pocheptsov2016-04-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set totalScaleFactor on a pinch gesture (OS X) so that it works the same way as in 'standard' gesture recognizer and corresponds to what we document. [ChangeLog][QtWidgets] : QPinchGesture on OS X now behaves like on other platforms: totalScaleFactor is the magnitude of the pinch and scaleFactor is the delta for the current event. Task-number: QTBUG-48138 Change-Id: I66b9a1df05cbe106b76aed8f15d900bcdd41fdb7 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| | * QMessageBox: Try to pass window handle to QIcon::pixmap().Friedemann Kleint2016-04-201-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Try to find a window handle so that the pixmap matching the device pixel ratio of the screen can be found. Task-number: QTBUG-52622 Change-Id: Iccf3cea82065af5e055d3cd932cd0808b29b15dc Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
| | * QWindowsXPStyle: Enlarge QLineEdit/QComboBox when High DPI scaling is active.Friedemann Kleint2016-04-191-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QWindowsXPStyle::sizeFromContents(), scale the margins using the devicePixelRatio and round the height up. Typically increases the height by 2 pixels when the device pixel ratio equals 2. Change-Id: I446ad518c3808a6454a08db7b66a942d37c1703f Task-number: QTBUG-49374 Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
| | * QTabBar: Fix crash when the tab being dragged is deleted programmatically.Friedemann Kleint2016-04-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Call QTabBarPrivate::moveTabFinished() from QTabBar::removeTab() to cancel any drag in progress to prevent crashes due to invalidated indexes. Task-number: QTBUG-52527 Change-Id: I5bd8cc6f55e5aea1f1a4710494ba5b92939a42ee Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QWindowsXP/VistaStyle: Move the Vista treeview handling to ↵Friedemann Kleint2016-04-184-76/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWindowsXPStylePrivate. QWindowsXPStylePrivate maintains a list of theme handles for various style items. The derived class QWindowsVistaStylePrivate had logic to use a special helper window with the "explorer" window theme set to obtain the correct treeview arrow branch indicator (arrow shape for Vista as opposed to '+'/'-' on Windows XP) when creating the "TREEVIEW" theme. This required calling the helper function QWindowsVistaStylePrivate::initTreeViewTheming() before QWindowsXPStylePrivate::createTheme(), which is prone to errors and initialization order issues. This could be solved by making QWindowsXPStylePrivate::createTheme() virtual or similar, but since it the fate of QWindowsXPStylePrivate is most likely to be merged into QWindowsVistaStylePrivate; it was decided to move the entire special handling of the Vista treeviews into QWindowsXPStylePrivate. The existing enumeration value QWindowsXPStylePrivate::TreeViewTheme is renamed to QWindowsXPStylePrivate::XpTreeViewTheme and a new value QWindowsXPStylePrivate::VistaTreeViewTheme is added for which QWindowsXPStylePrivate::createTheme() invokes the special handling. This also removes the need to destroy the helper window in unpolish(), which should save some initializations. Task-number: QTBUG-52230 Change-Id: I0492ecf38fb3e5eabc4ecbdef70f0bf05e82e104 Reviewed-by: Adam Light <aclight@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| | * Fix detection of the proxy base style when QT_STYLE_OVERRIDE is setAlexander Volkov2016-04-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QProxyStyle checks QApplicationPrivate::styleOverride but ignores QT_STYLE_OVERRIDE when it is trying to detect the name of the base style. Set styleOverride from QT_STYLE_OVERRIDE to make it work. Thus there is no need to check QT_STYLE_OVERRIDE from multiple places. Change-Id: I2a64b5ff5443701f800ef5d2a9cb425068f909f1 Task-number: QTBUG-52596 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QWidgetTextControl: respect run-time changes to cursorFlashTimeRichard Moe Gustavsen2016-04-252-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cursorFlashTime will now change dynamically from QPA while platform controlled text selection (on mobile) is ongoing. This patch will therefore update QWidgetTextControl so that it listens to the cursorFlashTimeChanged signal and changes the blinking rate when triggered. Change-Id: I89bdfaab0e93d1d055baba6b132a7911d2ae84f6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | | Darwin: set SH_BlinkCursorWhenTextSelected to false on DarwinRichard Moe Gustavsen2016-04-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When text is selected on e.g iOS or OS X, the cursor should not blink (or be visible), regardless of style. Note that SH_BlinkCursorWhenTextSelected is actually implemented to mean "hide cursor when text selected" in e.g QWidgetTextControl. If this is a bug or not is hard to say, but it is anyway the desired behavior on Apple platforms. Change-Id: I541dabbe1945c266107ba39e3adb006bec0258bf Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | | QWidgetLineControl: respect run-time changes to cursorFlashTimeRichard Moe Gustavsen2016-04-253-28/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cursorFlashTime will now change dynamically from QPA while platform controlled text selection (on mobile) is ongoing. This patch will therefore update QWidgetLineControl so that it listens to the cursorFlashTimeChanged signal and changes the blinking rate when triggered. The previous code had a function setBlinkingRate, which is now changed to setBlinkingCursorEnabled (like in QWidgetTextControl). This is because all callers of the function did either pass "QApplication::cursorFlashTime" or "0", which basically means enable or disable blinking. This moves the control of the blinking rate fully to QWidgetLineControl, which simplifies the code a bit, especially when cursorFlashTime can change. Note that when setting a blink period to 0, it means "show the cursor without blinking". AFAICS, the current implementation did not guarantee that. This is now made more explicit in the code. If hiding the cursor is needed, a separate function "setCursorVisible" is already available for controlling that. Change-Id: I7d39882de192a23e6e7ba370749892c7702c3d3b Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | | Android: don't iterate over .keys()Marc Mutz2016-04-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | ... iterate over the container itself instead. Avoids temporary QList creation as well as the lookup cost when actually calling value(key). Change-Id: I63a11e6f8f19919145ea142309ddbacd99c3bfc3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Android: eradicate Q_FOREACH loops [needing qAsConst()]Marc Mutz2016-04-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(). Change-Id: I9158c507f9249a7322b11c982bfcab1e6ed4a38a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Android: eradicate Q_FOREACH loops [already const]Marc Mutz2016-04-251-9/+9
|/ / | | | | | | | | | | | | | | | | ... (or trivially marked const) local variables, parameters, or data members with trivial loop bodies, by replacing them with C++11 range-for loops. Change-Id: I25e9e2148abd7676305ebd18754dc647f217e48b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QtWidgets: Fix qdoc warnings related to inputMethodQuery().Friedemann Kleint2016-04-212-1/+5
| | | | | | | | | | | | | | | | | | | | Mark the overloads taking an additional QVariant as \internal as (cf QTextEdit) and the overridden functions as \reimp. Amends change ab67a5b7b631709aae779c767a903b8982fa7f8e, fixes warnings: qtbase/src/widgets/widgets/qlineedit.cpp:1755: warning: Cannot find base function for '\reimp' in inputMethodQuery() / Change-Id: I9949bf3850ab4200ee500cbe33a44faacecc30b0 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>