QNX: Add screen-context-capabilities platform parameter
Specifies the flags value for the screen_context_create call allowing the Qt application to take on additional screen capabilities via the Qt screen context. Change-Id: Ic7aa478227e64afe2d1d7d04ec58c11ad68b9f22 Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
This commit is contained in:
parent
fc356a1992
commit
aadc294f2d
@ -120,6 +120,22 @@ static inline QQnxIntegration::Options parseOptions(const QStringList ¶mList
|
|||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int getContextCapabilities(const QStringList ¶mList)
|
||||||
|
{
|
||||||
|
QString contextCapabilitiesPrefix = QStringLiteral("screen-context-capabilities=");
|
||||||
|
int contextCapabilities = SCREEN_APPLICATION_CONTEXT;
|
||||||
|
for (const QString ¶m : paramList) {
|
||||||
|
if (param.startsWith(contextCapabilitiesPrefix)) {
|
||||||
|
QStringRef value = param.midRef(contextCapabilitiesPrefix.length());
|
||||||
|
bool ok = false;
|
||||||
|
contextCapabilities = value.toInt(&ok, 0);
|
||||||
|
if (!ok)
|
||||||
|
contextCapabilities = SCREEN_APPLICATION_CONTEXT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return contextCapabilities;
|
||||||
|
}
|
||||||
|
|
||||||
QQnxIntegration::QQnxIntegration(const QStringList ¶mList)
|
QQnxIntegration::QQnxIntegration(const QStringList ¶mList)
|
||||||
: QPlatformIntegration()
|
: QPlatformIntegration()
|
||||||
, m_screenEventThread(0)
|
, m_screenEventThread(0)
|
||||||
@ -145,9 +161,12 @@ QQnxIntegration::QQnxIntegration(const QStringList ¶mList)
|
|||||||
{
|
{
|
||||||
ms_options = parseOptions(paramList);
|
ms_options = parseOptions(paramList);
|
||||||
qIntegrationDebug();
|
qIntegrationDebug();
|
||||||
|
|
||||||
// Open connection to QNX composition manager
|
// Open connection to QNX composition manager
|
||||||
Q_SCREEN_CRITICALERROR(screen_create_context(&ms_screenContext, SCREEN_APPLICATION_CONTEXT),
|
if (screen_create_context(&ms_screenContext, getContextCapabilities(paramList))) {
|
||||||
"Failed to create screen context");
|
qFatal("%s - Screen: Failed to create screen context - Error: %s (%i)",
|
||||||
|
Q_FUNC_INFO, strerror(errno), errno);
|
||||||
|
}
|
||||||
|
|
||||||
#if QT_CONFIG(qqnx_pps)
|
#if QT_CONFIG(qqnx_pps)
|
||||||
// Create/start navigator event notifier
|
// Create/start navigator event notifier
|
||||||
|
Loading…
x
Reference in New Issue
Block a user