Qt 6.x
The Qt SDK
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#include "qqnxglobal.h"
5
6#include "qqnxintegration.h"
10#include "qqnxscreen.h"
12#include "qqnxwindow.h"
16#include "qqnxservices.h"
17
18#include "qqnxforeignwindow.h"
19#include "qqnxrasterwindow.h"
20#if !defined(QT_NO_OPENGL)
21#include "qqnxeglwindow.h"
22#endif
23
24#if QT_CONFIG(qqnx_pps)
25#include "qqnxnavigatorpps.h"
28#endif
29
30#if QT_CONFIG(qqnx_pps)
32# include "qqnxclipboard.h"
33# if QT_CONFIG(qqnx_imf)
34# include "qqnxinputcontext_imf.h"
35# else
37# endif
38#endif
39
40#include <qpa/qplatforminputcontextfactory_p.h>
41#include <qpa/qplatforminputcontext.h>
42
43#include "private/qgenericunixfontdatabase_p.h"
44#include "private/qgenericunixeventdispatcher_p.h"
45
46#include <qpa/qplatformwindow.h>
47#include <qpa/qwindowsysteminterface.h>
48
49#include <QtGui/private/qguiapplication_p.h>
50
51#if !defined(QT_NO_OPENGL)
52#include "qqnxglcontext.h"
53#include <QtGui/QOpenGLContext>
54#endif
55
56#include <private/qsimpledrag_p.h>
57
58#include <QtCore/QDebug>
59#include <QtCore/QJsonDocument>
60#include <QtCore/QJsonObject>
61#include <QtCore/QJsonArray>
62#include <QtCore/QFile>
63#include <errno.h>
64
65#if defined(QQNXINTEGRATION_DEBUG)
66#define qIntegrationDebug qDebug
67#else
68#define qIntegrationDebug QT_NO_QDEBUG_MACRO
69#endif
70
72
73using namespace Qt::StringLiterals;
74
75QQnxIntegration *QQnxIntegration::ms_instance;
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 return options;
97}
98
99static inline int getContextCapabilities(const QStringList &paramList)
100{
101 QString contextCapabilitiesPrefix = QStringLiteral("screen-context-capabilities=");
102 int contextCapabilities = SCREEN_APPLICATION_CONTEXT;
103 for (const QString &param : paramList) {
104 if (param.startsWith(contextCapabilitiesPrefix)) {
105 auto value = QStringView{param}.mid(contextCapabilitiesPrefix.length());
106 bool ok = false;
107 contextCapabilities = value.toInt(&ok, 0);
108 if (!ok)
109 contextCapabilities = SCREEN_APPLICATION_CONTEXT;
110 }
111 }
112 return contextCapabilities;
113}
114
117 , m_screenContextId(256, 0)
118 , m_screenEventThread(0)
119 , m_navigatorEventHandler(new QQnxNavigatorEventHandler())
120 , m_virtualKeyboard(0)
121#if QT_CONFIG(qqnx_pps)
122 , m_navigatorEventNotifier(0)
123 , m_inputContext(0)
124 , m_buttonsNotifier(new QQnxButtonEventNotifier())
125#endif
126 , m_qpaInputContext(0)
127 , m_services(0)
128 , m_fontDatabase(new QGenericUnixFontDatabase())
129 , m_eventDispatcher(createUnixEventDispatcher())
130 , m_nativeInterface(new QQnxNativeInterface(this))
131 , m_screenEventHandler(new QQnxScreenEventHandler(this))
132#if !defined(QT_NO_CLIPBOARD)
133 , m_clipboard(0)
134#endif
135 , m_navigator(0)
136#if QT_CONFIG(draganddrop)
137 , m_drag(new QSimpleDrag())
138#endif
139#if QT_CONFIG(opengl)
140 , m_eglDisplay(EGL_NO_DISPLAY)
141#endif
142{
143 ms_instance = this;
144 m_options = parseOptions(paramList);
146
147 // Open connection to QNX composition manager
148 if (screen_create_context(&m_screenContext, getContextCapabilities(paramList))) {
149 qFatal("%s - Screen: Failed to create screen context - Error: %s (%i)",
150 Q_FUNC_INFO, strerror(errno), errno);
151 }
152 screen_get_context_property_cv(m_screenContext,
153 SCREEN_PROPERTY_ID,
154 m_screenContextId.size(),
155 m_screenContextId.data());
156 m_screenContextId.resize(strlen(m_screenContextId.constData()));
157
158#if QT_CONFIG(qqnx_pps)
159 // Create/start navigator event notifier
160 m_navigatorEventNotifier = new QQnxNavigatorEventNotifier(m_navigatorEventHandler);
161
162 // delay invocation of start() to the time the event loop is up and running
163 // needed to have the QThread internals of the main thread properly initialized
164 QMetaObject::invokeMethod(m_navigatorEventNotifier, "start", Qt::QueuedConnection);
165#endif
166
167#if QT_CONFIG(opengl)
168 createEglDisplay();
169#endif
170
171 // Create/start event thread
172 m_screenEventThread = new QQnxScreenEventThread(m_screenContext);
173 m_screenEventHandler->setScreenEventThread(m_screenEventThread);
174 m_screenEventThread->start();
175
176 m_qpaInputContext = QPlatformInputContextFactory::create();
177
178#if QT_CONFIG(qqnx_pps)
179 if (!m_qpaInputContext) {
180 // Create/start the keyboard class.
181 m_virtualKeyboard = new QQnxVirtualKeyboardPps();
182
183 // delay invocation of start() to the time the event loop is up and running
184 // needed to have the QThread internals of the main thread properly initialized
185 QMetaObject::invokeMethod(m_virtualKeyboard, "start", Qt::QueuedConnection);
186 }
187#endif
188
189#if QT_CONFIG(qqnx_pps)
190 m_navigator = new QQnxNavigatorPps();
191#endif
192
193 // Create services handling class
194 if (m_navigator)
195 m_services = new QQnxServices(m_navigator);
196
197 createDisplays();
198
199 if (m_virtualKeyboard) {
200 // TODO check if we need to do this for all screens or only the primary one
201 QObject::connect(m_virtualKeyboard, SIGNAL(heightChanged(int)),
202 primaryDisplay(), SLOT(keyboardHeightChanged(int)));
203
204#if QT_CONFIG(qqnx_pps)
205 // Set up the input context
206 m_inputContext = new QQnxInputContext(this, *m_virtualKeyboard);
207#if QT_CONFIG(qqnx_imf)
208 m_screenEventHandler->addScreenEventFilter(m_inputContext);
209#endif
210#endif
211 }
212
213#if QT_CONFIG(qqnx_pps)
214 // delay invocation of start() to the time the event loop is up and running
215 // needed to have the QThread internals of the main thread properly initialized
216 QMetaObject::invokeMethod(m_buttonsNotifier, "start", Qt::QueuedConnection);
217#endif
218}
219
221{
222 qIntegrationDebug("platform plugin shutdown begin");
223 delete m_nativeInterface;
224
225#if QT_CONFIG(draganddrop)
226 // Destroy the drag object
227 delete m_drag;
228#endif
229
230#if !defined(QT_NO_CLIPBOARD)
231 // Delete the clipboard
232 delete m_clipboard;
233#endif
234
235 // Stop/destroy navigator event notifier
236#if QT_CONFIG(qqnx_pps)
237 delete m_navigatorEventNotifier;
238#endif
239 delete m_navigatorEventHandler;
240
241 // Stop/destroy screen event thread
242 delete m_screenEventThread;
243
244 // In case the event-dispatcher was never transferred to QCoreApplication
245 delete m_eventDispatcher;
246
247 delete m_screenEventHandler;
248
249 // Destroy all displays
250 destroyDisplays();
251
252 // Close connection to QNX composition manager
253 screen_destroy_context(m_screenContext);
254
255#if QT_CONFIG(opengl)
256 destroyEglDisplay();
257#endif
258
259#if QT_CONFIG(qqnx_pps)
260 // Destroy the hardware button notifier
261 delete m_buttonsNotifier;
262
263 // Destroy input context
264 delete m_inputContext;
265#endif
266 delete m_qpaInputContext;
267
268 // Destroy the keyboard class.
269 delete m_virtualKeyboard;
270
271 // Destroy services class
272 delete m_services;
273
274 // Destroy navigator interface
275 delete m_navigator;
276
277 ms_instance = nullptr;
278
279 qIntegrationDebug("platform plugin shutdown end");
280}
281
283{
285 switch (cap) {
286 case MultipleWindows:
287 case ForeignWindows:
288 case ThreadedPixmaps:
289 return true;
290#if !defined(QT_NO_OPENGL)
291 case OpenGL:
292 case ThreadedOpenGL:
294 return true;
295#endif
296 default:
298 }
299}
300
302{
303 screen_window_t screenWindow = reinterpret_cast<screen_window_t>(nativeHandle);
304 if (this->window(screenWindow)) {
305 qWarning() << "QWindow already created for foreign window"
306 << screenWindow;
307 return nullptr;
308 }
309
310 return new QQnxForeignWindow(window, m_screenContext, screenWindow);
311}
312
314{
316 QSurface::SurfaceType surfaceType = window->surfaceType();
317 const bool needRootWindow = options() & RootWindow;
318 switch (surfaceType) {
320 return new QQnxRasterWindow(window, m_screenContext, needRootWindow);
321#if !defined(QT_NO_OPENGL)
323 return new QQnxEglWindow(window, m_screenContext, needRootWindow);
324#endif
325 default:
326 qFatal("QQnxWindow: unsupported window API");
327 }
328 return 0;
329}
330
332{
334 return new QQnxRasterBackingStore(window);
335}
336
337#if !defined(QT_NO_OPENGL)
339{
341
342 // Get color channel sizes from window format
343 QSurfaceFormat format = context->format();
344 int alphaSize = format.alphaBufferSize();
345 int redSize = format.redBufferSize();
346 int greenSize = format.greenBufferSize();
347 int blueSize = format.blueBufferSize();
348
349 // Check if all channels are don't care
350 if (alphaSize == -1 && redSize == -1 && greenSize == -1 && blueSize == -1) {
351 // Set color channels based on depth of window's screen
352 QQnxScreen *screen = static_cast<QQnxScreen*>(context->screen()->handle());
353 int depth = screen->depth();
354 if (depth == 32) {
355 // SCREEN_FORMAT_RGBA8888
356 alphaSize = 8;
357 redSize = 8;
358 greenSize = 8;
359 blueSize = 8;
360 } else {
361 // SCREEN_FORMAT_RGB565
362 alphaSize = 0;
363 redSize = 5;
364 greenSize = 6;
365 blueSize = 5;
366 }
367 } else {
368 // Choose best match based on supported pixel formats
369 if (alphaSize <= 0 && redSize <= 5 && greenSize <= 6 && blueSize <= 5) {
370 // SCREEN_FORMAT_RGB565
371 alphaSize = 0;
372 redSize = 5;
373 greenSize = 6;
374 blueSize = 5;
375 } else {
376 // SCREEN_FORMAT_RGBA8888
377 alphaSize = 8;
378 redSize = 8;
379 greenSize = 8;
380 blueSize = 8;
381 }
382 }
383
384 // Update color channel sizes in window format
385 format.setAlphaBufferSize(alphaSize);
386 format.setRedBufferSize(redSize);
387 format.setGreenBufferSize(greenSize);
388 format.setBlueBufferSize(blueSize);
389 context->setFormat(format);
390
391 QQnxGLContext *ctx = new QQnxGLContext(context->format(), context->shareHandle());
392 return ctx;
393}
394#endif
395
396#if QT_CONFIG(qqnx_pps)
398{
400 if (m_qpaInputContext)
401 return m_qpaInputContext;
402 return m_inputContext;
403}
404#endif
405
407{
408 qIntegrationDebug() << "w =" << window << ", s =" << screen;
409
410 // get platform window used by widget
411 QQnxWindow *platformWindow = static_cast<QQnxWindow *>(window->handle());
412
413 // lookup platform screen by index
414 QQnxScreen *platformScreen = m_screens.at(screen);
415
416 // move the platform window to the platform screen
417 platformWindow->setScreen(platformScreen);
418}
419
421{
423
424 // We transfer ownersip of the event-dispatcher to QtCoreApplication
425 QAbstractEventDispatcher *eventDispatcher = m_eventDispatcher;
426 m_eventDispatcher = 0;
427
428 return eventDispatcher;
429}
430
432{
433 return m_nativeInterface;
434}
435
436#if !defined(QT_NO_CLIPBOARD)
438{
440
441#if QT_CONFIG(qqnx_pps)
442 if (!m_clipboard)
443 m_clipboard = new QQnxClipboard;
444#endif
445 return m_clipboard;
446}
447#endif
448
449#if QT_CONFIG(draganddrop)
450QPlatformDrag *QQnxIntegration::drag() const
451{
452 return m_drag;
453}
454#endif
455
457{
459 if ((hint == ShowIsFullScreen) && (m_options & FullScreenApplication))
460 return true;
461
463}
464
466{
467 return m_services;
468}
469
470QWindow *QQnxIntegration::window(screen_window_t qnxWindow) const
471{
473 QMutexLocker locker(&m_windowMapperMutex);
474 Q_UNUSED(locker);
475 return m_windowMapper.value(qnxWindow, 0);
476}
477
478void QQnxIntegration::addWindow(screen_window_t qnxWindow, QWindow *window)
479{
481 QMutexLocker locker(&m_windowMapperMutex);
482 Q_UNUSED(locker);
483 m_windowMapper.insert(qnxWindow, window);
484}
485
486void QQnxIntegration::removeWindow(screen_window_t qnxWindow)
487{
489 QMutexLocker locker(&m_windowMapperMutex);
490 Q_UNUSED(locker);
491 m_windowMapper.remove(qnxWindow);
492}
493
499static int getIdOfDisplay(screen_display_t display)
500{
501 int displayId;
502 if (screen_get_display_property_iv(display,
503 SCREEN_PROPERTY_ID,
504 &displayId) == 0) {
505 return displayId;
506 }
507 return -1;
508}
509
515static bool getRequestedDisplays(QJsonArray &requestedDisplays)
516{
517 // Check if display configuration file is provided
518 QByteArray json = qgetenv("QT_QPA_QNX_DISPLAY_CONFIG");
519 if (json.isEmpty())
520 return false;
521
522 // Check if configuration file exists
524 if (!file.open(QFile::ReadOnly)) {
525 qWarning() << "Could not open config file" << json << "for reading";
526 return false;
527 }
528
529 // Read config file and check it's json
531 if (!doc.isObject()) {
532 qWarning() << "Invalid config file" << json
533 << "- no top-level JSON object";
534 return false;
535 }
536
537 // Read the requested display order
538 const QJsonObject object = doc.object();
539 requestedDisplays = object.value("displayOrder"_L1).toArray();
540
541 return true;
542}
543
560QList<screen_display_t *> QQnxIntegration::sortDisplays(screen_display_t *availableDisplays, int displayCount)
561{
562 // Intermediate list for sorting
563 QList<screen_display_t *> allDisplays;
564 for (int i = 0; i < displayCount; i++)
565 allDisplays.append(&availableDisplays[i]);
566
567 // Read requested display order if available
568 QJsonArray requestedDisplays;
569 if (!getRequestedDisplays(requestedDisplays))
570 return allDisplays;
571
572 // Go through all the requested displays IDs
573 QList<screen_display_t *> orderedDisplays;
574 for (const QJsonValue &value : std::as_const(requestedDisplays)) {
575 int requestedValue = value.toInt();
576
577 // Move all displays with matching ID from the intermediate list
578 // to the beginning of the ordered list
579 for (auto it = allDisplays.begin(), end = allDisplays.end(); it != end; ++it) {
580 screen_display_t *display = *it;
581 if (getIdOfDisplay(*display) == requestedValue) {
582 orderedDisplays.append(display);
583 allDisplays.erase(it);
584 break;
585 }
586 }
587 }
588
589 // Place all unordered displays to the end of list
590 orderedDisplays.append(allDisplays);
591
592 return orderedDisplays;
593}
594
595void QQnxIntegration::createDisplays()
596{
598 // Query number of displays
599 int displayCount = 0;
600 int result = screen_get_context_property_iv(m_screenContext, SCREEN_PROPERTY_DISPLAY_COUNT,
601 &displayCount);
602 Q_SCREEN_CRITICALERROR(result, "Failed to query display count");
603
604 if (Q_UNLIKELY(displayCount < 1)) {
605 // Never happens, even if there's no display, libscreen returns 1
606 qFatal("QQnxIntegration: displayCount=%d", displayCount);
607 }
608
609 // Get all displays
610 screen_display_t *displays = (screen_display_t *)alloca(sizeof(screen_display_t) * displayCount);
611 result = screen_get_context_property_pv(m_screenContext, SCREEN_PROPERTY_DISPLAYS,
612 (void **)displays);
613 QList<screen_display_t *> orderedDisplays = sortDisplays(displays, displayCount);
614 Q_SCREEN_CRITICALERROR(result, "Failed to query displays");
615
616 // If it's primary, we create a QScreen for it even if it's not attached
617 // since Qt will dereference QGuiApplication::primaryScreen()
618 createDisplay(*orderedDisplays[0], /*isPrimary=*/true);
619
620 for (int i=1; i<displayCount; i++) {
621 int isAttached = 1;
622 result = screen_get_display_property_iv(*orderedDisplays[i], SCREEN_PROPERTY_ATTACHED,
623 &isAttached);
624 Q_SCREEN_CHECKERROR(result, "Failed to query display attachment");
625
626 if (!isAttached) {
627 qIntegrationDebug("Skipping non-attached display %d", i);
628 continue;
629 }
630
631 qIntegrationDebug("Creating screen for display %d", i);
632 createDisplay(*orderedDisplays[i], /*isPrimary=*/false);
633 } // of displays iteration
634}
635
636void QQnxIntegration::createDisplay(screen_display_t display, bool isPrimary)
637{
638 QQnxScreen *screen = new QQnxScreen(m_screenContext, display, isPrimary);
639 m_screens.append(screen);
641 screen->adjustOrientation();
642
643 QObject::connect(m_screenEventHandler, SIGNAL(newWindowCreated(void*)),
644 screen, SLOT(newWindowCreated(void*)));
645 QObject::connect(m_screenEventHandler, SIGNAL(windowClosed(void*)),
646 screen, SLOT(windowClosed(void*)));
647
648 QObject::connect(m_navigatorEventHandler, SIGNAL(rotationChanged(int)), screen, SLOT(setRotation(int)));
649 QObject::connect(m_navigatorEventHandler, SIGNAL(windowGroupActivated(QByteArray)), screen, SLOT(activateWindowGroup(QByteArray)));
650 QObject::connect(m_navigatorEventHandler, SIGNAL(windowGroupDeactivated(QByteArray)), screen, SLOT(deactivateWindowGroup(QByteArray)));
651 QObject::connect(m_navigatorEventHandler, SIGNAL(windowGroupStateChanged(QByteArray,Qt::WindowState)),
652 screen, SLOT(windowGroupStateChanged(QByteArray,Qt::WindowState)));
653}
654
656{
658 Q_ASSERT(m_screens.contains(screen));
659 m_screens.removeAll(screen);
661}
662
663void QQnxIntegration::destroyDisplays()
664{
666 Q_FOREACH (QQnxScreen *screen, m_screens) {
668 }
669 m_screens.clear();
670}
671
672QQnxScreen *QQnxIntegration::screenForNative(screen_display_t qnxScreen) const
673{
674 Q_FOREACH (QQnxScreen *screen, m_screens) {
675 if (screen->nativeDisplay() == qnxScreen)
676 return screen;
677 }
678
679 return 0;
680}
681
683{
684 return m_screens.first();
685}
686
687QQnxIntegration::Options QQnxIntegration::options() const
688{
689 return m_options;
690}
691
693{
694 return m_screenContext;
695}
696
698{
699 return m_screenContextId;
700}
701
703{
704 return m_navigatorEventHandler;
705}
706
708{
709 // If QQNX_PPS is defined then we have navigator
710 return m_navigator != 0;
711}
712
713#if QT_CONFIG(opengl)
714void QQnxIntegration::createEglDisplay()
715{
717
718 // Initialize connection to EGL
719 m_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
720 if (Q_UNLIKELY(m_eglDisplay == EGL_NO_DISPLAY))
721 qFatal("QQnxiIntegration: failed to obtain EGL display: %x", eglGetError());
722
723 EGLBoolean eglResult = eglInitialize(m_eglDisplay, 0, 0);
724 if (Q_UNLIKELY(eglResult != EGL_TRUE))
725 qFatal("QQnxIntegration: failed to initialize EGL display, err=%d", eglGetError());
726}
727
728void QQnxIntegration::destroyEglDisplay()
729{
731
732 // Close connection to EGL
733 eglTerminate(m_eglDisplay);
734}
735#endif
736
\inmodule QtCore
Definition qbytearray.h:57
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
Definition qbytearray.h:534
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
Definition qbytearray.h:474
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
Definition qbytearray.h:122
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
Definition qbytearray.h:106
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
\inmodule QtCore
Definition qfile.h:93
bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
Definition qfile.cpp:881
bool remove(const Key &key)
Removes the item that has the key from the hash.
Definition qhash.h:956
T value(const Key &key) const noexcept
Definition qhash.h:1044
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition qhash.h:1283
QByteArray readAll()
Reads all remaining data from the device, and returns it as a byte array.
\inmodule QtCore\reentrant
Definition qjsonarray.h:18
\inmodule QtCore\reentrant
QJsonObject object() const
Returns the QJsonObject contained in the document.
bool isObject() const
Returns true if the document contains an object.
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error=nullptr)
Parses json as a UTF-8 encoded JSON document, and creates a QJsonDocument from it.
\inmodule QtCore\reentrant
Definition qjsonobject.h:20
\inmodule QtCore\reentrant
Definition qjsonvalue.h:24
Definition qlist.h:74
T & first()
Definition qlist.h:628
iterator erase(const_iterator begin, const_iterator end)
Definition qlist.h:882
iterator end()
Definition qlist.h:609
const_reference at(qsizetype i) const noexcept
Definition qlist.h:429
qsizetype removeAll(const AT &t)
Definition qlist.h:575
iterator begin()
Definition qlist.h:608
void append(parameter_type t)
Definition qlist.h:441
void clear()
Definition qlist.h:417
\inmodule QtCore
Definition qmutex.h:317
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2823
\inmodule QtGui
The QPlatformBackingStore class provides the drawing area for top-level windows.
The QPlatformClipboard class provides an abstraction for the system clipboard.
The QPlatformDrag class provides an abstraction for drag.
The QPlatformFontDatabase class makes it possible to customize how fonts are discovered and how they ...
static QPlatformInputContext * create()
The QPlatformInputContext class abstracts the input method dependent data and composing state.
The QPlatformIntegration class is the entry for WindowSystem specific functionality.
virtual QVariant styleHint(StyleHint hint) const
virtual bool hasCapability(Capability cap) const
virtual QPlatformOpenGLContext * createPlatformOpenGLContext(QOpenGLContext *context) const
Factory function for QPlatformOpenGLContext.
virtual QPlatformInputContext * inputContext() const
Returns the platforms input context.
Capability
Capabilities are used to determine specific features of a platform integration.
The QPlatformNativeInterface class provides an abstraction for retrieving native resource handles.
The QPlatformOpenGLContext class provides an abstraction for native GL contexts.
The QPlatformServices provides the backend for desktop-related functionality.
The QPlatformWindow class provides an abstraction for top-level windows.
QAbstractEventDispatcher * createEventDispatcher() const override
Factory function for the GUI event dispatcher.
bool hasCapability(QPlatformIntegration::Capability cap) const override
QQnxIntegration(const QStringList &paramList)
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)
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
void setScreenEventThread(QQnxScreenEventThread *eventThread)
void addScreenEventFilter(QQnxScreenEventFilter *filter)
The QQnxWindow is the base class of the various classes used as instances of QPlatformWindow in the Q...
Definition qqnxwindow.h:28
void setScreen(QQnxScreen *platformScreen)
int depth
the color depth of the screen
Definition qscreen.h:40
QSimpleDrag implements QBasicDrag for Drag and Drop operations within the Qt Application itself.
\inmodule QtCore
\inmodule QtCore
Definition qstringview.h:76
constexpr QStringView mid(qsizetype pos, qsizetype n=-1) const noexcept
Returns the substring of length length starting at position start in this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:5857
qsizetype length() const
Returns the number of characters in this string.
Definition qstring.h:187
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
SurfaceType
The SurfaceType enum describes what type of surface this is.
Definition qsurface.h:30
@ RasterSurface
Definition qsurface.h:31
@ OpenGLSurface
Definition qsurface.h:32
void start(Priority=InheritPriority)
Definition qthread.cpp:923
\inmodule QtCore
Definition qvariant.h:64
static void handleScreenAdded(QPlatformScreen *screen, bool isPrimary=false)
Should be called by the implementation whenever a new screen is added.
static void handleScreenRemoved(QPlatformScreen *screen)
Should be called by the implementation whenever a screen is removed.
\inmodule QtGui
Definition qwindow.h:63
EGLContext ctx
#define this
Definition dialogs.cpp:9
QSet< QString >::iterator it
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
WindowState
Definition qnamespace.h:250
@ QueuedConnection
static void * context
#define Q_UNLIKELY(x)
#define Q_FUNC_INFO
typedef EGLBoolean(EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC)(EGLint max_devices
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_FOREACH(variable, container)
Definition qforeach.h:66
#define qWarning
Definition qlogging.h:162
#define qFatal
Definition qlogging.h:164
#define SLOT(a)
Definition qobjectdefs.h:51
#define SIGNAL(a)
Definition qobjectdefs.h:52
GLint GLenum GLsizei GLsizei GLsizei depth
GLuint GLuint end
GLenum const GLint * param
GLint GLsizei GLsizei GLenum format
GLuint64EXT * result
[6]
GLenum cap
#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.
#define qIntegrationDebug
static int getContextCapabilities(const QStringList &paramList)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
#define QStringLiteral(str)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
Options parseOptions()
Definition main.cpp:367
QScreen * screen
[1]
Definition main.cpp:29
#define QT_CONFIG(feature)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
#define Q_UNUSED(x)
Q_CHECK_PTR(a=new int[80])
if(qFloatDistance(a, b)<(1<< 7))
[0]
QFile file
[0]
aWidget window() -> setWindowTitle("New Window Title")
[2]
bool contains(const AT &t) const noexcept
Definition qlist.h:44
static bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(nullptr), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
\threadsafe This is an overloaded member function, provided for convenience. It differs from the abov...