Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqnxnativeinterface.cpp
Go to the documentation of this file.
1// Copyright (C) 2012 Research In Motion
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
6#if !defined(QT_NO_OPENGL)
7#include "qqnxglcontext.h"
8#endif
9
10#include "qqnxscreen.h"
11#include "qqnxwindow.h"
12#if defined(QQNX_IMF)
14#endif
15
16#include "qqnxintegration.h"
17
18#if !defined(QT_NO_OPENGL)
19#include <QtGui/QOpenGLContext>
20#endif
21
22#include <QtGui/QScreen>
23#include <QtGui/QWindow>
24
26
27using namespace Qt::StringLiterals;
28
30 : m_integration(integration)
31{
32}
33
35{
36 if (resource == "windowGroup" && window && window->screen()) {
37 QQnxScreen * const screen = static_cast<QQnxScreen *>(window->screen()->handle());
38 if (screen) {
39 screen_window_t screenWindow = reinterpret_cast<screen_window_t>(window->winId());
40 QQnxWindow *qnxWindow = screen->findWindow(screenWindow);
41 // We can't just call data() instead of constData() here, since that would detach
42 // and the lifetime of the char * would not be long enough. Therefore the const_cast.
43 return qnxWindow ? const_cast<char *>(qnxWindow->groupName().constData()) : 0;
44 }
45 }
46
47 return 0;
48}
49
51{
52 if (resource == "QObject*" && screen)
53 return static_cast<QObject*>(static_cast<QQnxScreen*>(screen->handle()));
54
55 return 0;
56}
57
59{
60 if (resource == "screenContext")
61 return m_integration->screenContext();
62
63#if QT_CONFIG(opengl)
64 if (resource.toLower() == "egldisplay")
65 return m_integration->eglDisplay();
66#endif
67
68 return 0;
69}
70
71#if !defined(QT_NO_OPENGL)
73{
74 if (resource == "eglcontext" && context)
75 return static_cast<QQnxGLContext*>(context->handle())->eglContext();
76
77 return 0;
78}
79#endif
80
82{
83 QQnxWindow *qnxWindow = static_cast<QQnxWindow*>(window);
84
85 if (name == "qnxWindowGroup"_L1) {
86 if (value.isNull())
87 qnxWindow->joinWindowGroup(QByteArray());
88 else if (value.canConvert<QByteArray>())
89 qnxWindow->joinWindowGroup(value.toByteArray());
90 }
91}
92
94{
95#if defined(QQNX_IMF)
96 if (resource == "blackberryIMFSetHighlightColor")
98 if (resource == "blackberryIMFCheckSpelling")
100#else
101 Q_UNUSED(resource);
102#endif
103 return 0;
104}
105
\inmodule QtCore
Definition qbytearray.h:57
QByteArray toLower() const &
Definition qbytearray.h:254
\inmodule QtCore
Definition qobject.h:103
\inmodule QtGui
The QPlatformWindow class provides an abstraction for top-level windows.
static bool checkSpelling(const QString &text, void *context, void(*spellCheckDone)(void *context, const QString &text, const QList< int > &indices))
static void setHighlightColor(int index, const QColor &color)
screen_context_t screenContext()
void * nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override
void * nativeResourceForWindow(const QByteArray &resource, QWindow *window) override
void * nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override
QQnxNativeInterface(QQnxIntegration *integration)
void * nativeResourceForIntegration(const QByteArray &resource) override
NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override
void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value) override
Sets a window property with name to value.
The QQnxWindow is the base class of the various classes used as instances of QPlatformWindow in the Q...
Definition qqnxwindow.h:31
void joinWindowGroup(const QByteArray &groupName)
The QScreen class is used to query screen properties. \inmodule QtGui.
Definition qscreen.h:32
QPlatformScreen * handle() const
Get the platform screen handle.
Definition qscreen.cpp:83
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
static void * context
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint name
QScreen * screen
[1]
Definition main.cpp:29
#define Q_UNUSED(x)
aWidget window() -> setWindowTitle("New Window Title")
[2]