Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqnxintegration.cpp
Go to the documentation of this file.
1// Copyright (C) 2013 BlackBerry Limited. All rights reserved.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
5
6#include "qqnxglobal.h"
7
12#include "qqnxscreen.h"
14#include "qqnxwindow.h"
18#include "qqnxservices.h"
19
22#if !defined(QT_NO_OPENGL)
23#include "qqnxeglwindow.h"
24#endif
25
26#if QT_CONFIG(qqnx_pps)
27#include "qqnxnavigatorpps.h"
28#include "qqnxnavigatoreventnotifier.h"
29#include "qqnxvirtualkeyboardpps.h"
30#endif
31
32#if QT_CONFIG(qqnx_pps)
33# include "qqnxbuttoneventnotifier.h"
34# include "qqnxclipboard.h"
35#endif
36
37#if QT_CONFIG(qqnx_imf)
38# include "qqnxinputcontext_imf.h"
39#else
41#endif
42
43#include <qpa/qplatforminputcontextfactory_p.h>
44#include <qpa/qplatforminputcontext.h>
45
46#include "private/qgenericunixfontdatabase_p.h"
47#include "private/qgenericunixeventdispatcher_p.h"
48
49#include <qpa/qplatformwindow.h>
50#include <qpa/qwindowsysteminterface.h>
51
52#include <QtGui/private/qguiapplication_p.h>
53#include <QtGui/private/qrhibackingstore_p.h>
54
55#if !defined(QT_NO_OPENGL)
56#include "qqnxglcontext.h"
57#include <QtGui/QOpenGLContext>
58#endif
59
60#include <private/qsimpledrag_p.h>
61
62#include <QtCore/QDebug>
63#include <QtCore/QJsonDocument>
64#include <QtCore/QJsonObject>
65#include <QtCore/QJsonArray>
66#include <QtCore/QFile>
67#include <errno.h>
68
69QT_BEGIN_NAMESPACE
70
71// Q_LOGGING_CATEGORY(lcQpaQnx, "qt.qpa.qnx");
72
73using namespace Qt::StringLiterals;
74
76
77static inline QQnxIntegration::Options parseOptions(const QStringList &paramList)
78{
79 QQnxIntegration::Options options = QQnxIntegration::NoOptions;
80 if (!paramList.contains("no-fullscreen"_L1)) {
82 }
83
84 if (paramList.contains("flush-screen-context"_L1)) {
86 }
87
88 if (paramList.contains("rootwindow"_L1)) {
90 }
91
92 if (!paramList.contains("disable-EGL_KHR_surfaceless_context"_L1)) {
94 }
95
96 if (paramList.contains("desktop"_L1)) {
97 options |= QQnxIntegration::Desktop;
98 }
99
100 return options;
101}
102
103static inline int getContextCapabilities(const QStringList &paramList)
104{
105 constexpr auto contextCapabilitiesPrefix = "screen-context-capabilities="_L1;
106 int contextCapabilities = SCREEN_APPLICATION_CONTEXT;
107 for (const QString &param : paramList) {
108 if (param.startsWith(contextCapabilitiesPrefix)) {
109 auto value = QStringView{param}.mid(contextCapabilitiesPrefix.length());
110 bool ok = false;
111 contextCapabilities = value.toInt(&ok, 0);
112 if (!ok)
113 contextCapabilities = SCREEN_APPLICATION_CONTEXT;
114 }
115 }
116 return contextCapabilities;
117}
118
119QQnxIntegration::QQnxIntegration(const QStringList &paramList)
120 : QPlatformIntegration()
121 , m_screenContextId(256, 0)
122 , m_screenEventThread(0)
123 , m_navigatorEventHandler(new QQnxNavigatorEventHandler())
124 , m_virtualKeyboard(0)
125 , m_inputContext(0)
126#if QT_CONFIG(qqnx_pps)
127 , m_navigatorEventNotifier(0)
128 , m_buttonsNotifier(new QQnxButtonEventNotifier())
129#endif
130 , m_qpaInputContext(0)
131 , m_fontDatabase(new QGenericUnixFontDatabase())
132 , m_eventDispatcher(createUnixEventDispatcher())
133 , m_nativeInterface(new QQnxNativeInterface(this))
134 , m_screenEventHandler(new QQnxScreenEventHandler(this))
135#if !defined(QT_NO_CLIPBOARD)
136 , m_clipboard(0)
137#endif
138 , m_navigator(0)
139#if QT_CONFIG(draganddrop)
140 , m_drag(new QSimpleDrag())
141#endif
142#if QT_CONFIG(opengl)
143 , m_eglDisplay(EGL_NO_DISPLAY)
144#endif
145{
146 ms_instance = this;
147 m_options = parseOptions(paramList);
148 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
149
150 // Open connection to QNX composition manager
151 if (screen_create_context(&m_screenContext, getContextCapabilities(paramList))) {
152 qFatal("%s - Screen: Failed to create screen context - Error: %s (%i)",
153 Q_FUNC_INFO, strerror(errno), errno);
154 }
155 screen_get_context_property_cv(m_screenContext,
156 SCREEN_PROPERTY_ID,
157 m_screenContextId.size(),
158 m_screenContextId.data());
159 m_screenContextId.resize(strlen(m_screenContextId.constData()));
160
161#if QT_CONFIG(qqnx_pps)
162 // Create/start navigator event notifier
163 m_navigatorEventNotifier = new QQnxNavigatorEventNotifier(m_navigatorEventHandler);
164
165 // delay invocation of start() to the time the event loop is up and running
166 // needed to have the QThread internals of the main thread properly initialized
167 QMetaObject::invokeMethod(m_navigatorEventNotifier, "start", Qt::QueuedConnection);
168#endif
169
170#if QT_CONFIG(opengl)
171 createEglDisplay();
172#endif
173
174 // Create/start event thread
175 m_screenEventThread = new QQnxScreenEventThread(m_screenContext);
176 m_screenEventHandler->setScreenEventThread(m_screenEventThread);
177 m_screenEventThread->start();
178
179 m_qpaInputContext = QPlatformInputContextFactory::create();
180
181#if QT_CONFIG(qqnx_pps)
182 if (!m_qpaInputContext) {
183 // Create/start the keyboard class.
184 m_virtualKeyboard = new QQnxVirtualKeyboardPps();
185
186 // delay invocation of start() to the time the event loop is up and running
187 // needed to have the QThread internals of the main thread properly initialized
188 QMetaObject::invokeMethod(m_virtualKeyboard, "start", Qt::QueuedConnection);
189 }
190#endif
191
192#if QT_CONFIG(qqnx_pps)
193 m_navigator = new QQnxNavigatorPps();
194#endif
195
196 createDisplays();
197
198 if (m_virtualKeyboard) {
199 // TODO check if we need to do this for all screens or only the primary one
200 QObject::connect(m_virtualKeyboard, SIGNAL(heightChanged(int)),
201 primaryDisplay(), SLOT(keyboardHeightChanged(int)));
202
203#if QT_CONFIG(qqnx_pps)
204 // Set up the input context
205 m_inputContext = new QQnxInputContext(this, *m_virtualKeyboard);
206#if QT_CONFIG(qqnx_imf)
207 m_screenEventHandler->addScreenEventFilter(m_inputContext);
208#endif
209#endif
210 }
211
212#if QT_CONFIG(qqnx_pps)
213 // delay invocation of start() to the time the event loop is up and running
214 // needed to have the QThread internals of the main thread properly initialized
215 QMetaObject::invokeMethod(m_buttonsNotifier, "start", Qt::QueuedConnection);
216#endif
217}
218
220{
221 qCDebug(lcQpaQnx) << "Platform plugin shutdown begin";
222 delete m_nativeInterface;
223
224#if QT_CONFIG(draganddrop)
225 // Destroy the drag object
226 delete m_drag;
227#endif
228
229#if !defined(QT_NO_CLIPBOARD)
230 // Delete the clipboard
231 delete m_clipboard;
232#endif
233
234 // Stop/destroy navigator event notifier
235#if QT_CONFIG(qqnx_pps)
236 delete m_navigatorEventNotifier;
237#endif
238 delete m_navigatorEventHandler;
239
240 // Stop/destroy screen event thread
241 delete m_screenEventThread;
242
243 // In case the event-dispatcher was never transferred to QCoreApplication
244 delete m_eventDispatcher;
245
246 delete m_screenEventHandler;
247
248 // Destroy all displays
249 destroyDisplays();
250
251 // Close connection to QNX composition manager
252 screen_destroy_context(m_screenContext);
253
254#if QT_CONFIG(opengl)
255 destroyEglDisplay();
256#endif
257
258#if QT_CONFIG(qqnx_pps)
259 // Destroy the hardware button notifier
260 delete m_buttonsNotifier;
261
262 // Destroy input context
263 delete m_inputContext;
264#endif
265 delete m_qpaInputContext;
266
267 // Destroy the keyboard class.
268 delete m_virtualKeyboard;
269
270 // Destroy services class
271 delete m_services;
272
273 // Destroy navigator interface
274 delete m_navigator;
275
276 ms_instance = nullptr;
277
278 qCDebug(lcQpaQnx) << "Platform plugin shutdown end";
279}
280
281bool QQnxIntegration::hasCapability(QPlatformIntegration::Capability cap) const
282{
283 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
284 switch (cap) {
285 case MultipleWindows:
286 case ForeignWindows:
287 case ThreadedPixmaps:
288 return true;
289#if !defined(QT_NO_OPENGL)
290 case OpenGL:
291 case ThreadedOpenGL:
292 case BufferQueueingOpenGL:
293 return true;
294#endif
295 default:
296 return QPlatformIntegration::hasCapability(cap);
297 }
298}
299
300QPlatformWindow *QQnxIntegration::createForeignWindow(QWindow *window, WId nativeHandle) const
301{
302 screen_window_t screenWindow = reinterpret_cast<screen_window_t>(nativeHandle);
303 if (this->window(screenWindow)) {
304 qWarning() << "QWindow already created for foreign window"
305 << screenWindow;
306 return nullptr;
307 }
308
309 return new QQnxForeignWindow(window, m_screenContext, screenWindow);
310}
311
313{
314 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
315 QSurface::SurfaceType surfaceType = window->surfaceType();
316 const bool needRootWindow = options() & RootWindow;
317 switch (surfaceType) {
318 case QSurface::RasterSurface:
319 return new QQnxRasterWindow(window, m_screenContext, needRootWindow);
320#if !defined(QT_NO_OPENGL)
321 case QSurface::OpenGLSurface:
322 return new QQnxEglWindow(window, m_screenContext, needRootWindow);
323#endif
324 default:
325 qFatal("QQnxWindow: unsupported window API");
326 }
327 return 0;
328}
329
331{
332 QSurface::SurfaceType surfaceType = window->surfaceType();
333 qCDebug(lcQpaQnx) << Q_FUNC_INFO << surfaceType;
334 switch (surfaceType) {
335 case QSurface::RasterSurface:
336 return new QQnxRasterBackingStore(window);
337#if !defined(QT_NO_OPENGL)
338 // Return a QRhiBackingStore for non-raster surface windows
339 case QSurface::OpenGLSurface:
340 return new QRhiBackingStore(window);
341#endif
342 default:
343 return nullptr;
344 }
345}
346
347#if !defined(QT_NO_OPENGL)
348QPlatformOpenGLContext *QQnxIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
349{
350 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
351
352 // Get color channel sizes from window format
353 QSurfaceFormat format = context->format();
354 int alphaSize = format.alphaBufferSize();
355 int redSize = format.redBufferSize();
356 int greenSize = format.greenBufferSize();
357 int blueSize = format.blueBufferSize();
358
359 // Check if all channels are don't care
360 if (alphaSize == -1 && redSize == -1 && greenSize == -1 && blueSize == -1) {
361 // Set color channels based on depth of window's screen
362 QQnxScreen *screen = static_cast<QQnxScreen*>(context->screen()->handle());
363 int depth = screen->depth();
364 if (depth == 32) {
365 // SCREEN_FORMAT_RGBA8888
366 alphaSize = 8;
367 redSize = 8;
368 greenSize = 8;
369 blueSize = 8;
370 } else {
371 // SCREEN_FORMAT_RGB565
372 alphaSize = 0;
373 redSize = 5;
374 greenSize = 6;
375 blueSize = 5;
376 }
377 } else {
378 // Choose best match based on supported pixel formats
379 if (alphaSize <= 0 && redSize <= 5 && greenSize <= 6 && blueSize <= 5) {
380 // SCREEN_FORMAT_RGB565
381 alphaSize = 0;
382 redSize = 5;
383 greenSize = 6;
384 blueSize = 5;
385 } else {
386 // SCREEN_FORMAT_RGBA8888
387 alphaSize = 8;
388 redSize = 8;
389 greenSize = 8;
390 blueSize = 8;
391 }
392 }
393
394 // Update color channel sizes in window format
395 format.setAlphaBufferSize(alphaSize);
396 format.setRedBufferSize(redSize);
397 format.setGreenBufferSize(greenSize);
398 format.setBlueBufferSize(blueSize);
399 context->setFormat(format);
400
401 QQnxGLContext *ctx = new QQnxGLContext(context->format(), context->shareHandle());
402 return ctx;
403}
404#endif
405
407{
408 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
409 if (m_qpaInputContext)
410 return m_qpaInputContext;
411 return m_inputContext;
412}
413
414void QQnxIntegration::moveToScreen(QWindow *window, int screen)
415{
416 qCDebug(lcQpaQnx) << Q_FUNC_INFO << "w =" << window << ", s =" << screen;
417
418 // get platform window used by widget
419 QQnxWindow *platformWindow = static_cast<QQnxWindow *>(window->handle());
420
421 // lookup platform screen by index
422 QQnxScreen *platformScreen = m_screens.at(screen);
423
424 // move the platform window to the platform screen
425 platformWindow->setScreen(platformScreen);
426}
427
429{
430 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
431
432 // We transfer ownersip of the event-dispatcher to QtCoreApplication
433 QAbstractEventDispatcher *eventDispatcher = m_eventDispatcher;
434 m_eventDispatcher = 0;
435
436 return eventDispatcher;
437}
438
440{
441 return m_nativeInterface;
442}
443
444#if !defined(QT_NO_CLIPBOARD)
446{
447 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
448
449#if QT_CONFIG(qqnx_pps)
450 if (!m_clipboard)
451 m_clipboard = new QQnxClipboard;
452#endif
453 return m_clipboard;
454}
455#endif
456
457#if QT_CONFIG(draganddrop)
458QPlatformDrag *QQnxIntegration::drag() const
459{
460 return m_drag;
461}
462#endif
463
464QVariant QQnxIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
465{
466 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
467 if ((hint == ShowIsFullScreen) && (m_options & FullScreenApplication))
468 return true;
469
470 return QPlatformIntegration::styleHint(hint);
471}
472
474{
475 // Create services handling class
476 if (m_navigator && !m_services)
477 m_services = new QQnxServices(m_navigator);
478
479 return m_services;
480}
481
482QWindow *QQnxIntegration::window(screen_window_t qnxWindow) const
483{
484 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
485 QMutexLocker locker(&m_windowMapperMutex);
486 Q_UNUSED(locker);
487 return m_windowMapper.value(qnxWindow, 0);
488}
489
490void QQnxIntegration::addWindow(screen_window_t qnxWindow, QWindow *window)
491{
492 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
493 QMutexLocker locker(&m_windowMapperMutex);
494 Q_UNUSED(locker);
495 m_windowMapper.insert(qnxWindow, window);
496}
497
498void QQnxIntegration::removeWindow(screen_window_t qnxWindow)
499{
500 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
501 QMutexLocker locker(&m_windowMapperMutex);
502 Q_UNUSED(locker);
503 m_windowMapper.remove(qnxWindow);
504}
505
506/*!
507 Get display ID for given \a display
508
509 Returns -1 for failure, otherwise returns display ID
510 */
511static int getIdOfDisplay(screen_display_t display)
512{
513 int displayId;
514 if (screen_get_display_property_iv(display,
515 SCREEN_PROPERTY_ID,
516 &displayId) == 0) {
517 return displayId;
518 }
519 return -1;
520}
521
522/*!
523 Read JSON configuration file for the QNX display order
524
525 Returns true if file was read successfully and fills \a requestedDisplays
526 */
527static bool getRequestedDisplays(QJsonArray &requestedDisplays)
528{
529 // Check if display configuration file is provided
530 QByteArray json = qgetenv("QT_QPA_QNX_DISPLAY_CONFIG");
531 if (json.isEmpty())
532 return false;
533
534 // Check if configuration file exists
535 QFile file(QString::fromUtf8(json));
536 if (!file.open(QFile::ReadOnly)) {
537 qWarning() << "Could not open config file" << json << "for reading";
538 return false;
539 }
540
541 // Read config file and check it's json
542 const QJsonDocument doc = QJsonDocument::fromJson(file.readAll());
543 if (!doc.isObject()) {
544 qWarning() << "Invalid config file" << json
545 << "- no top-level JSON object";
546 return false;
547 }
548
549 // Read the requested display order
550 const QJsonObject object = doc.object();
551 requestedDisplays = object.value("displayOrder"_L1).toArray();
552
553 return true;
554}
555
556/*!
557 Match \a availableDisplays with display order defined in a json file
558 pointed to by QT_QPA_QNX_DISPLAY_CONFIG. Display order must use same
559 identifiers as defined for displays in graphics.conf. Number of
560 available displays must be specified in \a displayCount
561
562 An example configuration is below:
563 \badcode
564 {
565 "displayOrder": [ 3, 1 ]
566 }
567 \endcode
568
569 Returns ordered list of displays. If no order was specified, returns
570 displays in the same order as in the original list.
571*/
572QList<screen_display_t *> QQnxIntegration::sortDisplays(screen_display_t *availableDisplays, int displayCount)
573{
574 // Intermediate list for sorting
575 QList<screen_display_t *> allDisplays;
576 for (int i = 0; i < displayCount; i++)
577 allDisplays.append(&availableDisplays[i]);
578
579 // Read requested display order if available
580 QJsonArray requestedDisplays;
581 if (!getRequestedDisplays(requestedDisplays))
582 return allDisplays;
583
584 // Go through all the requested displays IDs
585 QList<screen_display_t *> orderedDisplays;
586 for (const QJsonValue &value : std::as_const(requestedDisplays)) {
587 int requestedValue = value.toInt();
588
589 // Move all displays with matching ID from the intermediate list
590 // to the beginning of the ordered list
591 for (auto it = allDisplays.begin(), end = allDisplays.end(); it != end; ++it) {
592 screen_display_t *display = *it;
593 if (getIdOfDisplay(*display) == requestedValue) {
594 orderedDisplays.append(display);
595 allDisplays.erase(it);
596 break;
597 }
598 }
599 }
600
601 // Place all unordered displays to the end of list
602 orderedDisplays.append(allDisplays);
603
604 return orderedDisplays;
605}
606
607void QQnxIntegration::createDisplays()
608{
609 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
610 // Query number of displays
611 int displayCount = 0;
612 int result = screen_get_context_property_iv(m_screenContext, SCREEN_PROPERTY_DISPLAY_COUNT,
613 &displayCount);
614 Q_SCREEN_CRITICALERROR(result, "Failed to query display count");
615
616 if (Q_UNLIKELY(displayCount < 1)) {
617 // Never happens, even if there's no display, libscreen returns 1
618 qFatal("QQnxIntegration: displayCount=%d", displayCount);
619 }
620
621 // Get all displays
622 screen_display_t *displays = (screen_display_t *)alloca(sizeof(screen_display_t) * displayCount);
623 result = screen_get_context_property_pv(m_screenContext, SCREEN_PROPERTY_DISPLAYS,
624 (void **)displays);
625 QList<screen_display_t *> orderedDisplays = sortDisplays(displays, displayCount);
626 Q_SCREEN_CRITICALERROR(result, "Failed to query displays");
627
628 // If it's primary, we create a QScreen for it even if it's not attached
629 // since Qt will dereference QGuiApplication::primaryScreen()
630 createDisplay(*orderedDisplays[0], /*isPrimary=*/true);
631
632 for (int i=1; i<displayCount; i++) {
633 int isAttached = 1;
634 result = screen_get_display_property_iv(*orderedDisplays[i], SCREEN_PROPERTY_ATTACHED,
635 &isAttached);
636 Q_SCREEN_CHECKERROR(result, "Failed to query display attachment");
637
638 if (!isAttached) {
639 qCDebug(lcQpaQnx) << "Skipping non-attached display " << i;
640 continue;
641 }
642
643 qCDebug(lcQpaQnx) << "Creating screen for display " << i;
644
645 createDisplay(*orderedDisplays[i], /*isPrimary=*/false);
646 } // of displays iteration
647}
648
649void QQnxIntegration::createDisplay(screen_display_t display, bool isPrimary)
650{
651 QQnxScreen *screen = new QQnxScreen(m_screenContext, display, isPrimary);
652 m_screens.append(screen);
653 QWindowSystemInterface::handleScreenAdded(screen);
655
656 QObject::connect(m_screenEventHandler, SIGNAL(newWindowCreated(void*)),
657 screen, SLOT(newWindowCreated(void*)));
658 QObject::connect(m_screenEventHandler, SIGNAL(windowClosed(void*)),
659 screen, SLOT(windowClosed(void*)));
660
661 QObject::connect(m_navigatorEventHandler, SIGNAL(rotationChanged(int)), screen, SLOT(setRotation(int)));
662 QObject::connect(m_navigatorEventHandler, SIGNAL(windowGroupActivated(QByteArray)), screen, SLOT(activateWindowGroup(QByteArray)));
663 QObject::connect(m_navigatorEventHandler, SIGNAL(windowGroupDeactivated(QByteArray)), screen, SLOT(deactivateWindowGroup(QByteArray)));
664 QObject::connect(m_navigatorEventHandler, SIGNAL(windowGroupStateChanged(QByteArray,Qt::WindowState)),
665 screen, SLOT(windowGroupStateChanged(QByteArray,Qt::WindowState)));
666}
667
669{
670 Q_CHECK_PTR(screen);
671 Q_ASSERT(m_screens.contains(screen));
672 m_screens.removeAll(screen);
673 QWindowSystemInterface::handleScreenRemoved(screen);
674}
675
676void QQnxIntegration::destroyDisplays()
677{
678 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
679
680 Q_FOREACH (QQnxScreen *screen, m_screens) {
681 QWindowSystemInterface::handleScreenRemoved(screen);
682 }
683 m_screens.clear();
684}
685
686QQnxScreen *QQnxIntegration::screenForNative(screen_display_t qnxScreen) const
687{
688 Q_FOREACH (QQnxScreen *screen, m_screens) {
689 if (screen->nativeDisplay() == qnxScreen)
690 return screen;
691 }
692
693 return 0;
694}
695
697{
698 return m_screens.first();
699}
700
702{
703 return m_options;
704}
705
707{
708 return m_screenContext;
709}
710
712{
713 return m_screenContextId;
714}
715
717{
718 return m_navigatorEventHandler;
719}
720
722{
723 // If QQNX_PPS is defined then we have navigator
724 return m_navigator != 0;
725}
726
727#if QT_CONFIG(opengl)
728void QQnxIntegration::createEglDisplay()
729{
730 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
731
732 // Initialize connection to EGL
733 m_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
734 if (Q_UNLIKELY(m_eglDisplay == EGL_NO_DISPLAY))
735 qFatal("QQnxiIntegration: failed to obtain EGL display: %x", eglGetError());
736
737 EGLBoolean eglResult = eglInitialize(m_eglDisplay, 0, 0);
738 if (Q_UNLIKELY(eglResult != EGL_TRUE))
739 qFatal("QQnxIntegration: failed to initialize EGL display, err=%d", eglGetError());
740}
741
742void QQnxIntegration::destroyEglDisplay()
743{
744 qCDebug(lcQpaQnx) << Q_FUNC_INFO;
745
746 // Close connection to EGL
747 eglTerminate(m_eglDisplay);
748}
749#endif
750
751QT_END_NAMESPACE
QAbstractEventDispatcher * createEventDispatcher() const override
Factory function for the GUI event dispatcher.
bool hasCapability(QPlatformIntegration::Capability cap) const override
QPlatformNativeInterface * nativeInterface() const override
QQnxNavigatorEventHandler * navigatorEventHandler()
QPlatformBackingStore * createPlatformBackingStore(QWindow *window) const override
Factory function for QPlatformBackingStore.
QPlatformWindow * createPlatformWindow(QWindow *window) const override
Factory function for QPlatformWindow.
QPlatformWindow * createForeignWindow(QWindow *window, WId nativeHandle) const override
Options options() const
QQnxScreen * primaryDisplay() const
void removeDisplay(QQnxScreen *screen)
QVariant styleHint(StyleHint hint) const override
QPlatformServices * services() const override
void moveToScreen(QWindow *window, int screen)
QPlatformInputContext * inputContext() const override
Returns the platforms input context.
QByteArray screenContextId()
QQnxScreen * screenForNative(screen_display_t qnxScreen) const
void createDisplay(screen_display_t display, bool isPrimary)
screen_context_t screenContext()
QWindow * window(screen_window_t qnxWindow) const
QPlatformClipboard * clipboard() const override
Accessor for the platform integration's clipboard.
bool supportsNavigatorEvents() const
QQnxNativeInterface(QQnxIntegration *integration)
void setScreenEventThread(QQnxScreenEventThread *eventThread)
int depth() const override
Reimplement in subclass to return current depth of the screen.
void adjustOrientation()
QQnxServices(QQnxAbstractNavigator *navigator)
The QQnxWindow is the base class of the various classes used as instances of QPlatformWindow in the Q...
Definition qqnxwindow.h:31
void setScreen(QQnxScreen *platformScreen)
#define Q_SCREEN_CRITICALERROR(x, message)
Definition qqnxglobal.h:16
#define Q_SCREEN_CHECKERROR(x, message)
Definition qqnxglobal.h:13
static bool getRequestedDisplays(QJsonArray &requestedDisplays)
Read JSON configuration file for the QNX display order.
static int getIdOfDisplay(screen_display_t display)
Get display ID for given display.
static int getContextCapabilities(const QStringList &paramList)
static QQnxIntegration::Options parseOptions(const QStringList &paramList)