[QNX]Add an option to not run fullscreen

Add commandline option to set the default for
fullscreen option.

Change-Id: Ieaf2be3858082fb0e572c8fbaabfd38a698f14f6
Reviewed-by: Frank Osterfeld <frank.osterfeld@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
bb10
Andreas Holzammer 2013-03-14 09:10:37 +01:00 committed by The Qt Project
parent 182d6292ce
commit 0f532b29bb
3 changed files with 30 additions and 5 deletions

View File

@ -46,9 +46,8 @@ QT_BEGIN_NAMESPACE
QPlatformIntegration *QQnxIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
if (system.toLower() == QLatin1String("qnx"))
return new QQnxIntegration;
return new QQnxIntegration(paramList);
return 0;
}

View File

@ -84,6 +84,8 @@
#include <qpa/qplatformwindow.h>
#include <qpa/qwindowsysteminterface.h>
#include <QtGui/private/qguiapplication_p.h>
#if !defined(QT_NO_OPENGL)
#include "qqnxglcontext.h"
#include <QtGui/QOpenGLContext>
@ -107,7 +109,16 @@ QT_BEGIN_NAMESPACE
QQnxWindowMapper QQnxIntegration::ms_windowMapper;
QMutex QQnxIntegration::ms_windowMapperMutex;
QQnxIntegration::QQnxIntegration()
static inline QQnxIntegration::Options parseOptions(const QStringList &paramList)
{
QQnxIntegration::Options options = QQnxIntegration::NoOptions;
if (!paramList.contains(QLatin1String("no-fullscreen"))) {
options |= QQnxIntegration::FullScreenApplication;
}
return options;
}
QQnxIntegration::QQnxIntegration(const QStringList &paramList)
: QPlatformIntegration()
, m_screenEventThread(0)
, m_navigatorEventHandler(new QQnxNavigatorEventHandler())
@ -134,6 +145,7 @@ QQnxIntegration::QQnxIntegration()
#if !defined(QT_NO_DRAGANDDROP)
, m_drag(new QSimpleDrag())
#endif
, m_options(parseOptions(paramList))
{
qIntegrationDebug() << Q_FUNC_INFO;
// Open connection to QNX composition manager
@ -385,7 +397,7 @@ QPlatformDrag *QQnxIntegration::drag() const
QVariant QQnxIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
{
qIntegrationDebug() << Q_FUNC_INFO;
if (hint == ShowIsFullScreen)
if ((hint == ShowIsFullScreen) && (m_options & FullScreenApplication))
return true;
return QPlatformIntegration::styleHint(hint);
@ -529,6 +541,11 @@ QQnxScreen *QQnxIntegration::primaryDisplay() const
return m_screens.first();
}
QQnxIntegration::Options QQnxIntegration::options() const
{
return m_options;
}
bool QQnxIntegration::supportsNavigatorEvents() const
{
// If QQNX_PPS or Q_OS_BLACKBERRY is defined then we have navigator

View File

@ -80,7 +80,12 @@ typedef QHash<screen_window_t, QWindow *> QQnxWindowMapper;
class QQnxIntegration : public QPlatformIntegration
{
public:
QQnxIntegration();
enum Option { // Options to be passed on command line.
NoOptions = 0x0,
FullScreenApplication = 0x1
};
Q_DECLARE_FLAGS(Options, Option)
explicit QQnxIntegration(const QStringList &paramList);
~QQnxIntegration();
bool hasCapability(QPlatformIntegration::Capability cap) const;
@ -129,6 +134,8 @@ public:
void createDisplay(screen_display_t display, bool isPrimary);
void removeDisplay(QQnxScreen *screen);
QQnxScreen *primaryDisplay() const;
Options options() const;
private:
void createDisplays();
void destroyDisplays();
@ -164,6 +171,8 @@ private:
static QQnxWindowMapper ms_windowMapper;
static QMutex ms_windowMapperMutex;
const Options m_options;
friend class QQnxWindow;
};