Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-51996

QGLWidget and QFileSystemModel do not work together

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.6.0
    • QPA: Windows
    • None
    • Windows 10, Visual Studio Community 2015.

    Description

      I have a Qt application since years. Now I was updating to Qt 5.6 from 5.4 and having quite serious issues when using both QGLWidget and QFileSystemModel. Using one of them works fine.

      I get an exception as soon as I display both at the same time.

      I made and example application by merging the examples hellogl and dirview.
      I just added

      	const QString rootPath;
      
      	QFileSystemModel* model = new QFileSystemModel();
      	model->setRootPath("");
      	QTreeView* w = new QTreeView();
      	w->setModel(model);
      	if (!rootPath.isEmpty()) {
      		const QModelIndex rootIndex = model->index(QDir::cleanPath(rootPath));
      		if (rootIndex.isValid())
      			w->setRootIndex(rootIndex);
      	}
      
      	// Demonstrating look and feel features
      	w->setAnimated(false);
      	w->setIndentation(20);
      	w->setSortingEnabled(true);
      	const QSize availableSize = QApplication::desktop()->availableGeometry(w).size();
      	w->resize(availableSize / 2);
      	w->setColumnWidth(0, w->width() / 3);
      
      	w->setWindowTitle(QObject::tr("Dir View"));
      	w->show();
      	mainLayout->addWidget(w);
      

      to Window::Window() of hellogl.

      Exception thrown at 0x00007FFD487494CE (Qt5Guid.dll) in hellogl.exe: 0xC0000005: Access violation reading location 0x0000000000000118.
      
      If there is a handler for this exception, the program may be safely continued.
      

      stack:

       	Qt5Guid.dll!QTransform::type() Line 2073	C++
       	Qt5Guid.dll!QRasterPaintEngine::drawImage(const QRectF & r, const QImage & img, const QRectF & sr, QFlags<enum Qt::ImageConversionFlag> __formal) Line 2202	C++
       	Qt5Guid.dll!QRasterPaintEngine::drawPixmap(const QRectF & r, const QPixmap & pixmap, const QRectF & sr) Line 2052	C++
       	Qt5Guid.dll!QPainter::drawPixmap(const QRectF & r, const QPixmap & pm, const QRectF & sr) Line 5196	C++
      >	Qt5Guid.dll!QPainter::drawPixmap(const QRect & r, const QPixmap & pm) Line 774	C++
       	Qt5Guid.dll!QPixmapIconEngine::paint(QPainter * painter, const QRect & rect, QIcon::Mode mode, QIcon::State state) Line 176	C++
       	Qt5Guid.dll!QIcon::paint(QPainter * painter, const QRect & rect, QFlags<enum Qt::AlignmentFlag> alignment, QIcon::Mode mode, QIcon::State state) Line 902	C++
       	Qt5Widgetsd.dll!QCommonStyle::drawControl(QStyle::ControlElement element, const QStyleOption * opt, QPainter * p, const QWidget * widget) Line 2182	C++
       	Qt5Widgetsd.dll!QWindowsStyle::drawControl(QStyle::ControlElement ce, const QStyleOption * opt, QPainter * p, const QWidget * widget) Line 1856	C++
       	Qt5Widgetsd.dll!QWindowsXPStyle::drawControl(QStyle::ControlElement element, const QStyleOption * option, QPainter * p, const QWidget * widget) Line 2529	C++
       	Qt5Widgetsd.dll!QWindowsVistaStyle::drawControl(QStyle::ControlElement element, const QStyleOption * option, QPainter * painter, const QWidget * widget) Line 1463	C++
       	Qt5Widgetsd.dll!QStyledItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) Line 414	C++
       	Qt5Widgetsd.dll!QTreeView::drawRow(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) Line 1769	C++
       	Qt5Widgetsd.dll!QTreeView::drawTree(QPainter * painter, const QRegion & region) Line 1504	C++
       	Qt5Widgetsd.dll!QTreeView::paintEvent(QPaintEvent * event) Line 1329	C++
       	Qt5Widgetsd.dll!QWidget::event(QEvent * event) Line 8896	C++
       	Qt5Widgetsd.dll!QFrame::event(QEvent * e) Line 544	C++
       	Qt5Widgetsd.dll!QAbstractScrollArea::viewportEvent(QEvent * e) Line 1206	C++
       	Qt5Widgetsd.dll!QAbstractItemView::viewportEvent(QEvent * event) Line 1686	C++
       	Qt5Widgetsd.dll!QTreeView::viewportEvent(QEvent * event) Line 1310	C++
       	Qt5Widgetsd.dll!QAbstractScrollAreaPrivate::viewportEvent(QEvent * event) Line 105	C++
       	Qt5Widgetsd.dll!QAbstractScrollAreaFilter::eventFilter(QObject * o, QEvent * e) Line 121	C++
       	Qt5Cored.dll!QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject * receiver, QEvent * event) Line 1126	C++
       	Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3710	C++
       	Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3677	C++
       	Qt5Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1015	C++
       	Qt5Cored.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) Line 230	C++
       	Qt5Widgetsd.dll!QWidgetPrivate::sendPaintEvent(const QRegion & toBePainted) Line 5670	C++
       	Qt5Widgetsd.dll!QWidgetPrivate::drawWidget(QPaintDevice * pdev, const QRegion & rgn, const QPoint & offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 5611	C++
       	Qt5Widgetsd.dll!QWidgetBackingStore::doSync() Line 1349	C++
       	Qt5Widgetsd.dll!QWidgetBackingStore::sync(QWidget * exposedWidget, const QRegion & exposedRegion) Line 1119	C++
       	Qt5Widgetsd.dll!QWidgetPrivate::syncBackingStore(const QRegion & region) Line 1947	C++
       	Qt5Widgetsd.dll!QWidgetWindow::handleExposeEvent(QExposeEvent * event) Line 824	C++
       	Qt5Widgetsd.dll!QWidgetWindow::event(QEvent * event) Line 256	C++
       	Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3714	C++
       	Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3157	C++
       	Qt5Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1015	C++
       	Qt5Cored.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) Line 230	C++
       	Qt5Guid.dll!QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent * e) Line 2733	C++
       	Qt5Guid.dll!QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent * e) Line 1715	C++
       	Qt5Guid.dll!QWindowSystemInterface::sendWindowSystemEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 651	C++
       	Qt5Guid.dll!QWindowSystemInterface::flushWindowSystemEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 625	C++
       	qwindowsd.dll!QWindowsWindow::handleWmPaint(HWND__ * hwnd, unsigned int message, unsigned __int64 __formal, __int64 __formal) Line 1587	C++
       	qwindowsd.dll!QWindowsContext::windowsProc(HWND__ * hwnd, unsigned int message, QtWindows::WindowsEventType et, unsigned __int64 wParam, __int64 lParam, __int64 * result) Line 1095	C++
       	qwindowsd.dll!qWindowsWndProc(HWND__ * hwnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 1340	C++
       	[External Code]	
       	qwindowsd.dll!QWindowsTheme::fileIconPixmap(const QFileInfo & fileInfo, const QSizeF & size, QFlags<enum QPlatformTheme::IconOption> iconOptions) Line 733	C++
       	Qt5Widgetsd.dll!QFileIconEngine::pixmap(const QSize & size, QIcon::Mode mode, QIcon::State state) Line 96	C++
       	Qt5Guid.dll!QPixmapIconEngine::paint(QPainter * painter, const QRect & rect, QIcon::Mode mode, QIcon::State state) Line 175	C++
       	Qt5Guid.dll!QIcon::paint(QPainter * painter, const QRect & rect, QFlags<enum Qt::AlignmentFlag> alignment, QIcon::Mode mode, QIcon::State state) Line 902	C++
       	Qt5Widgetsd.dll!QCommonStyle::drawControl(QStyle::ControlElement element, const QStyleOption * opt, QPainter * p, const QWidget * widget) Line 2182	C++
       	Qt5Widgetsd.dll!QWindowsStyle::drawControl(QStyle::ControlElement ce, const QStyleOption * opt, QPainter * p, const QWidget * widget) Line 1856	C++
       	Qt5Widgetsd.dll!QWindowsXPStyle::drawControl(QStyle::ControlElement element, const QStyleOption * option, QPainter * p, const QWidget * widget) Line 2529	C++
       	Qt5Widgetsd.dll!QWindowsVistaStyle::drawControl(QStyle::ControlElement element, const QStyleOption * option, QPainter * painter, const QWidget * widget) Line 1463	C++
       	Qt5Widgetsd.dll!QStyledItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) Line 414	C++
       	Qt5Widgetsd.dll!QTreeView::drawRow(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) Line 1769	C++
       	Qt5Widgetsd.dll!QTreeView::drawTree(QPainter * painter, const QRegion & region) Line 1504	C++
       	Qt5Widgetsd.dll!QTreeView::paintEvent(QPaintEvent * event) Line 1329	C++
       	Qt5Widgetsd.dll!QWidget::event(QEvent * event) Line 8896	C++
       	Qt5Widgetsd.dll!QFrame::event(QEvent * e) Line 544	C++
       	Qt5Widgetsd.dll!QAbstractScrollArea::viewportEvent(QEvent * e) Line 1206	C++
       	Qt5Widgetsd.dll!QAbstractItemView::viewportEvent(QEvent * event) Line 1686	C++
       	Qt5Widgetsd.dll!QTreeView::viewportEvent(QEvent * event) Line 1310	C++
       	Qt5Widgetsd.dll!QAbstractScrollAreaPrivate::viewportEvent(QEvent * event) Line 105	C++
       	Qt5Widgetsd.dll!QAbstractScrollAreaFilter::eventFilter(QObject * o, QEvent * e) Line 121	C++
       	Qt5Cored.dll!QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject * receiver, QEvent * event) Line 1126	C++
       	Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3710	C++
       	Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3677	C++
       	Qt5Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1015	C++
       	Qt5Cored.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) Line 230	C++
       	Qt5Widgetsd.dll!QWidgetPrivate::sendPaintEvent(const QRegion & toBePainted) Line 5670	C++
       	Qt5Widgetsd.dll!QWidgetPrivate::drawWidget(QPaintDevice * pdev, const QRegion & rgn, const QPoint & offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 5611	C++
       	Qt5Widgetsd.dll!QWidgetPrivate::paintSiblingsRecursive(QPaintDevice * pdev, const QList<QObject *> & siblings, int index, const QRegion & rgn, const QPoint & offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 5803	C++
       	Qt5Widgetsd.dll!QWidgetPrivate::paintSiblingsRecursive(QPaintDevice * pdev, const QList<QObject *> & siblings, int index, const QRegion & rgn, const QPoint & offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 5790	C++
       	Qt5Widgetsd.dll!QWidgetPrivate::paintSiblingsRecursive(QPaintDevice * pdev, const QList<QObject *> & siblings, int index, const QRegion & rgn, const QPoint & offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 5790	C++
       	Qt5Widgetsd.dll!QWidgetPrivate::drawWidget(QPaintDevice * pdev, const QRegion & rgn, const QPoint & offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 5661	C++
       	Qt5Widgetsd.dll!QWidgetPrivate::paintSiblingsRecursive(QPaintDevice * pdev, const QList<QObject *> & siblings, int index, const QRegion & rgn, const QPoint & offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 5803	C++
       	Qt5Widgetsd.dll!QWidgetPrivate::drawWidget(QPaintDevice * pdev, const QRegion & rgn, const QPoint & offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 5661	C++
       	Qt5Widgetsd.dll!QWidgetBackingStore::doSync() Line 1357	C++
       	Qt5Widgetsd.dll!QWidgetBackingStore::sync(QWidget * exposedWidget, const QRegion & exposedRegion) Line 1119	C++
       	Qt5Widgetsd.dll!QWidgetPrivate::syncBackingStore(const QRegion & region) Line 1947	C++
       	Qt5Widgetsd.dll!QWidgetWindow::handleExposeEvent(QExposeEvent * event) Line 824	C++
       	Qt5Widgetsd.dll!QWidgetWindow::event(QEvent * event) Line 256	C++
       	Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3714	C++
       	Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3157	C++
       	Qt5Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1015	C++
       	Qt5Cored.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) Line 230	C++
       	Qt5Guid.dll!QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent * e) Line 2733	C++
       	Qt5Guid.dll!QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent * e) Line 1715	C++
       	Qt5Guid.dll!QWindowSystemInterface::sendWindowSystemEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 651	C++
       	Qt5Guid.dll!QWindowSystemInterface::flushWindowSystemEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 625	C++
       	qwindowsd.dll!QWindowsWindow::handleWmPaint(HWND__ * hwnd, unsigned int message, unsigned __int64 __formal, __int64 __formal) Line 1587	C++
       	qwindowsd.dll!QWindowsContext::windowsProc(HWND__ * hwnd, unsigned int message, QtWindows::WindowsEventType et, unsigned __int64 wParam, __int64 lParam, __int64 * result) Line 1095	C++
       	qwindowsd.dll!qWindowsWndProc(HWND__ * hwnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 1340	C++
       	[External Code]	
       	Qt5Cored.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 829	C++
       	qwindowsd.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 68	C++
       	Qt5Cored.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 129	C++
       	Qt5Cored.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 204	C++
       	Qt5Cored.dll!QCoreApplication::exec() Line 1285	C++
       	Qt5Guid.dll!QGuiApplication::exec() Line 1599	C++
       	Qt5Widgetsd.dll!QApplication::exec() Line 2974	C++
       	hellogl.exe!main(int argc, char * * argv) Line 58	C++
       	hellogl.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Line 113	C++
       	[External Code]	
      

      Attachments

        Issue Links

          Activity

            People

              kleint Friedemann Kleint
              harry Harald
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: