Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
4.8.6, 4.8.7
-
None
-
Windows 7 (MSVC 2010 SP1, CL 16.00),
Windows 8 (MSVC 2013 U4, CL 18),
Fedora 20 (GCC 4.8.3)
.tag file contents (qt-everywhere-opensource-src-4.8.7.zip):
Source revision: 445d29dbb8135944ff3a9283b7622de75d68e747
Mkdist revision: c289c371d78d8e2536a7019e02b3f336a9706906
.tag file contents (qt-everywhere-opensource-src-4.8.6.zip):
Source revision: 68a911862e05400ced87971c43fb27fb5d5d8ebd
Mkdist revision: 7488d1bf0a91367a81f142c1f5a46d577afd96a7
Windows 7 (MSVC 2010 SP1, CL 16.00), Windows 8 (MSVC 2013 U4, CL 18), Fedora 20 (GCC 4.8.3) .tag file contents (qt-everywhere-opensource-src-4.8.7.zip): Source revision: 445d29dbb8135944ff3a9283b7622de75d68e747 Mkdist revision: c289c371d78d8e2536a7019e02b3f336a9706906 .tag file contents (qt-everywhere-opensource-src-4.8.6.zip): Source revision: 68a911862e05400ced87971c43fb27fb5d5d8ebd Mkdist revision: 7488d1bf0a91367a81f142c1f5a46d577afd96a7
Description
When you show a dialog window containing a Q3ListView, close the dialog and then disable the "always on top" feature of the main window, then deleting the dialog causes a crash. Seems it fails to unregister from Qt's backing store (stack trace below).
More precisely, the following sequence of events causes a crash:
1) Create a QMainWindow
2) Show a QDialog containing a Q3ListView instance, with main window being its parent
3) Close the dialog
4) Modify main window's WindowFlags:
setAttribute(Qt::WA_Resized, true); Qt::WindowFlags flags = windowFlags(); setWindowFlags(flags ^ (Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint)); setVisible(true);
5) Delete the dialog
The crash occurs in qbackingstore.cpp in line 499 (marked with a comment):
for (int i = 0; i < count; ++i) { QWidget *w = staticWidgets.at(i); QWidgetPrivate *wd = w->d_func(); if (!wd->isOpaque || !wd->extra || wd->extra->staticContentsSize.isEmpty()// * || !w->isVisible() || (parent && !parent->isAncestorOf(w))) { continue; }
because wd points to a deleted widget.
Full stack trace:
.QtGuid4.dll!QWidgetBackingStore::staticContents(QWidget * parent, const QRect & withinClipRect) Line 499 C++
QtGuid4.dll!QWidgetBackingStore::sync() Line 1200 C++
QtGuid4.dll!QWidgetPrivate::syncBackingStore() Line 1896 C++
QtGuid4.dll!QWidget::event(QEvent * event) Line 8694 C++
QtGuid4.dll!QMainWindow::event(QEvent * event) Line 1479 C++
QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 4565 C++
QtGuid4.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 4530 C++
QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 955 C++
QtCored4.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 231 C++
QtCored4.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1579 C++
QtCored4.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned __int64 wp, __int64 lp) Line 498 C++
[External Code]
QtCored4.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 823 C++
QtGuid4.dll!QGuiEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 1216 C++
QtCored4.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 150 C++
QtCored4.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 204 C++
QtCored4.dll!QCoreApplication::exec() Line 1227 C++
QtGuid4.dll!QApplication::exec() Line 3824 C++
qt_bug.exe!main(int argc, char * * argv) Line 58 C++
qt_bug.exe!WinMain(HINSTANCE__ * instance, HINSTANCE__ * prevInstance, char * __formal, int cmdShow) Line 131 C++
Please find a complete example that reproduces the issue in the attachment.
Remarks:
- In the attached example, all steps are contained in one function (go) for simplicity. The crash occurs even when the dialog is shown on the screen, closed by the user, and then deleted.
- When you change delete dialog; to dialog->deleteLater(); it will crash anyway
- When you change Q3ListView to QWidget it won't crash
- When you change Q3ListView to Q3Table or Q3DataTable it will crash also