summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into ↵Liang Qi2018-01-115-7/+30
|\ | | | | | | refs/staging/5.10
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-095-7/+30
| |\ | | | | | | | | | Change-Id: I840849c072075a69819eb185b20bc42c3de0f825
| | * Clarify behavior of setData in QListWidget, QTableWidget, and QTreeWidgetKavindra Palaraja2018-01-093-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setData()'s default implementation for QListWidget, QTableWidget, and QTreeWidget treats Qt::EditRole and Qt::DisplayRole as referring to the same data. Used the same sentence from QStandardItem::setData for consistency. Task-number: QTBUG-11549 Change-Id: I41d06bdaaa8e7d4a86e24147b3d8222ad7823a6c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| | * QFileSystemModel/Windows: Make file name checking case-insensitiveFriedemann Kleint2018-01-092-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a special hash modeled on the one used for QFileSystemWatcher on Windows. Task-number: QTBUG-31103 Task-number: QTBUG-64147 Change-Id: I69ebabe841716e4957ae3fb04fa5c43d233a3552 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | qtlite: Fix compilation of QWidgetLineControl when configured with ↵Rainer Keller2018-01-101-0/+2
|/ / | | | | | | | | | | | | | | no-feature-itemviews Task-number: QTBUG-53141 Change-Id: I00d9d7fc43a4531c9213281f529b2d0f3164a5c6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QStyleHelper: Use palette cache key in pixmap keyGabriel de Dietrich2018-01-051-20/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d7bcdc3a442b99c2caebd4cfd38de67e14090e05. Now that QPalette::setBrush() is a bit smarter (see c564779c071b35fddb76f4e50afda4305b634651), we can be confident the palette's cache key won't change so often. Therefore, we can use it again as part of every pixmap's cache key. Change-Id: I5cab2296a937f9149c7745291e0442eea24f4e9d Task-number: QTBUG-65475 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | 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>
* | 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>
* | | 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.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>