summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Convert features.columnview to QT_[REQUIRE_]CONFIGStephan Binner2017-06-126-24/+19
| | | | | | | Side effect: fix of QT_NO_COLUMNVIEW <-> QT_NO_QCOLUMNVIEW inconsistency. Change-Id: I42702ea7b362a4b6fb5dad78ee105e6cbbf8bcf6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Drop dead qfiledialog_embedded.uiStephan Binner2017-06-122-355/+1
| | | | | Change-Id: Ia20fe65d08a8a477dc1c56ad5dcd3db5144c25a1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QDialog: Fix typo in documentationhjk2017-06-121-1/+1
| | | | | Change-Id: I0cbcd007976a974d7491595b59cc463f6443d4b0 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Doc: Update widget style gallery topicLeena Miettinen2017-06-0921-736/+63
| | | | | | | | | | | To avoid repetition, remove the individual style gallery topics. Add images of the Styles and Calendar widget examples and use them instead of individual images of each widget. Task-number: QTBUG-5894 Change-Id: I1231824df60e39e8fb89ac2a764e12151636c019 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QPlainTextEdit: not show place holder when having preedit stringLiang Qi2017-06-081-1/+1
| | | | | | | Task-number: QTBUG-61210 Change-Id: I4891c21fc4e1923b5929defeacab26114c00a7e3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* 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>
* Doc: Remove references to screenshots illustrating different stylesLeena Miettinen2017-06-0122-231/+51
| | | | | | | | | | | | | | | | ... from widget class descriptions. Use one screenshot from Windows instead. The styles change and the screenshots become outdated very fast, so it is easier to update just one screenshot now and then. The styles can still be seen in the style gallery topics. The image files will be removed in a follow-up commit after all references to them have been removed. Change-Id: Id326c141f4884a2e4f67a4fe8681d8c65f8b24ba Reviewed-by: Martin Smith <martin.smith@qt.io>
* Merge remote-tracking branch 'origin/5.9.0' into 5.9Liang Qi2017-05-311-3/+5
|\ | | | | | | Change-Id: I2d7a3f3a80e6287e135e55b650f74f9a540332bc
| * QHeaderView: fix visual/logical index corruption when restoring statev5.9.0-rc2v5.9.0David Faure2017-05-261-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a followup to 77a8e90cddcfa1c34518ef846a4838874a7bc0c7 which didn't handle the case where no columns had been moved. visualIndices and logicalIndices are empty until initializeIndexMapping() is called, in which case appending is wrong. As a result, visualIndex(i) would return -1 for the values over those added by read(), and an assert would happen at painting time. The fix is to leave visualIndices and logicalIndices empty if they are empty already, leaving it to initializeIndexMapping() to fill them later if necessary (e.g. when moving a column). Task-number: QTBUG-60837 Change-Id: Ia7e4b9d3122647984acd434dfaa0400df319d065 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | 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>
* | Convert features.splashscreen to QT_REQUIRE_CONFIGStephan Binner2017-05-293-10/+10
| | | | | | | | | | Change-Id: Ie46b7c6fb52773dea25c552a77c96d800f471738 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Convert features.lcdnumber to QT_[REQUIRE_]CONFIGStephan Binner2017-05-294-10/+12
| | | | | | | | | | Change-Id: Ie99d2ce0a836c27fb882c04ff465e6cdd483d360 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Convert features.movie to QT_[REQUIRE_]CONFIGStephan Binner2017-05-294-14/+16
| | | | | | | | | | Change-Id: I838c7305d4649f953c5bb972f1aa51dbb078afe2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@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>
* | Use hasFocus() to check if the QTreeView is considered active or notAndy Shaw2017-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | When drawing the branches in a QTreeView, it should use hasFocus() to determine if it is the active widget or not. This is how it checks when styling the other aspects of the treeview, so the branches should be done in line with this. Change-Id: Id721401424ad95e9fc7ffbdc991e53b5f7feac01 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | Doc: Replace "Macintosh" with something suitable or omit itLeena Miettinen2017-05-231-2/+2
|/ | | | | Change-Id: I3067bd7e6ae2d6d68d5232a56eaf368a0415876c Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Doc: Add information about styling QTableView::indicatorVenugopal Shivashankar2017-05-043-0/+12
| | | | | | | Task-number: QTBUG-60245 Change-Id: I068d74d3d1d3ffb872ac6fec830367d67b65049d Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* QMenu: Ensure popup() gets the right screen geometryGabriel de Dietrich2017-05-041-9/+11
| | | | | | | | | | | | | | | | | | | | | | Many QMenu related functions end up calling sizeHint() which does call updateActionRects(). Since we try not to update the action rects if no action has changed, we must be careful to call it the first time with the right screen geometry. Other- wise, multi-display setups may get the action rects based on the wrong display. In QMenu::popup(), this can be solved by using the position passed as argument. Incidentally, we were already computing the right display geometry in the same function, only a bit later. The updated position around an eventual push button menu should not change the screen onto which the menu popup will be displayed. Tested with the multiscreen-menus manual test. Change-Id: Id7fc24be6908b4a9d24b8b9c8b8006efe45d69be Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fix warning for -no-feature-graphicsviewStephan Binner2017-05-031-0/+2
| | | | | | | Change-Id: I3229fccd2f837b8b8b4da2a149d4584cb4a54dab Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMenu: Refactor column layout logicGabriel de Dietrich2017-05-031-5/+3
| | | | | Change-Id: I30f1c87092447abf1c94e69c0124eeeee43666e2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* 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>
* QFileDialogPrivate: Move inline to declarationFriedemann Kleint2017-05-021-20/+21
| | | | | | | | | | | | | Fixes MSVC warning: src/widgets/dialogs/qfiledialog_p.h(412): warning C4273: 'QFileDialogPrivate::selectedMimeTypeFilter_sys': inconsistent dll linkage while building tst_qfiledialog2. Amends change 34f82b8abcb279542b6350e70609c549e39caafb. Change-Id: I7306535000af73ee3a027b14a2d5cfce4f889e85 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* macOS: Fix return value of PM_TabBarBaseHeight to original valueAndy Shaw2017-05-021-1/+1
| | | | | | | | | | | | | When the tabbar styling was improved in change 175f33ed855b0a8a30daafacd4f48fa3f8e76a9b it changed PM_TabBarBaseHeight to 21 which is incorrect as this value represents the spacing between the tab pages and the tabbar. In macOS style there is no space so this should be set to 0. Task-number: QTBUG-60307 Change-Id: I2ce39ff2fc924d2d83843fab78b311153b4ee08f Reviewed-by: Oleg Yadrov <oleg.yadrov@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* QMacStyle: Increase accuracy of PM_TitleBarHeightGabriel de Dietrich2017-05-021-4/+6
| | | | | | | | In some cases, we'd want such value to come from the platform theme, but we'd need new API for this. Change-Id: Ic7053fa17ac8b2f207db031095c4e4aefae000c2 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Fix warning for -no-feature-lineeditTasuku Suzuki2017-04-301-0/+2
| | | | | | | Change-Id: Ia56d5d7266a379f911e4db61e60b8b39af5b6342 Reviewed-by: Stephan Binner <stephan.binner@basyskom.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix warnings with -no-feature-menuTasuku Suzuki2017-04-302-2/+5
| | | | | | | Change-Id: I1e62e3772dbd5f17d9ad69025b23e3726386c2bd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Stephan Binner <stephan.binner@basyskom.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build without features.style-stylesheetTasuku Suzuki2017-04-281-1/+1
| | | | | | Change-Id: Ib7cf5db6c9a49e7f359410bc0ec3d1ceadcde5cf Reviewed-by: Stephan Binner <stephan.binner@basyskom.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix build without features.shortcutTasuku Suzuki2017-04-274-2/+8
| | | | | | Change-Id: I87a7ba1a77b0671559616a3ea4722bcc233af32d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@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>
* QMenu: Display the menu title on the torn-off menu's title barGabriel de Dietrich2017-04-261-1/+15
| | | | | | Change-Id: If16e262a6c8b39dff517cc105cf55686d4c22582 Task-number: QTBUG-11693 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix warnings for -no-feature-animationStephan Binner2017-04-252-4/+8
| | | | | Change-Id: I624e68e96d2a673b36d9519d1189fe4a25e1fbd0 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix UB in QSplitter::childEventOlivier Goffart2017-04-231-9/+10
| | | | | | | | | | | The widget might be in the QObject destructor when the event is received, so we can't static cast. There is no need to check for isWindow for ChildRemoved because it would not otherwise be on our list. Change-Id: Ifc0a2979f1f6720f1963399276a28ac4a3224fff Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Deprecate QCoreApplication::flush()Gatis Paeglis2017-04-222-24/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... as it has outlived its original purpose: Qt3 implementation on X11: void QApplication::flush() { flushX(); } void QApplication::flushX() { if (appDpy) XFlush( appDpy ); } Qt4 implementation on X11: Did nothing when QApplication::flush() was called (the flush() overrides in {unix,glib} event dispatchers with empty bodies). In Qt5 this function somehow has been repurposed (inconsistently) to do what QCoreApplication::sendPostedEvents already does: QAbstractEventDispatcher::flush() = 0; => QCocoaEventDispatcher::flush() {} => QEventDispatcherCoreFoundation::flush() {} => QIOSEventDispatcher (does not override ::flush()) => QEventDispatcherGlib::flush() {} => QPAEventDispatcherGlib (does not override ::flush()) => QEventDispatcherUNIX::flush() {} => QUnixEventDispatcherQPA (when QT_NO_GLIB=true) ::flush() { if (qApp) qApp->sendPostedEvents(); }) ==> QAndroidEventDispatcher (does not override ::flush()) => QEventDispatcherWin32::flush() {} => QOffscreenEventDispatcher::flush() { if (qApp) qApp->sendPostedEvents(); QEventDispatcherWin32::flush(); } => QWindowsGuiEventDispatcher (does not override ::flush()) => QWindowsDirect2DEventDispatcher (does not override ::flush()) => QEventDispatcherWinRT::flush() {} => QOffscreenEventDispatcher::flush() { if (qApp) qApp->sendPostedEvents(); QEventDispatcherWinRT::flush(); } => QWinRTEventDispatcher (qminimaleglintegration.cpp) (does not override ::flush()) => QWinRTEventDispatcher (qwinrteventdispatcher.h) (does not override ::flush()) Whatever this function was doing on macOS in Qt3 and Qt4 also has been dropped in Qt5. It appears that the other event dispatchers in Qt5 that have overrides for flush() have simply copy-pasted this logic. Clearly the documentation of QCoreApplication::flush() is outdated and has nothing to do with the actual implementation in Qt5. This function is rarely used in Qt5 sources. It should be safe to remove the calls to QCoreApplication::flush() from Qt source code, as this function has been doing nothing on most platforms anyways. Repurposing it even broke handling of posted events (see QTBUG-48717). [ChangeLog][QtCore][Event loop] QCoreApplication::flush() is now deprecated. Use QCoreApplication::processEvents() and QCoreApplication::sendPostedEvents() instead. Task-number: QTBUG-33489 Task-number: QTBUG-48717 Change-Id: Icc7347ff203024b7153ea74be6bf527dd07ce821 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
* QMacStyle: Fix scroller memory leakv5.9.0-beta3Morten Johan Sørvig2017-04-212-5/+14
| | | | | | | | | | | | | | | | | Calling initWithFrame repeatedly on the same object leaks memory since internal structures allocated on the previous init call will not be released. However, initWithFrame is the only API that can set scroller direction, which is does based on the geometry. Use two scroller objets, one for each of the horizontal and vertical cases. Task-number: QTBUG-60004 Change-Id: I5d07b62e6969a1824ab705941ac4d0340139b99c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* QMacStyle: Properly flip vertical slidersGabriel de Dietrich2017-04-211-2/+4
| | | | | | | | | | | | | | Cocoa is better than us at vertically flipping views, so we use that API instead of fiddling with the graphics context transforms. But only so from 10.12 onwards. Go figure. This also fixes a one pixel offset with horizontal sliders handle on non-retina displays. Change-Id: Ia3da8431ad0499a4b6fb7bf6973ed353d91c2905 Task-number: QTBUG-59666 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Remove wrong features.rubberband condition of features.itemviewsStephan Binner2017-04-211-1/+1
| | | | | Change-Id: I0eff127baba2f8677ae08bb18ef0b4bb742d7b6e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove features.rubberband dependency of features.splitterStephan Binner2017-04-213-2/+13
| | | | | Change-Id: Ia55850f37f9384c8e00cef699fa308a02af64fd5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove wrong features.rubberband condition of features.dockwidgetStephan Binner2017-04-213-3/+1
| | | | | Change-Id: I8259274e7eba7943eb3a944a18fa8b598eb697d7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix QComboBox popup from opening on wrong screenJoni Poikelin2017-04-211-0/+16
| | | | | | | | | Nothing seems to be telling the popup on which screen it should be shown on. To fix this, simply set same screen the QComboBox uses to the popup. Task-number: QTBUG-58392 Change-Id: If62a26fe4e51bcf3d770ee72c9baa998541618f4 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* QErrorMessage: use QStringBuilderMarc Mutz2017-04-201-21/+24
| | | | | | | | | | | | | | | Extract Method msgType2i18nString() and use it to build 'rich' in a single QStringBuilder expression. Replace the switch over QtMsgType with an array of QT_TRANSLATE_NOOP'ed strings. That introduces a dependency on the order and amount of enum values, so add static and dynamic asserts to catch any change. Saves memory allocations, as well as nearly 300B in text size on GCC 7 optimized Linux AMD64 builds. Change-Id: I48cc916cba283e482a90ca4ae28aa17b26a4e5ab Reviewed-by: David Faure <david.faure@kdab.com>
* 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>
* QLineEdit: Make the clear button always the leftmost buttonElvis Angelaccio2017-04-191-0/+11
| | | | | | | | | | | | | | QLineEditIconButton currently draws a fully transparent pixmap in its paintEvent() function, when the line edit is empty. This does not work when there is another trailing QAction that is visible even when the line edit has no text, as reported in QTBUG-59957. To fix this issue, make sure the clear button is always the leftmost button. Task-number: QTBUG-59957 Change-Id: I8a4f96aae07856aa0e1053ebb338ba9bdf052a16 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix build for -no-feature-cssparserStephan Binner2017-04-191-0/+2
| | | | | Change-Id: I78b66e8a98458736c69c4955390a98f8889968ea Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix warning for -no-feature-graphicseffectStephan Binner2017-04-191-0/+1
| | | | | Change-Id: I0be9e4293dfcef3c144f4e998ea071336c4d56d3 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix warning for -no-feature-gesturesStephan Binner2017-04-191-2/+2
| | | | | Change-Id: Iaadc4e27ee2a75a8c053de4438ef74daaa48ee64 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix warnings for -no-feature-texthtmlparserStephan Binner2017-04-192-0/+3
| | | | | Change-Id: Ie757e4ecb9ced14bd809f56d2d3d09274fc3bc39 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>