Qt 4.8
Public Functions | Private Functions | Properties | List of all members
QWaylandIntegration Class Reference

#include <qwaylandintegration.h>

Inheritance diagram for QWaylandIntegration:
QPlatformIntegration

Public Functions

QPlatformClipboardclipboard () const
 Accessor for the platform integrations clipboard. More...
 
QPixmapDatacreatePixmapData (QPixmapData::PixelType type) const
 Factory function for QPixmapData. More...
 
QPlatformWindowcreatePlatformWindow (QWidget *widget, WId winId) const
 Factory function for QPlatformWindow. More...
 
QWindowSurfacecreateWindowSurface (QWidget *widget, WId winId) const
 Factory function for QWindowSurface. More...
 
QPlatformFontDatabasefontDatabase () const
 Accessor for the platform integrations fontdatabase. More...
 
bool hasCapability (QPlatformIntegration::Capability cap) const
 
QPlatformNativeInterfacenativeInterface () const
 
 QWaylandIntegration (bool useOpenGL=false)
 
QList< QPlatformScreen * > screens () const
 Accessor function to a list of all the screens on the current system. More...
 
- Public Functions inherited from QPlatformIntegration
virtual QPlatformEventLoopIntegrationcreateEventLoopIntegration () const
 Factory function for the eventloop integration interface. More...
 
virtual QPixmap grabWindow (WId window, int x, int y, int width, int height) const
 This function is called when Qt needs to be able to grab the content of a window. More...
 
virtual bool isVirtualDesktop ()
 Returns if the current windowing system configuration defines all the screens to be one desktop(virtual desktop), or if each screen is a desktop of its own. More...
 
virtual void moveToScreen (QWidget *window, int screen)
 This function is called when a QWidget is displayed on screen, or the QWidget is to be displayed on a new screen. More...
 
virtual ~QPlatformIntegration ()
 

Private Functions

bool hasOpenGL () const
 

Properties

QPlatformClipboardmClipboard
 
QWaylandDisplaymDisplay
 
QPlatformFontDatabasemFontDb
 
QPlatformNativeInterfacemNativeInterface
 
bool mUseOpenGL
 

Additional Inherited Members

- Public Types inherited from QPlatformIntegration
enum  Capability { ThreadedPixmaps = 1, OpenGL = 2 }
 

Detailed Description

Definition at line 52 of file qwaylandintegration.h.

Constructors and Destructors

◆ QWaylandIntegration()

QWaylandIntegration::QWaylandIntegration ( bool  useOpenGL = false)

Definition at line 63 of file qwaylandintegration.cpp.

65  , mDisplay(new QWaylandDisplay())
66  , mUseOpenGL(useOpenGL)
68  , mClipboard(0)
69 {
70 }
QBasicUnixFontDatabase QGenericUnixFontDatabase
QWaylandDisplay * mDisplay
QPlatformNativeInterface * mNativeInterface
QPlatformClipboard * mClipboard
QPlatformFontDatabase * mFontDb

Functions

◆ clipboard()

QPlatformClipboard * QWaylandIntegration::clipboard ( ) const
virtual

Accessor for the platform integrations clipboard.

Default implementation returns a default QPlatformClipboard.

See also
QPlatformClipboard

Reimplemented from QPlatformIntegration.

Definition at line 138 of file qwaylandintegration.cpp.

139 {
140  if (!mClipboard)
142  return mClipboard;
143 }
QWaylandDisplay * mDisplay
QPlatformClipboard * mClipboard

◆ createPixmapData()

QPixmapData * QWaylandIntegration::createPixmapData ( QPixmapData::PixelType  type) const
virtual

Factory function for QPixmapData.

PixelType can be either PixmapType or BitmapType.

See also
QPixmapData

Implements QPlatformIntegration.

Definition at line 92 of file qwaylandintegration.cpp.

93 {
94 #ifdef QT_WAYLAND_GL_SUPPORT
95  if (mUseOpenGL)
96  return new QGLPixmapData(type);
97 #endif
98  return new QRasterPixmapData(type);
99 }
int type
Definition: qmetatype.cpp:239

◆ createPlatformWindow()

QPlatformWindow * QWaylandIntegration::createPlatformWindow ( QWidget widget,
WId  winId 
) const
virtual

Factory function for QPlatformWindow.

The widget parameter is a pointer to the top level widget(tlw) which the QPlatformWindow is suppose to be created for. The WId handle is actually never used, but there for future reference. Its purpose is if it is going to be possible to create QPlatformWindows on existing WId.

All tlw has to have a QPlatformWindow, and it will be created when the QPlatformWindow is set to be visible for the first time. If the tlw's window flags are changed, or if the tlw's QPlatformWindowFormat is changed, then the tlw's QPlatformWindow is deleted and a new one is created.

See also
QPlatformWindow, QPlatformWindowFormat
createWindowSurface(QWidget *widget, WId winId) const

Implements QPlatformIntegration.

Definition at line 101 of file qwaylandintegration.cpp.

102 {
103  Q_UNUSED(winId);
104 #ifdef QT_WAYLAND_GL_SUPPORT
105  bool useOpenGL = mUseOpenGL || (widget->platformWindowFormat().windowApi() == QPlatformWindowFormat::OpenGL);
106  if (useOpenGL)
107  return mDisplay->eglIntegration()->createEglWindow(widget);
108 #endif
109  return new QWaylandShmWindow(widget);
110 }
QWaylandDisplay * mDisplay
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ createWindowSurface()

QWindowSurface * QWaylandIntegration::createWindowSurface ( QWidget widget,
WId  winId 
) const
virtual

Factory function for QWindowSurface.

The QWidget parameter is a pointer to the top level widget(tlw) the window surface is created for. A QPlatformWindow is always created before the QWindowSurface for tlw where the widget also requires a WindowSurface. It is possible to create top level QWidgets without a QWindowSurface by specifying QPlatformWindowFormat::setWindowSurface(false) for the tlw QPlatformWindowFormat.

See also
QWindowSurface
createPlatformWindow(QWidget *widget, WId winId = 0) const

Implements QPlatformIntegration.

Definition at line 112 of file qwaylandintegration.cpp.

113 {
114  Q_UNUSED(winId);
115  Q_UNUSED(winId);
116 #ifdef QT_WAYLAND_GL_SUPPORT
117  bool useOpenGL = mUseOpenGL || (widget->platformWindowFormat().windowApi() == QPlatformWindowFormat::OpenGL);
118  if (useOpenGL)
119  return new QWaylandGLWindowSurface(widget);
120 #endif
121  return new QWaylandShmWindowSurface(widget);
122 }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ fontDatabase()

QPlatformFontDatabase * QWaylandIntegration::fontDatabase ( ) const
virtual

Accessor for the platform integrations fontdatabase.

Default implementation returns a default QPlatformFontDatabase.

See also
QPlatformFontDatabase

Reimplemented from QPlatformIntegration.

Definition at line 124 of file qwaylandintegration.cpp.

125 {
126  return mFontDb;
127 }
QPlatformFontDatabase * mFontDb

◆ hasCapability()

bool QWaylandIntegration::hasCapability ( QPlatformIntegration::Capability  cap) const
virtual

Reimplemented from QPlatformIntegration.

Definition at line 83 of file qwaylandintegration.cpp.

84 {
85  switch (cap) {
86  case ThreadedPixmaps: return true;
87  case OpenGL: return hasOpenGL();
88  default: return QPlatformIntegration::hasCapability(cap);
89  }
90 }
virtual bool hasCapability(Capability cap) const

◆ hasOpenGL()

bool QWaylandIntegration::hasOpenGL ( ) const
private

Definition at line 129 of file qwaylandintegration.cpp.

Referenced by hasCapability().

130 {
131 #ifdef QT_WAYLAND_GL_SUPPORT
132  return true;
133 #else
134  return false;
135 #endif
136 }

◆ nativeInterface()

QPlatformNativeInterface * QWaylandIntegration::nativeInterface ( ) const
virtual

Reimplemented from QPlatformIntegration.

Definition at line 72 of file qwaylandintegration.cpp.

73 {
74  return mNativeInterface;
75 }
QPlatformNativeInterface * mNativeInterface

◆ screens()

QList< QPlatformScreen * > QWaylandIntegration::screens ( ) const
virtual

Accessor function to a list of all the screens on the current system.

The screen with the index == 0 is the default/main screen.

Implements QPlatformIntegration.

Definition at line 78 of file qwaylandintegration.cpp.

79 {
80  return mDisplay->screens();
81 }
QWaylandDisplay * mDisplay
QList< QPlatformScreen * > screens() const

Properties

◆ mClipboard

QPlatformClipboard* QWaylandIntegration::mClipboard
mutableprivate

Definition at line 77 of file qwaylandintegration.h.

Referenced by clipboard().

◆ mDisplay

QWaylandDisplay* QWaylandIntegration::mDisplay
private

Definition at line 74 of file qwaylandintegration.h.

Referenced by clipboard(), createPlatformWindow(), and screens().

◆ mFontDb

QPlatformFontDatabase* QWaylandIntegration::mFontDb
private

Definition at line 73 of file qwaylandintegration.h.

Referenced by fontDatabase().

◆ mNativeInterface

QPlatformNativeInterface* QWaylandIntegration::mNativeInterface
private

Definition at line 76 of file qwaylandintegration.h.

Referenced by nativeInterface().

◆ mUseOpenGL

bool QWaylandIntegration::mUseOpenGL
private

The documentation for this class was generated from the following files: