Change-Id: Ib4f1c377bf93b1041b5f5e3fc56c0e01e35aeb38
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
#include <QtCore/QDebug>
#include <QtGui/QOpenGLContext>
+#include <QtGui/QScreen>
QT_BEGIN_NAMESPACE
// Check if all channels are don't care
if (alphaSize == -1 && redSize == -1 && greenSize == -1 && blueSize == -1) {
// Set colour channels based on depth of window's screen
- QQnxScreen *screen = static_cast<QQnxScreen*>(QQnxScreen::screens().first());
+ QQnxScreen *screen = static_cast<QQnxScreen*>(glContext->screen()->handle());
int depth = screen->depth();
if (depth == 32) {
// SCREEN_FORMAT_RGBA8888
qFatal("QQnxWindow: failed to set window swap interval, errno=%d", errno);
}
- // Assign the window to the primary display (this is the default specified by screen).
- setScreen(QQnxScreen::primaryDisplay());
+ setScreen(static_cast<QQnxScreen *>(window->screen()->handle()));
// Add the window to the root of the hierarchy
QQnxScreen::addWindow(this);