QML Label Crashes Application with OpenGL Kernel Profile
Starting with a new QtQuick2 project using Ubuntu 12.04 and Mac OSX. I've tried this on Qt 5.3.1 and 5.3.2.
I am using this code to create a QQuickView set for OpenGL 4.1 main profile
QApplication app(argc, argv);
QQuickView * m_pMainView = new QQuickView;
QSurfaceFormat f;
f.setProfile(QSurfaceFormat::CoreProfile);
f.setVersion(4, 1);
m_pMainView->setFormat(f);
m_pMainView->setSource(QUrl("qrc:///main.qml"));
m_pMainView->show();
return app.exec();
My QML is simple.
import QtQuick 2.3
import QtQuick.Controls 1.2
Rectangle {
visible: true
height: 800
width: 600
Label {
text: "Test"
}
}
Doing so causes the application to crash immediately. Switch Label control in QML to Text control, no glitch. Works as expected. Switch QSurfaceFormat to the appropriate compatibility profile (3.3 on Ubuntu / 2.1 on Mac), without crashing. Works as expected.
Am I doing something terribly wrong with the way I change the OpenGL version, or is Qt 5.3 just unacceptably unstable in the main profile?
In case it's helpful, here's the stack trace from the Mac:
Thread 6 Crashed:: QSGRenderThread
0 QtGui 0x0000000101cd41a7 QOpenGLContextPrivate::maxTextureSize() + 343
1 QtGui 0x0000000101f33907 QOpenGLTextureGlyphCache::maxTextureHeight() const + 39
2 QtGui 0x0000000101ec4137 QTextureGlyphCache::populate(QFontEngine*, int, unsigned int const*, QFixedPoint const*) + 1687
3 QtQuick 0x0000000100d488f0 QSGTextMaskMaterial::populate(QPointF const&, QVector<unsigned int> const&, QVector<QPointF> const&, QSGGeometry*, QRectF*, QPointF*, QMargins const&) + 432
4 QtQuick 0x0000000100d473fd QSGDefaultGlyphNode::update() + 797
5 QtQuick 0x0000000100dc7632 QQuickTextNode::addGlyphs(QPointF const&, QGlyphRun const&, QColor const&, QQuickText::TextStyle, QColor const&, QSGNode*) + 482
6 QtQuick 0x0000000100dcbc61 QQuickTextNodeEngine::addToSceneGraph(QQuickTextNode*, QQuickText::TextStyle, QColor const&) + 2049
7 QtQuick 0x0000000100dc7fbd QQuickTextNode::addTextLayout(QPointF const&, QTextLayout*, QColor const&, QQuickText::TextStyle, QColor const&, QColor const&, QColor const&, QColor const&, int, int, int, int) + 557
8 QtQuick 0x0000000100dc5368 QQuickText::updatePaintNode(QSGNode*, QQuickItem::UpdatePaintNodeData*) + 1000
9 QtQuick 0x0000000100d88995 QQuickWindowPrivate::updateDirtyNode(QQuickItem*) + 3317
10 QtQuick 0x0000000100d7fdb2 QQuickWindowPrivate::syncSceneGraph() + 306
11 QtQuick 0x0000000100d5d388 QSGRenderThread::sync() + 120
12 QtQuick 0x0000000100d5d475 QSGRenderThread::syncAndRender() + 117
13 QtQuick 0x0000000100d5d968 QSGRenderThread::run() + 200
14 QtCore 0x00000001016923f2 QThreadPrivate::start(void*) + 338
15 libsystem_pthread.dylib 0x00007fff94d23899 _pthread_body + 138
16 libsystem_pthread.dylib 0x00007fff94d2372a _pthread_start + 137
17 libsystem_pthread.dylib 0x00007fff94d27fc9 thread_start + 13
+3
source to share