summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* QMenuBar: Add overloads of addAction() using Qt 5 signals and slotsAnton Kudryavtsev2018-01-062-0/+62
| | | | | | | [ChangeLog][QtWidgets][QMenuBar] Add overloads of addAction() using Qt 5 signals and slots Change-Id: Ief21974213b80111f0ca87df490eb72dd6b9c9b9 Reviewed-by: Martin Smith <martin.smith@qt.io>
* QStyledItemDelegate: adjust editor geometry also in LTR-modeChristian Ehrlicher2018-01-061-5/+6
| | | | | | | | | | | The editor geometry was adjusted to a proper size in RTL-mode, but not in LTR-mode. To fix this inconsistency, the geometry is now also adjusted in LTR-mode to make sure the editor has enough space for the min/max values for the given datatype. Task-number: QTBUG-37433 Change-Id: Iff41e854f2fa2104ab5c589d24780facc3ed5815 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QHeaderView: respect min/maximumSectionSize propertyChristian Ehrlicher2018-01-061-3/+40
| | | | | | | | | | | | | QHeaderView::resizeSection() did not check if the given section size is inside the min/max property bounds. Also on calling setMin/MaximumSectionSize() the current section sizes were not checked if they are inside the new given bounds. This is a small behavior change when a user is setting the section size via resizeSection() without respecting the min/maxSectionSizes. Task-number: QTBUG-64173 Change-Id: Ia9c9eebf058d60c776ab5f8f8336642013ec553f Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Add an option to scroll the QComboBox on macOS with the mouse wheelAndy Shaw2018-01-054-5/+13
| | | | | | | | | | | | | | | | | | Since there may be some applications that want to make their comboboxes scrollable or not with the mouse wheel then a style hint is added to make this toggable. It defaults to true for all platforms except macOS to keep it in line with existing behavior. [ChangeLog][QtWidgets][QStyle] Added SH_ComboBox_AllowWheelScrolling as a style hint to enable/disable the use of the mouse wheel in a QComboBox. This defaults to true in all styles except the macOS one so there is no change in existing behavior. Task-number: QTBUG-53094 Change-Id: I6eb61e1990bfc79e3b3ea82d7b91ee39096fa077 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QtWidgets: Raise minimum supported MSVC version to 2015Friedemann Kleint2018-01-042-7/+3
| | | | | | | | Remove code for older versions and streamline #ifdefs. Task-number: QTBUG-51673 Change-Id: I2ba95bde2b8bbcca1833dc14c344b9a14394bc1d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-041-1/+1
|\ | | | | | | Change-Id: I644cd82b0d952b7d139e0228bf5017f147db77e7
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-041-1/+1
| |\ | | | | | | | | | Change-Id: I3fa5c9e216201bdf7da260c395f65d7fb95cba0b
| | * QTreeView: Fix QTreeViewPrivate::itemAtCoordinate()Christian Ehrlicher2018-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTreeViewPrivate::itemAtCoordinate() did not calculate the correct item when non-uniformRowHeights is enabled and vertical scroll mode is ScrollPerPixel. This results e.g. in an activation of the item above when the click happens on the very first pixel line of an item. Another, more problematic effect was that once a drop happened on the very first line of an item, QAbstractItemViewPrivate::dropOn() calculated the root as the drop index because the visualRect of the calculated item is compared with the drop position which did not match. Task-number: QTBUG-57538 Change-Id: If89571bf0fb76fc01d60ba7139f1d985b49d70db Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | | QTreeWidget: fix visualItemRect()Christian Ehrlicher2018-01-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTreeWidget::visualItemRect() returned an invalid QRect when a column was moved and then hidden (or the other way round). The reason was that the logical index returned by QHeaderView::logicalIndexAt() was again passed to QHeaderView::logicalIndex() to create the QModelIndexes needed for QTreeView::visualRect() Task-number: QTBUG-28733 Change-Id: I8676f21bcab8c05c2260b85d483902f18cbf3e24 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | | QToolButton: adjust menu indicator in RTL-modeChristian Ehrlicher2018-01-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The menu indicator was not adjusted in RTL-Mode to be on the left side of the text. Use visualRect() to adjust the rectangle before drawing the PE_IndicatorArrowDown. Task-number: QTBUG-50084 Change-Id: I20129499f111d06637c98ede23b4635a3fc34a6c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | QItemViews: Add ability to show QJsonValue::Bool/DoubleChristian Ehrlicher2018-01-031-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Q(Tree|Table|List)View was able to display a simple QJsonValue::String, but not QJsonValue::Bool/Double. This is an inconsistent behavior which is fixed with this patch. Task-number: QTBUG-65082 Change-Id: I22c2fe2890f11e283cae4f7ea947aa67ff36f367 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.10' into dev" into ↵Liang Qi2018-01-0217-179/+272
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/5.10' into devLars Knoll2018-01-0217-179/+272
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf sc/corelib/io/qfsfileengine_p.h src/corelib/io/qstorageinfo_unix.cpp src/platformsupport/eglconvenience/qeglpbuffer_p.h src/platformsupport/input/libinput/qlibinputkeyboard.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/ios/qiosscreen.h src/plugins/platforms/ios/qioswindow.h src/plugins/platforms/ios/quiview.mm src/printsupport/dialogs/qpagesetupdialog_unix_p.h src/printsupport/dialogs/qprintpreviewdialog.cpp src/printsupport/widgets/qcupsjobwidget_p.h src/widgets/widgets/qmenu.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
| | * | Merge remote-tracking branch 'origin/5.9' into 5.10Lars Knoll2017-12-3014-175/+267
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/win32-g++/qmake.conf src/corelib/global/qglobal_p.h src/corelib/global/qoperatingsystemversion_p.h src/corelib/io/qfilesystemengine_win.cpp src/network/bearer/qbearerengine.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/sql/doc/snippets/code/doc_src_sql-driver.cpp src/widgets/kernel/qwidget_p.h src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qfusionstyle.cpp tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp Change-Id: I80e2722f481b12fff5d967c28f89208c0e9a1dd8
| | | * QGestureManager: fix UB (invalid pointer comparison)Marc Mutz2017-12-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Comparing pointers with op< that do not point into the same array is UB. Fix, in the usual way, by using std::less. Change-Id: Id2c957557719887b2016632d683dbab8af07b34c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Widgets: check if parent exists before calling parent->locale()Richard Moe Gustavsen2017-12-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a top level, parentless widget has Qt::WA_WindowPropagation set, Qt will crash when trying to resolve the widgets locale. The reason is that we try to access the QLocale of the non-existing parent. This patch will add a check if a parent exists before trying to access it. Task-number: QTBUG-61213 Change-Id: I09a6351a12dc1fffab3069b70e3d7b3932317c85 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | | * Prevent infinite relayout when adding scrollbarsAndy Shaw2017-12-182-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When one scrollbar is added, this may cause the other to be needed as well. This change does a second calculation immediately instead of relying on a signal through a QueuedConnection. Task-number: QTBUG-62818 Task-number: QTBUG-56280 Change-Id: Iee9a083e3a6cd3765e6bb9206687a8a6e7f99cff Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
| | | * QTreeView: Make sure QHeaderView is notified on layoutChanged()Christian Ehrlicher2017-12-171-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QHeaderViewPrivate::_q_layoutChanged() was not called when used in a QTreeView because it was explicitly disconnected in setModel(). The disconnect was added sometime prio to Qt 4.3, but there the signal was connected to the doItemsLayout() slot. This was correct since QTreeView::doItemsLayout() is calling header->doItemsLayout(). In Qt 4.3.0 _q_layoutChanged() was introduced and the disconnect was adjusted. But since _q_layoutChanged() is doing much more than doItemsLayout() (e.g. restoring hidden sections), functionality was lost. The problem was already observed for Qt 4.6 (QTBUG-18196) but only partially fixed. Task-number: QTBUG-41124 Task-number: QTBUG-54610 Change-Id: Id13a9930d0163812e12a0287016bab9c3aa02068 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
| | | * QStyleSheetStyle: Draw menu item also when font is setFriedemann Kleint2017-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-64055 Change-Id: I0674e7b43bb56aa1834c8df10794714dbcc4e5e3 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| | | * QFileSystemModel: Enable experimental code path for per-file watchingFriedemann Kleint2017-12-142-18/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFileSystemModel had a #ifdefed out experimental code path for watching single files to track changes in size, which got outdated over time. Replace the #ifdef 0 by a check for the environment variable QT_FILESYSTEMMODEL_WATCH_FILES, fix it up and apply some fixes to related code to make it work: - Split file names signaled by QFileSystemWatcher on '/' always. - Do not instantiate QDirIterator on "", which means "current directory" and results in mixed-up directories. - Check on lastModified() in QExtendedInformation::operator==() so that changes trigger an update in _q_fileSystemChanged(). - Fix the #ifdefed out part to compile and not to add directories to the watcher. [ChangeLog][QtWidgets][QFileSystemModel] It is now possible to enable per-file watching by setting the environment variable QT_FILESYSTEMMODEL_WATCH_FILES, allowing to track for example changes in file size. Task-number: QTBUG-46684 Change-Id: Ia5da9170866416c9529251f889814b23d7a7d069 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | | * Share QWidget update and repaint code for QRect and QRegionTor Arne Vestbø2017-12-142-46/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWidgetBackingStore::markDirty has an optimization for QRect, so we don't want to unify these two functions by calling update/repaint(QRegion(rect)). Change-Id: Id2a42f478f71863da45697041e0ab0130c74b9d2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * QWidget: Remove dead code for handling painting without a backingstoreTor Arne Vestbø2017-12-141-49/+18
| | | | | | | | | | | | | | | | | | | | Change-Id: Iacf852c8620ea06d790cddcf6774b772f754e08a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * Teach QPlatformWindow about safe area margins and implement for iOSTor Arne Vestbø2017-12-133-30/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The safe area margins of a window represent the area that is safe to place content within, without intersecting areas of the screen where system UI is placed, or where a screen bezel may cover the content. QWidget will incorporate the safe area margins into its contents margins, so that they are are never smaller than the safe area margins. This can be disabled by unsetting the Qt::WA_ContentsMarginsRespectsSafeArea widget attribute, which is set by default. QLayouts will automatically use the contents area of a widget for their layout, unless the Qt::WA_LayoutOnEntireRect attribute has been set. This can be used, along with a contents margin of 0 on the actual layout, to allow e.g. a background image to underlay the status bar and other system areas on an iOS device, while still allowing child widgets of that background to be inset based on the safe area. [ChangeLog][iOS/tvOS] Qt will now take the safe area margins of the device into account when computing layouts for QtWidgets. Change-Id: Ife3827ab663f0625c1451e75b14fb8eeffb00754 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * Set sharedPainter correctly for QGraphicsEffectLaszlo Agocs2017-12-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Autotest is taken from the previously reverted 8b1377fde16a2049a1c27f6d005bff84a8f85f28. Task-number: QTBUG-60231 Change-Id: I44dd79cba22b6baefdd6d95c176790bef0b7eafe Reviewed-by: Andy Nichols <andy.nichols@qt.io>
| | | * QHeaderView: Use correct font for drag'n'drop indicator pixmapChristian Ehrlicher2017-12-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QHeaderViewPrivate::setupSectionIndicator() did not honor the font set for the QHeaderView which results in a wrong font in the indicator pixmap. Fix it by using the correct font for the dragged section as it is done in paintEvent() Task-number: QTBUG-65017 Change-Id: I5393c6861073de22f30ffa13e12c5e2cf8aa7776 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * QHeaderView: Fix painting vertical headers in rtl modeChristian Ehrlicher2017-12-121-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In rtl mode, the headers were not painted correctly. The style option selectedPosition was not filled correctly and the paint rect needed to be adjusted by one pixel to fit the table grid. Task-number: QTBUG-56520 Change-Id: Ib92d5ab6ff730bba67eca35c83cd638e613f58b9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * QFileSystemModel: properly align file size columnChristian Ehrlicher2017-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The file size column was not properly horizontally aligned. The model only returned Qt::AlignRight with no horizontal alignment. This lead to a top alignment within QStyle::alignedRect(). Task-number: QTBUG-64098 Change-Id: Iaef30200a63bd0975c88a67d0af2eb1d5254f588 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * QWidgetResizeHandler - undo (potential) move breakThorbjørn Lund Martsum2017-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the mode is center we are typically moving the dock widget, but we should however not stop if the mode is Center. Though the regression (in commit e662b4ed721ee36f0a17cc413494b7d09395d52e) is not easy to reproduce it is clear that the code later may call "mouseMoveEvent(e)" and the mode is also checked for being Center and in that case the eventfilter (function) returns true (not false). Change-Id: I3936ec56833d613f78920d9ccf8ddb66e19e9802 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | * QFileSystemModel::index(): Add a list size checkFriedemann Kleint2017-12-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This prevents an out of range assert when monitoring directory with activity (for example, temp). Task-number: QTBUG-62841 Change-Id: Id3aa4098e9bbd665c7b17a667516885fa7c7f473 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Martin Rotter <rotter.martinos@gmail.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * QFusionStyle: fix the checkbox rendering in HiDPI situationYulong Bai2017-12-041-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Make the checkbox's box size hidpi scale-able. Making the size not only anchored to icon size, but also the menuItem's rect height in empty or too small icon cases. 2. Make the checkmark's pen width in propotion to the box's size to keep consistent visual effects among different dpi settings 3. Also make the radio button hidpi scale-able. Task-number: QTBUG-63576 Change-Id: I4369aaa18ee68908a26a118cf04292ee4c3e9847 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * | Merge remote-tracking branch 'origin/5.10.0' into 5.10Liang Qi2017-12-081-1/+3
| | |\ \ | | | | | | | | | | | | | | | Change-Id: I6dcf85067ec226136c207ea69ca9d66736c84db5
| | | * | Doc: Update the list of highlighted examplesTopi Reinio2017-11-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the list of highlighted examples for modules in qtbase, based on which examples have been updated to use C++11 features, the new signal/slot connection syntax, and documentation improvements. Not all the modules have highlighted examples yet as some of the work is still ongoing. Task-number: QTBUG-60641 Change-Id: If28d59c10ca1a30e5db408970f20159434ac94f8 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| | * | | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-12-051-2/+1
| | |\ \ \ | | | | |/ | | | |/| | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/quiview.mm Change-Id: I88384c70047391c75d9ff166c8d9881ff6751dbf
| | | * | QMenu: Corner case size fix (high DPI + multi screen)Thorbjørn Lund Martsum2017-11-291-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We always need to set the QMenu screen explicit also when it is about to be shown on the primary screen. The reason is QWidget::metric (called from style/sizeHint) may use qApp->devicePixelRatioF() when it does not know about the topLevelWindow. That may not be the same value as DPR on primary screen. It can be argued that it likely is a bug in QWidget::metric, but fixing that looks to be a somewhat dangerous behavior change. Task-number: QTBUG-59794 Change-Id: I6ed0e808aa31bee5b77c0e19ce61a77548fdbb38 Reviewed-by: Morten Kristensen <msk@nullpointer.dk> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
| | * | | Fix -Wclazy-connect-not-normalized in Windows codeFriedemann Kleint2017-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qwindowsxpstyle.cpp(289,35): warning: Signature is not normalized. Use void* instead of void * [-Wclazy-connect-not-normalized] qwindowsxpstyle.cpp(292,35): warning: Signature is not normalized. Use void* instead of void * [-Wclazy-connect-not-normalized] Change-Id: I773530452c0837c5066f9174c25ae37e57086e76 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* | | | | Add QHeaderView::setFirstSectionMovable(), useful for flat treeviewsDavid Faure2018-01-025-9/+48
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTreeView makes columns movable except for the first one (since Qt 5.0, see commit e0fc088c0c). This is indeed best for actual trees, but not when using QTreeView as a flat multi-column list (with no "root decoration"). Then it should be possible to move the first column. [ChangeLog][QtWidgets][QHeaderView] Flat treeviews can now allow the user to move the first column (like in Qt 4.x) using the new method QHeaderView::setFirstSectionMovable(). Change-Id: I6b5025e40850bf5c4c373124ee81f657f3f09d29 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | | | QHeaderView: properly connect rows/columnsMovedChristian Ehrlicher2017-12-223-11/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QHeaderViewPrivate reimplemented _q_layoutChanged() to handle changes of rows/columns via layoutChanged/layoutAboutToBeChanged. This worked fine for Qt4 but since Qt5 only the special signals rowsAboutToBeMoved/ rowsMoved are used for this (8021e2d5e7ccd09146896f788441c116f2ca6159). With this change, QAbstractItemViewPrivate::_q_rows/columnsMoved() is calling the virtual function _q_layoutChanged(). This resulted in a wrong call of QHP::_q_layoutChanged() for a horizontal header when a row changed and for a vertical header during a column change. In the end this can lead to an unhide of hidden sections. Task-number: QTBUG-54610 Change-Id: Ide4bfc5b24a97746fd1e5af82d3ba08257149157 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | QScroller: Fix deprecation warning about QDdesktopWidget:::primaryScreen()Friedemann Kleint2017-12-212-37/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In file included from ..\..\include\QtWidgets/qdesktopwidget.h:1:0, from kernel\qt_widgets_pch.h:71: ..\..\include\QtWidgets/../../src/widgets/kernel/qdesktopwidget.h:71:65: note: declared here QT_DEPRECATED_X("Use QGuiApplication::primaryScreen()") int primaryScreen() const; Use QScreen directly and remove the then unused function realDpi(). Change-Id: I526adb09ba35ed0699338d6a8d044c2ff9a03a1e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | | QScroller: maintain activeScrollers as a QList, not a QSetMarc Mutz2017-12-181-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The number of active scrollers is probably very low, so O(N) vs. O(1) search can be neglected, compared to the higher cost of allocating and iterating a QSet. The tipping point is that the public API uses QList, and the QSet needs to be converted toList() on each (external) access. Just use a QList. Change-Id: I5f0b37761923dc94d6dbbbf92973da73f5335e4a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | | Fix persistence of custom colors palette in QColorDialogSerge Lysenko2017-12-081-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QColorDialog does not save custom colors after application relaunching, if those colors were changed with drag'n'drop Task-number: QTBUG-64500 Change-Id: I8ba6e1ef4e078f7b93463e7b20c9e21659d4777e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | | Update usage of QFontMetrics::width() to new APIEskil Abrahamsen Blomfeldt2017-12-0824-47/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFontMetrics(F)::width() has been deprecated and is replaced by horizontalAdvance(). This updates all usage of it in tests and documentation. It is worth noting that many or most of the usages of QFontMetrics::width() probably intended to use boundingRect().width(), but since it currently works, I have not looked into that, just replaced the function name mechanically. Change-Id: Iec382e5bad0b50f37a6cfff841bfb46ed4d4555f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | | doc: Add class qualifiers to parameter typesMartin Smith2017-12-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change supplies several missing class qualifiers for parameter types and function return types. Change-Id: I569026e4da0948902fcc13557003d3748b85dd82 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | | doc: Document remaining anonymous enumsMartin Smith2017-12-062-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds qdoc comments for the remaining nameless enum types. Change-Id: I4da8b67883c8020323437cf74c938d3655d8c384 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | | Revert "QApp: Method to check for native style usage."Alexander Volkov2017-12-012-28/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 958a4c9087e03502d0173735df4611a7f96a0463. QApplicationPrivate::usesNativeStyle() introduced by that commit was never used. We have an untested method that is furthermore may return wrong results because it relies on the comparison 'app_style->objectName() != QApplicationPrivate::desktopStyleKey()', but not all styles set their object names. Conflicts: src/widgets/kernel/qapplication.cpp src/widgets/kernel/qapplication_p.h Change-Id: I48d221f9387381db9ed51a7a068bfd0a0c2ed58d Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
* | | | macx-clang: Opt-in xcb QPA support with XQuartzGabriel de Dietrich2017-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable xcb QPA plugin when XQuartz is available. This is done in a single build, alongside the Cocoa version. We delegate part of the configuration stage to pkg-config, so this becomes a requirement. Ensure that PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig is in your environment, or pkg-config is properly set up. Tested with the following configure options: configure \ -pkg-config \ -fontconfig -system-freetype \ -system-xcb -xkb -no-opengl \ -qt-xkbcommon -qt-xkbcommon-x11 Change-Id: I2eb5a0491172368afc4c629c540cbef08580348d Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | | Simplify date-time formatting in textForRole()Edward Welbourne2017-11-301-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QAbstractItemDelegatePrivate::textForRole() was formatting date and time separately, then gluing the parts back together with space. QLocale can do that just fine itself (it has a toString() overload that handles a QDateTime) and might even (some day) do it better. To my mild surprise, this proved sufficient to fix a problem with date-time display in tool-tips, when the date-time includes a zone. Extracted the date-time part of an existing selftest into a test of its own and extended it to test times of each spec-type; verified that the non-local spec cases of this all failed before this fix. Task-number: QTBUG-61069 Change-Id: I6d6be0c27be9a557d8afc3ced200a10b2aaff816 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | Raise the upper bound on years to 9999Edward Welbourne2017-11-302-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test-case taken from bug-report; fits in as an easy row in an existing data-driven test. Add similar tests for date-time and time; and an isValid test on the end of year 9999. The date-time parser was using the end of year 7999 as maximum value for dates and date-times; extend this to year 9999, as I can see no reason not to. [ChangeLog][QtCore][QDateTime] Years up to 9999 can now be parsed without error (previously 8000 and beyond were treated as invalid) in all formats (not only in ISO format). Widgets handling dates now support dates to 9999, likewise. Task-number: QTBUG-64401 Change-Id: I518cfa6c2cb4ecc5a85b896dc9e56b4fdd8a8bb1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | doc: document the anonymous enum type correctlyMartin Smith2017-11-301-12/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clangqdoc now accepts an unnamed enum type, calls it "anonymous" and allows it to be documented as a named enum type. In this update, several instances appear in subclasses of QGraphicsItem. This update documents them correctly. Change-Id: Ide8026801269154a37e7677a1ce62e0cb392efea Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* | | | 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>