summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Handle the QWidgetPrivate::mapper structure"Marc Mutz2016-03-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 90de48493be283b9afb249f6a0fd8dbd8958517d. The call isn't necessary, but invokes undefined behavior. It invokes undefined behavior because deleteTLSysExtra() is called from deleteExtra(), which is called from ~QWidgetPrivate(), which is called from ~QObject(). Thus, by the time we call q->windowType() within setWinId(), q is no longer a QWidget, but only a QObject, and calling a QWidget member function then is UB. UBSan confirms: qwidget_p.h:300:5: runtime error: downcast of address 0x2afdd4053620 which does not point to an object of type 'QWidget' (the Q_Q macro) 0x2afdd4053620: note: object is of type 'QObject' qwidget.cpp:1712:93: runtime error: member call on address 0x2afdd4053620 which does not point to an object of type 'QWidget' 0x2afdd4053620: note: object is of type 'QObject' It is also unnecessary: deleteTLSysExtra() is called from two places: QWidget::destroy() and deleteExtra(). deleteExtra() is only called from ~QWidgetPrivate() which is only called from ~QObject() called by ~QWidget(), which, however, already calls QWidget::destroy(). QWidget::destroy(), in turn, unconditionally (for non-desktop widgets, at least) calls setWinId(0) itself. So fix the UB by removing the call without replacement. Conflicts: src/gui/kernel/qwidget_qpa.cpp Change-Id: Ib3a8cc9d28a096183f1d3dfd1941ea5fdc6a4aac Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Remove Qt::WA_OutsideWSRange flag even if the widget is not yet visible.Błażej Szczygieł2016-03-151-1/+1
| | | | | | | | | | Show the widget when its initial size is 0 and the layout changes the size during showing. Task-number: QTBUG-51788 Change-Id: I3251ac27328f9715ff13d96e1b82fbf824d9e79d Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Add argument names to the function signatures in headersOlivier Goffart2016-03-102-31/+31
| | | | | | | | | | | | | | | | | | Sometimes, in the .cpp, the declaration has the argument name in comments because it is not used (instead of using Q_UNUSED). The old qdoc could parse that, but once clang is used, these comments are not seen anymore. So add the argument names to the headers. This is also good for things like auto completion, which uses only the header to know what the argument name is. I grepped for " */)" and made sure all the functions that are documented have the right arguments. I also added the name to all the function around for consistency. Change-Id: I1aaa37e25a1985f7f51653f047a1ac2633242b56 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* Wheel event widget: Harden logic an extra bitGabriel de Dietrich2016-03-092-25/+53
| | | | | | | | | | | | | | | | | This is quite an unlikely scenario, but not impossible. It could be that the wheel widget is destroyed during an update phase event. In that case, wheel_widget would be a dangling pointer for any subsequent wheel event. We protect against this with a QPointer. However, that would mean that if the next wheel event were to be an end phase event, that event would be lost. So we go through the usual code path, except that we won't set wheel_widget in the case of an end phase event. Change-Id: I59a912b845dcc249e1edc60b4dc28bf308d807d9 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* QGestureManager: fix UB in filterEvent()Marc Mutz2016-03-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code infers from the presence of an address in a QHash<QGesture *, ...> that the address belongs to a QGesture. So far that is fine enough. But in order to perform the lookup, it static_cast<>s the QObject* argument to a QGesture* for the QHash:: contains() call. Even though the pointer is not dereferenced, the cast is UB. Says UBSan: qgesturemanager.cpp:558:73: runtime error: downcast of address 0x2ab83364f3a0 which does not point to an object of type 'QGesture' 0x2ab83364f3a0: note: object is of type 'QDBusConnectionManager' which is a particularly hideous error message because of the constantly-changing completely-unrelated actual type in the second line of the message: 52 QDBusConnectionManager 19 QSocketNotifier 14 QFusionStyle 13 QAction 6 QApplication 3 QGraphicsWidget 1 Window 1 TestRunnable 1 RectWidget 1 QTimer 1 QSingleShotTimer 1 QOffscreenSurface 1 QGraphicsProxyWidget 1 QDefaultAnimationDriver 1 QDBusPendingCallWatcherHelper This error is also _very_ common, triggered 116 times in a single run of make -C tests/auto check. Fix by using qobject_cast first and then doing the lookup only when the cast succeeded. Depending on the performance of qobject_cast<>, this may actually perform better, too. Change-Id: I884ec7d885711acc3c1d004ce93c628268d8fc18 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Q*Application: fix UB caused by accessing QGuiApplication from ↵Marc Mutz2016-03-092-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QCoreApplication ctor As reported by ubsan: src/gui/kernel/qplatformintegration.cpp:463:10: runtime error: downcast of address 0x7ffdc2942490 which does not point to an object of type 'QGuiApplication' 0x7ffdc2942490: note: object is of type 'QCoreApplication' src/gui/kernel/qplatformintegration.cpp:466:14: runtime error: downcast of address 0x7ffdc2942490 which does not point to an object of type 'QGuiApplication' 0x7ffdc2942490: note: object is of type 'QCoreApplication' src/gui/kernel/qplatformintegration.cpp:466:43: runtime error: member call on address 0x7ffdc2942490 which does not point to an object of type 'QGuiApplication' 0x7ffdc2942490: note: object is of type 'QCoreApplication' to name just a few which are reported when running gui and widget auto-tests; there're definitely more where these came from. This is caused by QCoreApplication::init() being called from the QCoreApplication ctor, calling virtual functions on Q*AppPrivate, which happen to attempt, in this case, to emit QGuiApp signals. At that point in time, the QGuiApplication ctor has not entered the constructor body, ergo the object is still a QCoreApplication, and calling the signal, as a member function on the derived class, invokes UB. Fix by cleaning up the wild mix of initialization functions used in this hierarchy. The cleanup restores the 1. Q*ApplicationPrivate::Q*ApplicationPrivate() 2. Q*ApplicationPrivate::init(), calling each base class' init() as the first thing two-stage construction pattern commonly used elsewhere in Qt to make sure that the public class' object is fully constructed by the time each level's Private::init() is called. Change-Id: I290402b3232315d7ed687c97e740bfbdbd3ecd1a Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Clean up WINVER, _WIN32_WINNT macros for MinGW.Friedemann Kleint2016-03-073-31/+0
| | | | | | | | | | | Define WINVER, _WIN32_WINNT as 0x501 (Windows XP) in qt_windows.h. Remove definitions of the same/lower versions and unneeded definitions in other places. Remove definition for Borland compiler. Task-number: QTBUG-51673 Change-Id: I2a344a7f7cf78b2afbf45dcdf8bf2a19b93f0a07 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* consistently put {qt,qml}_{module,plugin} at the end of project filesOswald Buddenhagen2016-03-072-11/+8
| | | | | | | | this fixes static builds by ensuring that all dependencies are exported. Task-number: QTBUG-51071 Change-Id: Icbce502dcbcb4d4b4d922c42679f44e2cc930bf3 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* QCompleter: QMatchData: init all fields in default ctorMarc Mutz2016-03-061-1/+1
| | | | | | | | | Found by UBSan: src/widgets/util/qcompleter_p.h:130:8: runtime error: load of value 249, which is not a valid value for type 'bool' Change-Id: I0529e54e17a6f4d6add91786a2d5687f2d043531 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Make use of defaultDropAction in QListView icon modeSamuel Gaist2016-03-062-2/+7
| | | | | | | | | | | | | | | Before this patch, using setDefaultDropAction on QListView in icon mode would not have any effect. Now the drag behaves properly. The default action is set to CopyAction rather than IgnoreAction to keep the current behavior and avoid breaking user code. [ChangeLog][QtWidgets][QListWidget] Fixed a bug that caused the default drop action to be ignored when using icon mode. Task-number: QTBUG-15741 Change-Id: I49654cde382af344ffc4594699303c928e27e05d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Make an implicit grab on TouchBegin for a widget subscribed to a gestureAlexander Volkov2016-03-052-8/+45
| | | | | | | | | | | | | | | | | | | | | A receiver of TouchUpdate and TouchEnd events is determined either as a widget which has an implicit grab for the touch point or as a visible widget if there are no implicit grabs. The events are sent if the receiver has accepted TouchBegin event or if it is subscribed to a gesture. Before sending the events to the widget they are delivered to the gesture manager. Thus, in order to detect gestures for the widget, it must own an implicit grab or be a visible widget. It can happen that the parent widget is subscribed to a gesture, but doesn't accept TouchBegin event, as in the case of QScrollArea. Then it will not get an implicit grab and gesture detection will be impossible. Activate an implicit grab for such widgets. Also don't send TouchUpdate and TouchEnd to them, because it's against the documentation. Task-number: QTBUG-43277 Change-Id: Id767583991def6d76c48ad15eb39af822cad115d Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* QWheelEvent: make NoScrollPhase opt-inShawn Rutledge2016-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The fix for QTBUG-50199 involves adding an undocumented enum value which can be returned from QWheelEvent::phase(). This will be quite unexpected for applications that use it, which work fine with 5.6.0 and then start receiving this new phase value in 5.6.1. So it should not happen by default. Set the env variable QT_ENABLE_MOUSE_WHEEL_TRACKING to enable this functionality. In 5.7 it will be default behavior. But in 5.6 the default behavior is as it was before: if you use a conventional mouse wheel, the phase stays at ScrollUpdate continuously. [ChangeLog][QtCore] QWheelEvent::phase() returns 0 rather than Qt::ScrollUpdate when the wheel event comes from an actual non-emulated mouse wheel and the environment variable QT_ENABLE_MOUSE_WHEEL_TRACKING is set. In Qt 5.6, this is required to enable the fix for QTBUG-50199. Change-Id: Ieb2152ff767df24c42730d201235d1225aaec832 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Fix GCC 6 -Wunused-functions warningsMarc Mutz2016-03-052-21/+0
| | | | | | | | | GCC 6 is able to identify member functions that are unused. Remove them. Change-Id: Ic77548164b38a1cd3c957d2c57a5bccb979bc02e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Don't create accessible interface for QWidgets being destroyedGabriel de Dietrich2016-03-021-0/+9
| | | | | | Change-Id: I975ee556913707e8595b2a89f1bba4299187bcfb Reviewed-by: Wayne Arnold <wayne.arnold@autodesk.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* QMacStyle and QCocoaTheme: Fix selected item color for non-native menubarGabriel de Dietrich2016-02-291-2/+3
| | | | | | Change-Id: I3b55e9ce896383338cf6ed768d912ca1835b7742 Task-number: QTBUG-28960 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* QMenuBar: Acknowledge AA_DontUseNativeMenuBarGabriel de Dietrich2016-02-291-1/+2
| | | | | | Change-Id: I756f4181d66ef6e79ab7b7be8a23a10171a9f30c Task-number: QTBUG-28960 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Track target widget when wheel events are receivedGabriel de Dietrich2016-02-292-17/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This issue is reproducible on OS X when using a Magic Mouse or a combination of Magic Trackpad and regular mouse. In these cases it's possible to start a scrolling gesture on one widget and move the mouse cursor over another widget. Although we send the wheel event phase information, we never made any use of it. This means that a widget would start scrolling even though it never received a ScrollBegin event. In this patch, we make sure the scrolling cycle is respected and that once a widget starts scrolling, it'll be recieving all the wheel events until a ScrollEnd event reaches the application. For those input devices not supporting a proper phase cycle, we introduce a new (undocumented) phase value, NoScrollPhase. If the wheel event phase is NoScrollPhase, then we ignore the current scroll widget and proceed as usual. This value is the default for wheel events. It's up to the platform plugin to set the proper phase value according to the data received from the OS. Finally, we fix a few of QWheelEvent constructors to properly initialize the phase and source properties. Task-number: QTBUG-50199 Change-Id: I3773729a9c757e2d2fcc5100dcd79f0ed26cb808 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* QtWidgets: Always deliver the wheel event to submenusBłażej Szczygieł2016-02-241-3/+14
| | | | | | | | | | When mouse events are delivered using XInput2 then the wheel event is missing on submenus, because XInput2 delivers the wheel event only to the root menu. Task-number: QTBUG-50996 Change-Id: I757c0b5e3aea4606d2e45dfc8180c263e02167ca Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* QtWidgets: Proper delivery of enter/leave event to context menusBłażej Szczygieł2016-02-241-12/+42
| | | | | | | | | | | | | | | | | | | | First-level context menu grabs the mouse, so all mouse events are delivered to it. This menu passes the mouse events to submenus. Any platform delivers mouse enter/leave event differently when window is grabbed. This patch unifies event delivery to context menus - it can block some unwanted events and it emulates fake events if necessary. This patch can reduce duplicated events and can provide proper enter or leave event to additional widgets in the context menu. It can also prevent submenu from unwanted close on Windows and X11. Added autotest. Task-number: QTBUG-45565 Task-number: QTBUG-45893 Task-number: QTBUG-47515 Change-Id: I7dd476d0be23afa34e947e54aef235012d173dcf Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* QMenu: Add delegate related notes to OS X-only APIGabriel de Dietrich2016-02-191-2/+8
| | | | | Change-Id: I88bb4fdb2c11da0602e4c9f6637bbdeaa715aba0 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
* Fix build when QMacStyle is disabled.Jake Petroules2016-02-181-1/+1
| | | | | | Change-Id: Ica66ab2b48266590b14d16a323b572f63168a580 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* QListView: fix skipping indexes in selectedIndexes().Anton Kudryavtsev2016-02-171-1/+1
| | | | | | | | | | Remove spurious increment of i. Task-number: QTBUG-51086 Change-Id: I4307a6728de1e7f25c8afa31fe2066f92373f3fc Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-02-151-0/+1
|\ | | | | | | Change-Id: Ic011149c50dcbff3468d8fbdd3069a51ecd8f21c
| * Add missing emission of activated(QString)Andy Shaw2016-02-021-0/+1
| | | | | | | | | | | | | | | | | | This signal got missed when 3fb0d851a was submitted so this compliments that fix. Change-Id: I91d20b709fce2c78d41166779954a3bb618feb37 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6.0' into 5.6Liang Qi2016-02-153-23/+31
|\ \ | | | | | | | | | Change-Id: I0b190005377a23a91da3563428e223b8a3b18333
| * | Revert "QWidgetWindow: call base class close event impl".Friedemann Kleint2016-02-051-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch causes the window creation on reshowing nested QWidget with native windows to create child windows with 0-parent handles, which can have adverse effects on the various platforms. The patch might be re-applied on top of 73c86fcb400cb91868b56ac05a3b82a3f7ba1a1b. This reverts commit 470c8b68df539ca7356cd6b8596f8323ba3ed779. Task-number: QTBUG-43344 Task-number: QTBUG-50854 Change-Id: I2ad837c3800fc71cccf04d455d1b9c3600b233e7 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
| * | Merge 5.6 into 5.6.0Oswald Buddenhagen2016-02-0216-113/+87
| |\ \ | | | | | | | | | | | | Change-Id: I95962e28b6fc101cbbad41230585e2b61f1f6c0f
| * | | Fix widget texture list locking to avoid animation issues on eglfsLaszlo Agocs2016-01-282-22/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWidgetBackingStore::sync() has two variants. The widget texture list logic was only present in one of them. This led to problems on eglfs in cases when the other variant got invoked. (for instance using the scroll area in the qopenglwidget example) eglfs relies on the texture lists's lock status to properly serialize its somewhat asynchronous built-in compositing mechanism and therefore is the only platform affected. The patch moves the code to be invoked from both sync() variants. Task-number: QTBUG-50668 Change-Id: I4c62987b7bb3cc40f98a4e94447368d2f740dbfd Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | | | QWindowsVistaStyle: Suppress animation when QLineEdit's base color is set.Friedemann Kleint2016-02-101-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce utility function to check using QWindowsXPStylePrivate::isLineEditBaseColorSet(). Task-number: QTBUG-40634 Change-Id: Iaa6962a17217352aa59d0c54421b764ad47d3bf8 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* | | | QWindowsXPStyle: Introduce utility function for QLineEdit's palette.Friedemann Kleint2016-02-103-39/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce QWindowsXPStylePrivate::isLineEditBaseColorSet() checking whether the base color has been set in the widget's palette taking into account the QSpinBox special case and simplify the code accordingly. Task-number: QTBUG-40634 Change-Id: I0e7527031b333d71727fbd30db6dd80aa715c9ab Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* | | | QWindow::setMask(): Apply High DPI scaling.Friedemann Kleint2016-02-091-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move code from QWidget::setMask() and reimplement QWidget::setMask() using QWindow::setMask(). Task-number: QTBUG-50938 Change-Id: I040688d6b18df91368fa6ab6392a3b4cd80f2683 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | | | Reduce allocations by using reserve()Sérgio Martins2016-02-073-4/+8
| | | | | | | | | | | | | | | | | | | | Change-Id: If34fa53402985f6b3c5e7217bce4a1177af835b6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | QtWidgets: Fix build & warnings with QT_NO_GRAPHICSVIEW.Friedemann Kleint2016-02-052-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kernel\qapplication.cpp(3157,18) : warning: unused variable 'isGraphicsWidget' [-Wunused-variable] bool isGraphicsWidget = false; ^ kernel\qwidget.cpp(6446,18) : warning: unused variable 'window' [-Wunused-variable] if (QWidget *window = w->window()) { ^ kernel\qwidget.cpp(7949,50) : error: no member named 'proxyWidget' in 'QWExtra' if ((q->isWindow() && (!extra || !extra->proxyWidget)) ~~~~~ ^ kernel\qwidget.cpp(8084,50) : error: no member named 'proxyWidget' in 'QWExtra' if ((q->isWindow() && (!extra || !extra->proxyWidget)) Change-Id: I8474ab0ab4617c6588707ce0c2f7a97e4d0e54da Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | Doc: corrected minor link issuesNico Vertriest2016-02-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-43810 Change-Id: I98eafe0c7ed55f309640e8495c83ffcef355aa08 Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* | | | Fix crash introduced by 75b705fec8e9517047d7dfa98203edff69f2bf8aAndy Shaw2016-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the crash introduced by 75b705fec8e9517047d7dfa98203edff69f2bf8a. The drag only needs to be ended on the hide if it is actually in the middle of dragging. This enables the case of dragging the dock widget out with the mouse to continue to work. Task-number: QTBUG-50890 Change-Id: I72309dd40ee670319f2ff607ae201c46f8de4652 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | End the drag if the dockwidget is being hiddenAndy Shaw2016-02-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the window flags are changed for the widget then it is possible to minimize the dockwidget via the titlebar. This will cause it to be ready to start a drag internally but since the dockwidget never gets a mouse release event it doesn't end it. Therefore it ends up being in an invalid state later on when restored, so the endDrag() needs to happen in the hide event to ensure this is not an issue later on. Change-Id: Ia84bee96b9eed49896869e6a15d4de6d01964264 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | QWizard/Windows: Add missing override.Friedemann Kleint2016-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-50804 Change-Id: Ia1c73b40d96ddea01e440e0e3e010ff3fcb88793 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | | Disintermediate QDateTimeParser::SectionNode operations.Edward Welbourne2016-02-021-3/+3
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The name, format and maxChange of a Section depend only on the section, not on the details of the currently parsed text it matches; so we don't need the parser object's list of all sections to work them out. Move these methods to the SectionNode and act directly on that instead of going via the section list. Make the name take a Section enum instead of an int. Likewise, make stateName take a State enum instead of an int. Change-Id: Ie340d042ab95aec517013c4dcc30901d40305c78 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | | QDockWidget: Restore using setGeometry since the geometry is used for the stateAndy Shaw2016-02-021-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This solves an instance where restoreState() was used when the dockwidget was already floating and the saved state was also for a floating dockwidget. Change-Id: I1fe764ae2a6b0351ae26e33ffec682ad37c944d7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Revert "QWindow::destroy(): only reset QGuiApp::focus_window and friends as ↵Tor Arne Vestbø2016-02-021-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a last resort" This reverts commit 4c71db756741d35ccb32dc4c32aa1823264c85df. It's too risky for 5.6, we should let it cook in dev for a while and backport when ready. Change-Id: I91e677e65d967f29c84a254cd3dffc8bb847b263 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | | Fix flickering status tips in submenus.Michal Policht2016-01-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed setCurrentAction() function so that it reselects parent menu action only if mouse is over a menu and parent menu is not already selected. Task-number: QTBUG-47987 Change-Id: Id077d6ce1de1335ba2709180c8480af5d1720de0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Michal Policht <michpolicht@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | | Fix GCC 6 valid warnings about misleading indendationsThiago Macieira2016-01-305-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's currently producing a lot of false positives, but a few are actually valid. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69029, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69122 and some others. Change-Id: I24a735698d3c4a719fc9ffff1425f29d7b5a3458 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QWindow::destroy(): only reset QGuiApp::focus_window and friends as a last ↵Tor Arne Vestbø2016-01-291-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resort Resetting focus_window and other internal QGuiApplication variables before calling setVisible(false) and destroying the platform window means that the platform window can't reason about whether or not it was the focus window unless it can resolve that using native APIs. We should let the platform window take care of resetting the focus window and related states, and only execute our fallback logic if the plugin doesn't do the right thing. We also use QPA to update the state instead of modifying the internal QGuiApplication variables directly, so that events and signals are emitted as a result of the reset. The QLineEdit test gets two added calls to processEvents(), since assuming that activateWindow() is synchronous is not correct, and would result in the QMenu resetting the focus window to 0 on destroy. Task-number: QTBUG-46414 Change-Id: I562788393ed0ffd77d7a4be2279862322f721c1a Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | | Doc: Properly document old platform-specific functionsSze Howe Koh2016-01-292-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qt_mac_set_dock_menu() needs a \relates command to show up properly. "\since 5.2" produces "This function was introduced in Qt 5.2", which is wrong; the function existed in Qt 4. qt_set_sequence_auto_mnemonic() is referenced by the QShortcut class ref, but the page that hosted it in qtdoc.git is being removed. Thus, its description is now transferred here. Change-Id: If009a45f1d04541787925cf230ed7b59c7db0b39 Reviewed-by: Alejandro Exojo Piqueras <suy@badopi.org> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | | Bump copyright year to 2016Kai Koehne2016-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump copyright year in tool output and user visible strings to 2016. Task-number: QTBUG-50578 Change-Id: I2f4aa9089c6672726f554cba7e6009b425d27683 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com> Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* | | Doc: Remove Qt3 compatibility functions from QToolButtonCédric Bonnier2016-01-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QToolButton's detailed description mentioned setToggleButton and setPopupDelay which have been removed in Qt5. Removed typo dependant > dependent Task-number: QTBUG-50761 Change-Id: I9a2ff79a512127982c7961dee79fe2751f12cf43 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | | Doc: a QScreen can be a placeholder if there are no screens attachedShawn Rutledge2016-01-281-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of change a094af001795c9651b299d700a992150d1aba33a, X11 now joins other platforms in having a fake screen if no physical screens are attached, rather than ever allowing QGuiApplication::screens() to return an empty list or QGuiApplication::primaryScreen() to return null. This is more consistent across platforms and helps to prevent bugs in applications which want to use QScreen in some context but fail to check whether it exists. [ChangeLog][X11] In case there are no physical screens attached, QGuiApplication::screens() and QGuiApplication::primaryScreen() will return a placeholder QScreen object. Task-number: QTBUG-42985 Change-Id: I0f58afbfe2a034fb9e872a5d1dbdabad2c7dbf9e Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | | QtWidgets: Allow to cover up the window container by another widgetBłażej Szczygieł2016-01-281-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the window container already has a window handle, allow embedded windows to use this handle as a parent. This change will allow proper window stacking and clipping. Task-number: QTBUG-50477 Change-Id: I8d656ecb99e0c42ae7a7ac461e5e5b5d801f5493 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | | Remove some old QT_MAC_USE_COCOA cruftTor Arne Vestbø2016-01-281-53/+0
| | | | | | | | | | | | | | | Change-Id: Ib9cb57563274c722023084e94f2cd439088366a8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | | QWindowsVistaStyle: Reorder the if statement so the variable is checked firstAndy Shaw2016-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Since the likelyhood that decoration_size is greater than 0 then we can save time with explicitly ensuring that it does not call the functions. Change-Id: Iaf991a6c77bbc4908c459307ca7e645cf3b3ca20 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>