Suppress warnings about OpenGL when running without connecting to X server in Qt 5.4.1

This commit is contained in:
Kovid Goyal 2015-03-06 08:55:48 +05:30
parent 1f6d66e015
commit 259e51d408
2 changed files with 9 additions and 0 deletions

View File

@ -47,10 +47,18 @@ bool HeadlessIntegration::hasCapability(QPlatformIntegration::Capability cap) co
switch (cap) { switch (cap) {
case ThreadedPixmaps: return true; case ThreadedPixmaps: return true;
case MultipleWindows: return true; case MultipleWindows: return true;
case OpenGL: return false;
case ThreadedOpenGL: return false;
default: return QPlatformIntegration::hasCapability(cap); default: return QPlatformIntegration::hasCapability(cap);
} }
} }
QPlatformOpenGLContext *HeadlessIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
// Suppress warnings about this plugin not supporting createPlatformOpenGLContext that come from the default implementation of this function
return 0;
}
// Dummy font database that does not scan the fonts directory to be // Dummy font database that does not scan the fonts directory to be
// used for command line tools like qmlplugindump that do not create windows // used for command line tools like qmlplugindump that do not create windows
// unless DebugBackingStore is activated. // unless DebugBackingStore is activated.

View File

@ -38,6 +38,7 @@ public:
QPlatformWindow *createPlatformWindow(QWindow *window) const; QPlatformWindow *createPlatformWindow(QWindow *window) const;
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
QAbstractEventDispatcher *createEventDispatcher() const; QAbstractEventDispatcher *createEventDispatcher() const;
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
unsigned options() const { return 0; } unsigned options() const { return 0; }