summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Remove some #if 0 blocks from API headersEdward Welbourne2016-11-231-3/+0
| | | | | | | Noticed in API review for 5.8 release. Change-Id: I1dd48c676924048c32fab8307868cf61915df131 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-161-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/common/linux-android.conf src/gui/opengl/qopengl.h src/network/socket/qnativesocketengine_winrt.cpp src/network/socket/qnativesocketengine_winrt_p.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/api/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp sync.profile Change-Id: If70aaf2c49df91157b864cf0d7d9513546c9bec4
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-151-0/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/plugins/platforms/eglfs/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp Change-Id: Id2da7c775439adb62646d5b741ee7c638042b34b
| | * QLabel: take DPR of QMovie in account when calculating sizeHintDaniel Vrátil2016-11-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QLabel already does that for QPixmap, so just do the same for QMovie's current pixmap. Task-number: QTBUG-48157 Change-Id: I7b26460f778e56ff017a5efd433f8929f30e4b41 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | QComboBox: Prioritize the model font for popup itemsGabriel de Dietrich2016-11-101-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Mac, we use QComboMenuDelegate specifically as item delegate for the popup list. It happens that the order of resolving the font for each item individually would prioritize QComboBox's font instead of whatever the assigned model's FontRole would specify. The fix only requires checking whether FontRole is valid before falling back QComboBox's properties. Change-Id: I7208ad1911b30cc52c826c1884a1e19f5acd9fb4 Task-number: QTBUG-56693 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | Fix misspelled QT_NO_ featuresPaul Olav Tvete2016-11-091-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: I77ca4139cb8437b781f082195bf4c92034f55512 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Replace custom type traits with std one'sKai Koehne2016-11-082-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove most type traits from qtypetraits.h, but keep the custom implementation of is_signed/is_unsigned. This gets rid of BSD-3 licensed code from Google in a public header (hugh!). The custom implementations for is_signed/is_unsigned are kept because the implementations in gcc's standard headers do not work as we expect for enums - both is_signed and is_unsigned always returns false there - see also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59027 [ChangeLog][QtCore][General] Qt now relies on type traits from the C++ standard library. Change-Id: I3f2188b46949f04ca4482a6ac9afd3482103f0e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-082-2/+5
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qalgorithms.h Change-Id: Ib8ce4d5d9ecd5b9c166d5b8b44e58f3e4e7283ff
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-042-2/+5
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/json/qjsonparser.cpp src/gui/opengl/qopengl.cpp Change-Id: Ib4d3208398399691839e6c6eaeb9006f99e3a62b
| | * Mention QDialog::setSizeGripEnabled() in QSizeGrip's docsSergio Martins2016-11-021-1/+4
| | | | | | | | | | | | | | | | | | | | | The same way it also mentions QStatusBar. Change-Id: Ic084466310c989d1a79ba5ba21d6784acaa38e6e Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
| | * QMainWindow: fix wording in apidocFrederik Schwarzer2016-10-311-1/+1
| | | | | | | | | | | | | | | Change-Id: I5cb44bed7e946574eb3e08ff51948f901b2bb78c Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-016-7/+32
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/win/msvc_version.cpp configure.pri mkspecs/macx-ios-clang/features/default_post.prf mkspecs/macx-ios-clang/features/resolve_config.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/resolve_config.prf src/corelib/io/qsettings_mac.cpp src/corelib/json/qjsondocument.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.h src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro src/plugins/platforms/ios/qiosintegration.h src/plugins/platforms/minimalegl/qminimaleglintegration.cpp tests/auto/gui/painting/qpainter/tst_qpainter.cpp tools/configure/environment.cpp Change-Id: I654845e54e40f5951fb78aab349ca667e9f27843
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-311-2/+4
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/minimalegl/qminimaleglintegration.cpp Change-Id: Ia6ab42a6daadbf8abc085c971545904d49ea4b56
| | * Fixed crash taking null central widgetAndré Somers2016-10-281-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When no central widget has been set, calling takeCentralWidget should just return a null pointer instead of crashing. [ChangeLog][QtWidgets][QMainWindow] Fixed crash using takeCentralWidget when the central widget was not set. Task-number: QTBUG-56628 Change-Id: I240ccf4caa41d2716a78851571fbfbf444a4922e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-271-0/+3
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.h src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileenginefactory.h src/plugins/platforms/ios/qiosintegration.h src/widgets/widgets/qcombobox.cpp tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp Change-Id: Ibaee7cbbba99e7c4b1d8926e55932ffa6030ce45
| | * QComboBox: fix build with GCC 7Marc Mutz2016-10-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 7 warns about implicit fall-throughs now. Fix by adding the missing comments. Interestingly, Coverity only found one of them, even though all three still exist in dev, too. Change-Id: I9f2c5e2700d5ec5234fee3a532feffe01b7c4ce3 Coverity-Id: 11156 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-221-1/+6
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/eglfs/qeglfshooks.cpp Change-Id: I483f0dbd876943b184803f0fe65a0c686ad75db2
| | * macOS: Don't override the set tab text color with whiteAndy Shaw2016-10-191-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally on macOS it would override any tab text color with white for the active tab as it would set it directly on the option palette inside the style code. This would cause it to ignore any changes done by the user in a changed option, via setTabTextColor or in a proxy style. Therefore the setting of the color should be done when the style option is initialized and only if the tab text color has not been set by the user. This has the added effect of making it easier to change the color for tabs via a stylesheet since it will not be overridden in the style but setup correctly in the option instead. Change-Id: Ic338e96470112cba71d422bce79e664df0cb188a Reviewed-by: Jake Petroules <jake.petroules@qt.io>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-171-0/+7
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/macx-ios-clang/features/resolve_config.prf src/testlib/qtestcase.qdoc Change-Id: Icefa63056ffb37106f35299a8f19165535571799
| | * Doc: add notes about validator and completer in QComboBoxFrederik Gladhorn2016-10-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When setting the editable property to false, we delete the internal QLineEdit used by QComboBox. Add comments that this results in the loss of validator and completer. Task-number: QTBUG-56035 Change-Id: Ife04ac2b9bb3f32fae5328f1ec73b1d5d769d52c Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com> Reviewed-by: Nico Vertriest <nico.vertriest@theqtcompany.com>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-134-4/+12
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also bump minimum required Qt version for Android: Ministro updates. Conflicts: src/android/java/src/org/qtproject/qt5/android/bindings/QtActivityLoader.java src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java src/plugins/platforms/android/androidjnimain.cpp Change-Id: I966f249bebf92da37bfdeb995ad21b027eb03301
| | * QToolBarAreaLayoutInfo: add missing break statements in switch in distance()Marc Mutz2016-10-121-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A fall-through here is logically non-sensical, because of symmetry (or lack thereof). Thus, a break must have been intended. Add it. While we're at it, also replace the default case label with the non-functional enum value QInternal::DockCount, so that -Wswitch can warn us if ever there should be a new DockPosition. Found independently by both GCC 7 and Coverity. Coverity-Id: 11145 Coverity-Id: 11146 Coverity-Id: 11147 Change-Id: I6bb31c1517e40f0cb06ceaee5aeb6fa78b84a523 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * QComboBox: add missing break in switch in keyPressEvent()Marc Mutz2016-10-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the Key_Space case falls through, it does because !d->lineEdit, which makes the following case dead code, because it is guarded by the same condition. Fix by adding the break, which ensures that if those two cases ever diverge, the code stays working by intention, not chance. Independently discovered by GCC 7 and Coverity. Coverity-Id: 11157 Change-Id: Id14114b4157549d0f6fa036e8aa2bf0fa5a863cf Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QCalendarWidget: fix misleading if-else cascade in QCalendarDayValidator::text()Marc Mutz2016-10-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By the time we hit the last else, its if condition is trivially true, so don't check it (but leave it as a comment). Consequently, remove the trailing (dead) return of a default- constructed QString. Coverity-Id: 62766 Change-Id: I47e1a49f40e6ec95d29c5052c78bfadb63af3b84 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * QCalendarWidget: fix a missing break statementMarc Mutz2016-10-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 7 warns about implicit fall-throughs, and here it looks like a break was indeed missing. It surely isn't catastrophic that the other update code is executed, too, but it's also useless. Turns out Coverity knew it all along... Coverity-Id: 11162 Change-Id: I88fc0174a66ec337b2d93c006e70be8d5f3bbc33 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * QDateTimeEditPrivate:: only ask for fieldInfo() if section index is realEdward Welbourne2016-10-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On construction, currentSectionIndex has the fake value FirstSectionIndex, which upsets fieldInfo(), leading to a qWarning(). Make interpret(), when deciding whether to delegate to base or handle the value itself, treat fake index value as an invalid state. Task-number: QTBUG-54654 Change-Id: I6d0f71874839abfafcbfaaa0018362288f32a3cd Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | | Paint menu scrollers, tear off on top of QWidgetAction itemsDongmei Wang2016-10-272-30/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The menu scrollers and the tear off items are painted in the layer of QMenu. In a case that QMenu contains QWidgetAction items, the items are painted under QWidgetAction items. They are visually hidden unless QWidgetAction items' background is transparent. The tear off doesn't work since QWidgetAction item on top of it grabs mouse events. To fix the issue, add two child widgets in QMenu, paint the scroll up and the tear off items in one child widget and the scroll down item in the other one. Both child widgets are painted on top of overlapping sibling menu item widgets. Change-Id: I7eaef21b667b388fbb78b60664f4a4bd91215309 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | | Don't overlap the menu scrollers with QAction itemsDongmei Wang2016-10-271-27/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | The QAction items overlap with the menu scrollers. The patch is to set correct clip regions for QAction items in order not to overlap with the scroll arrows. Change-Id: Ie724bd2be522daf5935fb489523b5d5f32bb7f71 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | | QMenu: don't force platform instance creation on constructionJ-P Nurmi2016-10-164-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a conflict between QGtk3Menu and QDbusPlatformMenuBar. The problem is that on Unity the type of the platform menu instance must be different depending on whether the menu is in the global menubar or a standalone context menu. Since QMenu creates a platform menu instance at construction time, it does not yet know whether it will be added into a menubar. QMenuBar checks that the QMenu already has a platform menu instance, and passes it to the platform menubar. As a result, a QGtk3Menu instance is passed to QDbusPlatformMenuBar. Currently, a standalone QMenu does not use the native platform menu instance. Only menus that are added to a QMenuBar do. Therefore we don't need to create the platform instance when QMenu is constructed, but only after it is added to QMenuBar. The platform menu instance creation is implemented in QMenuBarPrivate::getPlatformMenu(), and QMenu::setPlatformMenu() calls syncPlatformMenu() to take care of syncing the QMenu properties and actions to the new platform menu instance. The macOS-specific methods QMenu::toNSMenu() and QMenu::setAsDockMenu() rely on the platform menu instance, and must therefore create it on demand. This is a hot fix for the release blocker, not a long term solution. In the future, if standalone QMenus are made to use native platform menu instances, the instance must be created lazily when the menu is about to be made visible. Task-number: QTBUG-56526 Change-Id: I044933cabb1639406fe47908dfc4b1903af214d1 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Change confusing Q_DEAD_CODE_FROM_QT4_FOO defineTor Arne Vestbø2016-10-1429-102/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit c5db8fc74 changed all instances of Q_WS_FOO to have the prefix Q_DEAD_CODE_FROM_QT4 instead, to make it clearer when reading the code that the code in question was a left-over from Qt4, when we used Q_WS_ defines instead of Q_OS_ defines. This worked well for cases of #ifdef Q_DEAD_CODE_FROM_QT4, but less so for cases of #ifndef Q_DEAD_CODE_FROM_QT4, where the code was actually unconditionally included. To make this even clearer, the defines have been replaced by checks for 1 or 0, with a comment describing how the code used to look in Qt4. The use of constants in the check also makes it easier for editors to parse the condition and show visually that the code is defined out. Change-Id: I152070d87334df7259b417cd5e17d7b7950379b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-114-2/+11
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/image/qpixmap.cpp src/widgets/kernel/qformlayout.cpp Change-Id: I8a8391a202adf7f18464a22ddf0a6c4974eab692
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-084-2/+11
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/qhttpnetworkconnection.cpp src/network/access/qhttpnetworkconnection_p.h Change-Id: I11f8641ef482efa8cee1b79977d19cc3182814b4
| | * Link to topLevelChanged() in the docs of QDockWidget::floatingSergio Martins2016-10-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | topLevelChanged() is emitted when the floating property changes. It's not very well named, it's easy to miss. Change-Id: Iabaa4fb3dc6190df43d719ed7565f0586816c6de Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
| | * QTextEdit: don't show placeholder text while composing textRichard Moe Gustavsen2016-10-063-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If using IM to compose text in QTextEdit, the placeholder text will show underneath until the text is committed. This patch will additionally check if the user is currently composing preedit text before deciding whether or not to draw the placeholder text. Task-number: QTBUG-55758 Change-Id: If7943c6c94fb96d46514a81caa118829e6e6a0f9 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | | Implement QMacCocoaViewContainer in terms of foreign windowTor Arne Vestbø2016-10-051-27/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This leaves a clearer separation between the foreign-window and non-foreign window use-cases, where a single QCococaWindow can only be in one mode, which is determined in the constructor and doesn't change after that. There are no source or binary compatibility guarantees for the QPA classes, meaning the helper function in QPlatformNativeInterface can be removed. Change-Id: I3232aedca1d98c49a8f54e16750832187f9dc69a Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-291-1/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/uikit/xcodebuild.mk tests/auto/other/lancelot/tst_lancelot.cpp tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp Change-Id: Ia0ae2de86094120281abd445138877c2cc3e882c
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-281-1/+3
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/dialogs/qcolordialog.cpp src/widgets/dialogs/qfiledialog.cpp tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp Change-Id: I34bc8a990f8f526889a95a5c7099ef557b9681ad
| | * QDateTimeEdit: synchronize time-spec before initializing displayEdward Welbourne2016-09-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDateTimeEdit ignores the time-spec of its date-time value, using its own time-spec instead; mostly, this works because it first conforms the value to its own time-spec. However, during construction, before doing this, it set up its display data, which could leave it with a different time (rather than a different representation of the given time) than it was asked to use. Moved the updateTimeSpec() calls to immediately after setting value in QDateTimeEditPrivate::init() to ensure correct handling. Added test. Task-number: QTBUG-54781 Change-Id: I3b07c10997abb858fc0b40558bff96e3fdabbd83 Reviewed-by: Jesus Fernandez <jesus.fernandez@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-216-97/+74
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5971b88e is not needed in new configure. This merge also reverts "fix QMAKE_DEFAULT_*DIRS resolution with apple SDK", 2c9d15d7, because it breaks iOS build with new configure system. Conflicts: mkspecs/features/default_pre.prf mkspecs/features/mac/toolchain.prf mkspecs/features/toolchain.prf src/dbus/qdbusconnection.cpp src/plugins/sqldrivers/mysql/qsql_mysql.cpp src/sql/drivers/mysql/qsql_mysql.cpp src/widgets/widgets/qmenubar.cpp src/widgets/widgets/qmenubar_p.h tools/configure/configureapp.cpp tools/configure/environment.cpp tools/configure/environment.h Change-Id: I995533dd334211ebd25912db05b639d6f908aaec
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-166-89/+58
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp Change-Id: I0af32ee55936d523cbd259b6fe82eb9c409f9074
| | * QMenuBar: Get rid of QMenuBarPrivate::nativeMenuBarDmitry Shachnev2016-09-152-27/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of trying to keep that variable in sync with platformMenuBar state, just check whether platformMenuBar exists instead. Now QMenuBar::isNativeMenuBar() is more reliable, and will not return true if the QPA plugin provides no platform menu bar. Also, remove useless restrictions for code using isNativeMenuBar(). That method is available on all platforms for a long time, not only on macOS or WinCE. This makes sure local menus do not appear if global menus are available, and setVisible(true) is called. Change-Id: I7a5944c64376b4714a38ad981089df8a151c3403 Task-number: QTBUG-54793 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| | * QtWidgets: Fix enter/leave events on popup menusBłażej Szczygieł2016-09-152-58/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the sloppy menu popups - send the leave event to the last active menu (except Cocoa), because only currect active menu gets enter/leave events (currently Cocoa is an exception). Check that the menu really has a mouse before hiding the sloppy menu - don't rely on enter events. This patch removes some unnecessary synthetic mouse enter/leave events from QMenu which causes event duplications with different mouse cursor position. Refactor sloppy menu timer handling - start or restart timers on mouse move events. Enter/leave events are not reliable. Fixes: - better enter/leave events handling for native widget actions, - reduce duplicated enter/leave events for menu actions, - better handle torn off sloppy menus. Partially reverts: 0ed68f3f58c63bd1496cb268bd83881da180051f Amends: 57ecd5aeeb1f609206933be66b92fcdf703703d7 Task-number: QTBUG-53068 Change-Id: I7ad56ac1619db124915d373fab82d0512d44c90e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| | * Fixed glitch when dragging a movable QTabBar tabThorbjørn Lindeijer2016-09-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you would start to drag a tab, and then drag it in the other direction along the point where you started the drag, the tab would fail to follow the mouse for a distance twice the "startDragDistance", before jumping to the mouse again. Fixed this by only taking into account the "startDragDistance" when checking whether a drag is started, and to rely on the "dragInProgress" variable otherwise. Change-Id: I5dd4ebd8340fef7e870f087be68c5097b49728cb Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * QToolButton: fix read of uninitialized variableSérgio Martins2016-09-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling style() can trigger a call into user code which can read the tool button's members before they are initialized ==3566== Conditional jump or move depends on uninitialised value(s) ==3566== at 0x421C39: MyProxyStyle::pixelMetric(QStyle::PixelMetric, QStyleOption const*, QWidget const*) const (MyProxyStyle.cpp:635) ==3566== by 0x504B8B1: QRenderRule::QRenderRule(QVector<QCss::Declaration> const&, QObject const*) (qstylesheetstyle.cpp:1004) ==3566== by 0x504D084: QStyleSheetStyle::renderRule(QObject const*, int, unsigned long long) const (qstylesheetstyle.cpp:1747) ==3566== by 0x504D4A5: QStyleSheetStyle::renderRule(QObject const*, QStyleOption const*, int) const (qstylesheetstyle.cpp:2023) ==3566== by 0x504FF02: QStyleSheetStyle::styleHint(QStyle::StyleHint, QStyleOption const*, QWidget const*, QStyleHintReturn*) const (qstylesheetstyle.cpp:5146) ==3566== by 0x517B2D0: QToolButtonPrivate::init() (qtoolbutton.cpp:193) Change-Id: I56bca15d3ec7cd7b255a83dca786532a2f9b9b48 Reviewed-by: David Faure <david.faure@kdab.com>
| * | QMenuBar: improve documentation of the D-Bus unified menu barShawn Rutledge2016-09-151-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 5.7.0 this is not just a macOS feature. It's also not necessarily limited to Ubuntu Unity, since the specification is open, and there's work in progress to implement it on KDE. Also fixed a couple of typos. Task-number: QTBUG-54793 Change-Id: Idbc68ddafff4dea30649e634ca29f10703f60d3b Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | Use QString::fromLatin1() less to avoid string allocationsAnton Kudryavtsev2016-09-152-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QString::fromLatin1 always allocates memory, but there are cases where we can avoid/reduce allocations or/and reduce text size, e.g.: QStringBuilder expressions Fix: replace QString::fromLatin1 with QL1S QString::fromLatin1().arg(String) pattern Fix: replace with QStringBuilder Overloaded functions with QL1S arg Fix: replace QString::fromLatin1 with QL1S In rare cases if there is no overloaded function with QL1S and we have deal with string literal, replace QString::fromLatin1 with QStringLiteral. Change-Id: Iabe1a3cc0830f40ef78a0548afa4368583c31def Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-054-46/+80
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qt_common.prf src/plugins/platforms/windows/qwindowsdialoghelpers.cpp Change-Id: I03b92b6b89ecc5a8db7c95f04ebb92ed198098a8
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-054-46/+80
| |\| | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/testlib/selftests/generate_expected_output.py Change-Id: If856162abf9a24ae2c9946d336a7d1da03520fa7
| | * Fix QMainWindow::restoreDockWidget() with GroupedDraggingOlivier Goffart2016-08-304-46/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to account for the fact that the placeholder might be in a floating tab. Task-number: QTBUG-50491 Change-Id: I03d8e49cc40f58691154f5c3984f3b0670a974d5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-08-293-22/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cf53aa21bf0f8fbd13c0ce2d33ddf7bc63d0d76a and 3aaa5d6b32130d3eeac872a59a5a44bfb20dfd4a were reverted because of reconstruction in 5.7. defineTest(qtConfTest_checkCompiler) in configure.pri is smart enough to cover the case in a9474d1260a8c8cc9eae14f2984098919d9684e5. DirectWrite: Fix advances being scaled to 0 Since 131eee5cd, the stretch of a font can be 0, meaning "whatever the font provides". In combination with ec7fee96, this would cause advances in the DirectWrite engine to be scaled to 0, causing the QRawFont test to fail. Conflicts: configure mkspecs/features/uikit/device_destinations.sh mkspecs/features/uikit/xcodebuild.mk src/corelib/global/qglobal.cpp src/corelib/global/qnamespace.qdoc src/plugins/platforms/cocoa/qcocoamenuitem.h src/plugins/platforms/windows/qwindowsservices.cpp src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp src/widgets/kernel/qapplication.cpp tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp Change-Id: I4656d8133da7ee9fcc84ad3f1c7950f924432d1e