summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
Commit message (Collapse)AuthorAgeFilesLines
* macOS: Deliver native events to windows, as well as to event filtersTor Arne Vestbø2017-07-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | Qt has two APIs to intercept native events today: - QAbstractEventDispatcher::installNativeEventFilter() - Q{Window|Widget}::nativeEvent() On macOS we only implemented one of them, the native event filter code path, by calling filterNativeEvent from the Cocoa event dispatcher. We now also propagate the native event to the corresponding QWindow, and QWidget if applicable. It would be nice if there was only one Qt API for this, or at least only one codepath for platform plugins to care about, but since the event filter might catch more event types than gets delivered to the window, we probably need both code paths going forward. Task-number: QTBUG-40116 Change-Id: I0796bd62a2b7c08b2eaaf6f15db8088e9703af02 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-061-9/+0
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I43531e087bb810889d5c1fbfcdffb29b78804839
| * Remove remains of wince in .pro filesFriedemann Kleint2017-07-031-9/+0
| | | | | | | | | | | | | | | | Task-number: QTBUG-52590 Change-Id: I444fc9eedc8a8e4ad2ede224d66e7c410bedbb48 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-0414-64/+71
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
| * docs: Reference QOpenGLWidget::grabFramebuffer, not QGLWidget::grabFrameBufferSérgio Martins2017-07-021-2/+5
| | | | | | | | | | | | | | | | QGLWidget is obsolete Change-Id: I8db3bfd534a328d41815d445557d899dc17d6061 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Fix moving a hidden QOpenGLWidget to another windowSérgio Martins2017-07-022-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | A visibile QOpenGLWidget receives a QEvent::WindowChangeInternal which triggers a QOpenGLWidget::reset(). A hidden QOpenGLWidget never received this event so it was never reset, resulting in a black rendering. Includes unit-test that fails without this patch. Change-Id: I9d2c57d66fa629f631a9829a5ebf4de09998ad75 Task-Id: QTBUG-60896 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Convert features.statustip to QT_CONFIGStephan Binner2017-06-295-9/+9
| | | | | | | | | | Change-Id: Ic719ab93ed1802fcc713885ad0421cb44c7a998b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Convert features.messagebox to QT_[REQUIRE_]CONFIGStephan Binner2017-06-291-2/+4
| | | | | | | | | | Change-Id: Ie25dc672f8a675c06585c7757255f7dbadbfc5ec Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Convert features.whatsthis to QT_[REQUIRE_]CONFIGStephan Binner2017-06-298-23/+23
| | | | | | | | | | | | | | Move feature definition to gui/configure.json Change-Id: I00b35c0e259d0a695d84a9bf6803eba74d41465a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Convert features.tabletevent to QT_CONFIGStephan Binner2017-06-285-11/+11
| | | | | | | | | | Change-Id: Ibd7ed7f269a64afddadee70979b20f1c58398378 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Convert features.wheelevent to QT_CONFIGStephan Binner2017-06-287-16/+16
| | | | | | | | | | Change-Id: I46083a9115c199d1ebe024ed5f64b160a27462f1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Revert "QWidgetEffectSourcePrivate::draw(): Call render() when no shared ↵Friedemann Kleint2017-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | painter exists" The change causes drawing artifacts in Qt Creator. This reverts commit 8b1377fde16a2049a1c27f6d005bff84a8f85f28. Task-number: QTCREATORBUG-18322 Task-number: QTBUG-60231 Change-Id: Ic05507b0c23ea612fa5a9b92163380059b6e710d Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | QtWidgets: Change QTLWExtra::window from QWindow to QWidgetWindowMorten Johan Sørvig2017-06-222-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Revert commit a1d4e4c9: We’re now using QWidgetWindow API from QWidget code. Add QWidgetPrivate::windowHandle() which returns a QWidgetWindow pointer. Use this function to remove casts where QWidgetWindow API is used. Change-Id: Ie66a69b5c0461f297996118dc907e1d7b3d78df5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Correctly set native widget window visibilityMorten Johan Sørvig2017-06-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After d7a9e08f, calling QWindow::setVisible(true) is a no-op if the widget is already visible. Use QWidgetWindow::setNativeWindowVisibility() instead to set visibility for the native window directly. “Upgrading” widgets to be native widgets now works again. Change-Id: Id68dd8241f3afe00670c07e30e2b2ade9c150354 Task-number: QTBUG-61006 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Fix dereferencing non-existent TLW with hidden QOpenGLWidgetLaszlo Agocs2017-06-201-12/+12
| | | | | | | | | | | | | | | | | | Amends 2ea90c56f2924acc5c620ed7c29a48c72a42efd3. Task-number: QTBUG-61280 Change-Id: Iae086a47f5cbe2e423b0831c3cd226507879cbbb Reviewed-by: Mika Salmela <mika.salmela@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-192-3/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/windows/qwindowscontext.cpp src/plugins/platforms/windows/windows.pri src/tools/uic/cpp/cppwriteinitialization.cpp src/widgets/doc/src/widgets-and-layouts/gallery.qdoc Change-Id: I8d0834c77f350ea7540140c2c7f372814afc2d0f
| * Help GCC understand that variable is never used unintializedThiago Macieira2017-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | qformlayout.cpp:1982:14: error: ‘role’ may be used uninitialized in this function [-Werror=maybe-uninitialized] The variable role is never used uninitialized because the access is protected by the check for row != -1. The only condition under which QFormLayout::getItemPosition will leave role unset is if it sets row to -1. Since row == -1 ←→ col == -1 ←→ storageIndex == -1, we can simply change the variable that we check here and the warning goes away. Change-Id: Ia3e896da908f42939148fffd14c4ace6e40a808e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Fix crash when calling QWidget::grab() on a QOpenGLWidgetSérgio Martins2017-06-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | By avoiding unneeded nested QPainters. Crash was: ASSERT: "s" in file /data/sources/qt/qt5/qtbase/src/gui/painting/qpaintengine_raster.cpp, line 2239 s was nullptr because the inner QPainter had called updateState(0), which is then dereferenced by the outer QPainter. Task-number: QTBUG-61036 Change-Id: I7aad648f805f1abac4d38dfbefa2292da8b52af4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Start supporting purely offscreen QOpenGLWidgetLaszlo Agocs2017-06-082-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to popular demand. It does have it benefits (especially when it comes to convenience) to allow grabbing QOpenGLWidgets even when they are not part of an actual window and are not actually visible. Does not involve much more than dropping the warnings and bailouts when there is active native window (because the QOpenGLWidget/its parents are still hidden). In addition the device pixel ratio from metric() has to be fixed as well. [ChangeLog][Qt Widgets] QOpenGLWidget is now able to render and return its content via grabFramebuffer(), QWidget::grab() or QWidget::render() even when the widget has not been made visible. Task-number: QTBUG-47185 Task-number: QTBUG-61280 Change-Id: Icc2b0b3ce9778a3eb6409d54744238568abb0f0d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-073-2/+6
|\| | | | | | | | | | | | | Conflicts: src/widgets/widgets/qmenu.cpp Change-Id: I6d3baf56eb24501cddb129a3cb6b958ccc25a308
| * QStackedLayout: Fix UB (invalid cast) in qt_wasDeleted()Olivier Goffart2017-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixup of commit b4995eb7491c1b4784a1bf48db834c11c42b8d9d. We can't call QWidgetPrivate::get(w) on a deleted QWidget, because of the call to the member function QWidget::d_func. We can however call QObjectPrivate::get since we still are in the QObject destructor. tst_qstackedlayout now pass without ubsan Warnings. Change-Id: I4e839a97ddbd1cf21435a8fca76523b98a1f7d9b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * QWidgetWindow: don't give focus to windows that are being destroyedMitch Curtis2017-05-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the referenced bug report, dismissing a QFileDialog while the Qt Virtual Keyboard was in use would result in a crash. Dismissing a file dialog created with e.g. QFileDialog::getOpenFileName() causes it to eventually be destroyed. When this happens, it starts deleting its children. Each child widget's destructor calls clearFocus(). In clearFocus(), there is a block of code that emits QWindow::focusChanged(), passing the result of focusObject() called on that widget's window. QWidgetWindow::focusObject() could end up using itself as a fallback focus object if it had no other focus objects (e.g. children) to use instead, even though it was in the process of being destroyed; as were all of its children. The Qt Virtual Keyboard plugin would then try to use the focus object, even though it was in an invalid state. To fix this problem, we return early from QWidgetWindow::focusObject() if the window is in the process of being destroyed. Task-number: QTBUG-57193 Change-Id: I137cf9415812ce2e0419c0afe8076ce150f248cb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * QWidgetEffectSourcePrivate::draw(): Call render() when no shared painter existsFriedemann Kleint2017-05-291-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-60231 Change-Id: If07274a01bb9a4b9323865a3e061b3674507fd5b Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | QGestureManager: use QScopedPointer to hold prototype gestureMarc Mutz2017-05-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | When registering a QGestureRecognizer, we create a prototype QGesture to ask for it's QGesture::type(). Instead of a manual delete, use a QScopedPointer to hold it. Change-Id: I5cf1ad95864265b7d465b6344751acfb19a16800 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* | QGestureManager: use op[] instead of contains() + insert() to ensure an ↵Marc Mutz2017-05-301-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | entry exists ... in an associative container. This is more efficient (one lookup instead of two). Change-Id: I07f1ffebb9b27714c0694658366f750752ea438c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* | QWidgetWindow: Forward incoming events with their original spontaneous stateTor Arne Vestbø2017-05-201-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The events may come from QPA, as spontaneous events, or from other parts of Qt, as non-spontaneous events. We should keep the state of the original event. Introduces QCoreApplication::forwardEvent() as a wrapper around the opaquely named notifyInternal2. Ideally this would be the behavior of sendEvent, with an enum argument to override the flag, but that ship has sailed. Change-Id: Ib0209f2b99744bd10590c63239ee7a97b60be4fd Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Make QWindow::setVisible() work for widgetsMorten Johan Sørvig2017-05-113-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWidget has its own setVisible() code that needs to be run in order to correctly transition widget visibility. It is desirable to be able to show and hide (native) widgets also from the QWindow side, for example from the platform plugin, or from generic QWindow handling code in QtGui. Add a new virtual QWindowPrivate::setVisible() and move the QWindow visibility implementation there. Subclasses can now override this function to add custom code. Make QWidgetPrivate::show/hide_sys() call the QWindowPrivate setVisible implementation instead of the QWindow setVisible public API. Change-Id: I082f174b100659e1221d5898b490f8a9f498abdf Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-05-072-6/+6
|\| | | | | | | | | | | | | | | Conflicts: src/network/access/qnetworkreply.cpp tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp Change-Id: Iadf766269454087e69fb216fc3857d85b0ddfaad
| * macOS: Add auto-release pools for Q*ApplicationPrivate::init()Tor Arne Vestbø2017-05-021-0/+4
| | | | | | | | | | | | | | | | | | | | So that any objects autoreleased during application initialization are released. Otherwise they will end up in the root level pool and only be released when the application exits and the application goes out of scope. Change-Id: If02d24fd70098f9b4b1b0ea3218e0a15e438b9db Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * QOpenGLWidget: Fix UB (invalid cast) in ~QOpenGLWidgetPrivateDyami Caliri2017-04-271-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QOpenGLWidgetPrivate destructor calls reset(), which accesses the Q-pointer. Calling Q_Q(Class) while still inside the private class's destructor is wrong due to the cast in q_func() which is undefined behavior at that stage. Here is the UB report: qopenglwidget.cpp:548:5: runtime error: downcast of address 0x000016d0e200 which does not point to an object of type 'QOpenGLWidget' 0x000016d0e200: note: object is of type 'QObject' 00 00 00 00 10 30 32 0f 00 00 00 00 40 e2 d0 16 00 00 00 00 80 7b 42 0f 00 00 00 00 00 00 00 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QObject' 0 QOpenGLWidgetPrivate::reset qopenglwidget.cpp 656 0x607e667 1 QOpenGLWidgetPrivate::~QOpenGLWidgetPrivate qopenglwidget.cpp 570 0x60982ab 2 QOpenGLWidgetPrivate::~QOpenGLWidgetPrivate qopenglwidget.cpp 569 0x6098516 3 QScopedPointerDeleter<QObjectData>::cleanup qscopedpointer.h 54 0xcbf7058 4 QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::~QScopedPointer qscopedpointer.h 101 0xcbde858 5 QObject::~QObject qobject.cpp 1042 0xcb94792 6 QWidget::~QWidget qwidget.cpp 1701 0x5e173f7 7 QOpenGLWidget::~QOpenGLWidget qopenglwidget.cpp 946 0x608d72b 8 ImagePreviewComponent::~ImagePreviewComponent imagepreviewcomponent.h 16 0x58237b6 9 ImagePreviewComponent::~ImagePreviewComponent imagepreviewcomponent.h 16 0x58238c6 Change-Id: If13932ac657afb9d1358ac82ab911a05e96cfbcd Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | cleanup: remove redundant QGuiApplicationPrivate::buttonsGatis Paeglis2017-05-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This variable was introducing during Qt 5.0 Q{Gui}Application refactoring days (2011 or even before) and since then has been used interchangeably with QGuiApplicationPrivate::mouse_buttons. This patch removes the duplicate member variable as it is redundant and could be a source of potential errors. Initially I was thinking that ::buttons might be used for the purpose of QTestLib, but it is not. QTestLib delivers mouse events directly via qApp->notify() (mouse button state is update via QGuiApplicationPrivate::mouse_buttons from notify()), or via window system interface QWindowSystemInterface::handleMouseEvent (which goes through QGuiApplication::processMouseEvent). Looking at QGuiApplication, it is clear that ::buttons and ::mouse_buttons always have the same value, as there is only one assignment to these members in QGuiApplication: mouse_buttons = buttons = e->buttons; And there are no other places that would assign to QGuiApplicationPrivate::buttons. Change-Id: Ib60d366bf056a98b15bb4538a569693e7bd022e2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Docs: Fix some warningsFriedemann Kleint2017-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtbase/src/corelib/tools/qbytearray.cpp:3043: warning: Can't link to '.' qtbase/src/corelib/tools/qstring.cpp:4522: warning: Can't link to '.' qtbase/src/corelib/tools/qstring.cpp:10331: warning: Can't link to '.' qtbase/src/network/access/qhstspolicy.cpp:105: warning: Undocumented parameter 'flags' in QHstsPolicy::QHstsPolicy() qtbase/src/network/access/qhstspolicy.cpp:105: warning: No such parameter 'includeSubDomains' in QHstsPolicy::QHstsPolicy() qtbase/src/network/access/qnetworkaccessmanager.cpp:732: warning: Undocumented parameter 'knownHosts' in QNetworkAccessManager::addStrictTransportSecurityHosts() qtbase/src/network/access/qnetworkreply.cpp:307: warning: Can't link to 'QNetworkRequest::UserVerifiedRedirectsPolicy' qtbase/src/gui/painting/qpagedpaintdevice.cpp:246: warning: No such enum item 'PdfFormat_1_4' in QPagedPaintDevice::PdfVersion qtbase/src/gui/painting/qpagedpaintdevice.cpp:246: warning: Undocumented enum item 'PdfVersion_1_4' in QPagedPaintDevice::PdfVersion qtbase/src/gui/painting/qpagedpaintdevice.cpp:246: warning: Undocumented enum item 'PdfVersion_A1b' in QPagedPaintDevice::PdfVersion qtbase/src/gui/painting/qpagedpaintdevice.cpp:246: warning: No such enum item 'PdfFormat_A1b' in QPagedPaintDevice::PdfVersion qtbase/src/widgets/kernel/qopenglwidget.cpp:1076: warning: Undocumented parameter 'texFormat' in QOpenGLWidget::setTextureFormat() qtbase/src/corelib/tools/qversionnumber.cpp:460: warning: Command '\snippet (//! [3-latin1-1])' failed at end of file 'qversionnumber/main.cpp' Change-Id: Icc163dd8d94cee7e0858040bf8241a3c1f1d221d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-204-29/+18
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.h src/corelib/tools/qdatetime.h src/corelib/tools/qstring.h src/corelib/tools/qversionnumber.h src/plugins/platforms/android/qandroidplatformintegration.cpp tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp Change-Id: Iefd92a435e687a76cd593099e40d9a9620a1454d
| * Move Q_REQUIRED_RESULT to its correct positionThiago Macieira2017-04-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | That's before the return type or static, inline, constexpr or such keywords (if any). Perl Script: s/^(\s+)(.*) Q_REQUIRED_RESULT(;)?(\s*\/\/.*)?$/\1Q_REQUIRED_RESULT \2\3\4/ Change-Id: I7814054a102a407d876ffffd14b6a16182f159e2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Fix UB in QWidgetEffectSourcePrivate::detachOlivier Goffart2017-04-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Delete the QGraphicsEffect from the QWidget destructor instead of from the QWidgetPrivate destructor. The destructor of QGraphicsEffect still access methods of the QWidget, but the QObjectPrivate being destroyed from ~QObject, the pointer is no longer a QWidget. Fix warning with UB sanitizer in tst_QWidget::setGraphicsEffect qwidget_p.h:900:23: runtime error: member call on address 0x000001d822c0 which does not point to an object of type 'QWidget' 0x000001d822c0: note: object is of type 'QObject' 00 00 00 00 b0 46 5f 40 e5 7f 00 00 00 23 d8 01 00 00 00 00 f0 e6 00 44 e5 7f 00 00 00 00 74 47 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QObject' #0 0x7fe54767db76 in QWidgetEffectSourcePrivate::detach() #1 0x7fe548f29815 in QGraphicsEffect::~QGraphicsEffect() #2 0x7fe548f2a1b7 in QGraphicsBlurEffect::~QGraphicsBlurEffect() #3 0x7fe548f2a208 in QGraphicsBlurEffect::~QGraphicsBlurEffect() #4 0x7fe5475cd463 in QWidgetPrivate::~QWidgetPrivate() #5 0x7fe5475ce62c in QWidgetPrivate::~QWidgetPrivate() #6 0x7fe5400d0dda in QObject::~QObject() #7 0x7fe54763d411 in QWidget::~QWidget() #8 0x7fe54763d7f4 in QWidget::~QWidget() #9 0x4cc309 in QScopedPointerDeleter<QWidget>::cleanup(QWidget*) #10 0x4cc309 in QScopedPointer<QWidget, QScopedPointerDeleter<QWidget> >::reset(QWidget*) #11 0x4cc309 in tst_QWidget::setGraphicsEffect() Change-Id: I19c049e979cfce2adda908af8336cb4adac8f6c4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Fix UB in QLayout::childEventOlivier Goffart2017-04-191-22/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't just static_cast a child to QLayout, because the child might not be a QLayout, and even if it was, we might be called from the QObject destructor so we would not be a layout anymore. Instead we can just qobject_cast the deleted object to a QLayout and remove it from the layout with removeItem. This would not take in account the case where we would be called because the QLayout gets destroyed, so we handle this case from ~QLayout by removing ourself from the parent. Note that the comment in ~QLayout was wrong, as the layout gets destroyed explicitly from ~QWidget, not from ~QObject. Change-Id: I49c6f17a76f207b9d750b6e5d987469498b96b31 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-04-121-2/+3
| |\ | | | | | | | | | Change-Id: I3bd83a839b16822035ed56a5cffe77bd6bc3f08d
| | * Fix menu position when highdpi scalingMorten Johan Sørvig2017-04-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Certain display and scale factor configurations would cause menus to pop up in incorrect locations or not be shown at all. This was due to QDesktopWidget::screenNumber() having a toNativePixels(QRect, QWindow) call which requires that QWindow::screen() returns the correct screen. Break the circular dependency by converting coordinates the other way for the intersection test: transform screen geometry to device independent coordinates. Task-number: QTBUG-58329 Change-Id: I5621de89a9a2b8df44bdae528baf011fc111eba3 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Pluginize the platform stylesJake Petroules2017-04-143-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enforces decoupling and in the case of QMacStyle, isolates QtWidgets and therefore end user applications, from Carbon/HITheme. Windows and Fusion are platform independent, so they remain built-in (but mostly because the Windows style is tightly coupled to other styles like QStylesheetStyle). Task-number: QTBUG-59428 Change-Id: Id6519fe0c5269c1bce5b5921f9db06257032a1c9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | | Remove the Windows XP style from public accessibilityJake Petroules2017-04-132-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Later, the Windows XP style will be removed entirely by means of being merged with the Windows Vista style (which inherits from the XP style). There was actually no reason for these styles being separate classes in the first place, because both result in the same appearance for controls on the running version of Windows. Therefore, the windowsxp style merely appears as a "broken" version of the windowsvista style, with only minor differences based on the additional metrics that the vista style provides. The windowsxp style does NOT, and never did, allow users to get a Windows XP style appearance on Windows 7 and above (which is currently Qt's minimum supported platform). Therefore, now that Qt no longer supports Windows XP, the windowsxp style is unusable. [ChangeLog][QtWidgets] The windowsxp style is no longer available as a separate style, because it did not (and cannot) actually provide an XP-style appearance on currently supported Qt platforms. Change-Id: I513d9bce3f247f97cfb28dfee88fe888469e0a6f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-072-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/linux-icc/qmake.conf mkspecs/macx-icc/qmake.conf mkspecs/win32-icc/qmake.conf src/gui/painting/qgrayraster.c Change-Id: Ib08c45ea3215be05f986ecb3e1f4b37d209aa775
| * | Fix warning for -no-feature-graphicsviewStephan Binner2017-04-041-1/+1
| | | | | | | | | | | | | | | Change-Id: I11ab0c664b860014376c725ea162e62740234ea4 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * | Fix warning for -no-feature-menubarStephan Binner2017-04-041-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: I58573d769897c956144604d51d38cad1c121f751 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-281-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/examples.pro tests/auto/corelib/tools/qchar/tst_qchar.cpp tests/auto/other/qaccessibility/accessiblewidgets.h Change-Id: I426696c40ab57d14dc295b8103152cede79f244c
| * | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-271-1/+1
| |\| | | | | | | | | | Change-Id: Icdd71e9713725bda9c305e338f5c8b41a92ed8e8
| | * Fix propagation of locale from widget to its childrenEdward Welbourne2017-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the condition in QWidgetPrivate::resolveLocale() to decide whether to propagate locale: make it match setLocale_helper()'s condition when deciding whether to propagate to descendants. This lead to a QDateTimeEdit's calendar popup not getting told what locale to use correctly, unless we setLocale() on it overtly, which then blocked propagation of locale changes to it unless QDateTimeEdit manually propagated the changes. Fix the documentation of WA_WindowPropagation to mention locale as also being propagated (which it was in several places, only neglecting this one in resolveLocale). [ChangeLog][QWidget][Qt::WA_WindowPropagation] Propagate locale consistently, along with font and palette, within the widget hierarchy. Previously, locale was propagated on ancestral setLocale(), but not on creation of the descendant. Task-number: QTBUG-59106 Change-Id: I92270f7789c8eda66a458274a658c84c7b0df754 Reviewed-by: David Faure <david.faure@kdab.com>
* | | Fix clipping of graphics effects in high dpi modeDaniel Teske2017-03-282-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider this pseudo code: setSystemClip(region); setSystemTransform( scale 2x ); setSystemTransform( scale 2x ); The second call to setSystemTransform should be a noop. Yet, with the current code in setSystemTransform, the region would be scaled twice by 2x and thus the clipping would be incorrect. Fix that by saving the original untransformed clip and in setSystemTransform recalculate the effective transform. This is also a better fix for QTBUG-44067 / sha: 083a945c166b325298a43ba591b1338d1b0f99b6, since with this patch the order in which system clip, viewport and transform are set does no longer matter. Task-number: QTBUG-57257 Task-number: QTBUG-55698 Change-Id: Ibc232822e97ab116f7173a0cc50bba5a367619d8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-203-2/+17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qfilesystemengine_win.cpp src/gui/text/qdistancefield.cpp src/plugins/platforms/xcb/qxcbconnection.h Change-Id: I1be4a6f440ccb7599991159e3cb9de60990e4b1e
| * | Set default fbo redirect correctly for QOpenGLWidget viewportsLaszlo Agocs2017-03-181-0/+14
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-59318 Change-Id: Icf2ea4e5ebdeec31750edc8b34a9b9f6bfb64744 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
| * | When changing screen, only update the font if dpi has changedOlivier Goffart2017-03-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generally, this might avoid unnecessary work in a quite common case. But if high dpi scaling is set, the dpi (in logical pixels) does not change. However this event is sent before QGuiApplicationPrivate::processWindowScreenChangedEvent has had time to change the geometry, and might cause a problem in QMenu Amends f3a4b4258f2d207b5a8e73d62822a3afe1bf8a72. Task-number: QTBUG-59484 Change-Id: Ie4ceedcb0754613cf239ae86b225c4139b70d0cc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>