Qt 4.8
Public Types | Public Functions | List of all members
QPlatformIntegration Class Referenceabstract

The QPlatformIntegration class is the entry for WindowSystem specific functionality. More...

#include <qplatformintegration_qpa.h>

Inheritance diagram for QPlatformIntegration:
QBBIntegration QCocoaIntegration QDirectFbIntegration QEglFSIntegration QLinuxFbIntegration QMinimalIntegration QOpenKODEIntegration QUIKitIntegration QVFbIntegration QVNCIntegration QWaylandIntegration QXcbIntegration QXlibIntegration

Public Types

enum  Capability { ThreadedPixmaps = 1, OpenGL = 2 }
 

Public Functions

virtual QPlatformClipboardclipboard () const
 Accessor for the platform integrations clipboard. More...
 
virtual QPlatformEventLoopIntegrationcreateEventLoopIntegration () const
 Factory function for the eventloop integration interface. More...
 
virtual QPixmapDatacreatePixmapData (QPixmapData::PixelType type) const =0
 Factory function for QPixmapData. More...
 
virtual QPlatformWindowcreatePlatformWindow (QWidget *widget, WId winId=0) const =0
 Factory function for QPlatformWindow. More...
 
virtual QWindowSurfacecreateWindowSurface (QWidget *widget, WId winId) const =0
 Factory function for QWindowSurface. More...
 
virtual QPlatformFontDatabasefontDatabase () const
 Accessor for the platform integrations fontdatabase. 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 hasCapability (Capability cap) const
 
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 QPlatformNativeInterfacenativeInterface () const
 
virtual QList< QPlatformScreen * > screens () const =0
 Accessor function to a list of all the screens on the current system. More...
 
virtual ~QPlatformIntegration ()
 

Detailed Description

The QPlatformIntegration class is the entry for WindowSystem specific functionality.

Since
4.8
Warning
This function is not part of the public interface. This function is under development and subject to change.

QPlatformIntegration is the single entry point for windowsystem specific functionality when using the QPA platform. It has factory functions for creating platform specific pixmaps and windows. The class also controls the font subsystem.

QPlatformIntegration is a singelton class which gets instansiated in the QApplication constructor. The QPlatformIntegration instance do not have ownership of objects it creates in functions where the name starts with create. However, functions which don't have a name starting with create acts as assessors to member variables.

It is not trivial to create or build a platform plugin outside of the Qt source tree. Therefor the recommended approach for making new platform plugin is to copy an existing plugin inside the QTSRCTREE/src/plugins/platform and develop the plugin inside the source tree.

The minimal platform integration is the smallest platform integration it is possible to make, which makes it an ideal starting point for new plugins. For a slightly more advanced plugin, consider reviewing the directfb plugin, or the testlite plugin.

Definition at line 65 of file qplatformintegration_qpa.h.

Enumerations

◆ Capability

Enumerator
ThreadedPixmaps 
OpenGL 

Definition at line 68 of file qplatformintegration_qpa.h.

Constructors and Destructors

◆ ~QPlatformIntegration()

virtual QPlatformIntegration::~QPlatformIntegration ( )
inlinevirtual

Definition at line 73 of file qplatformintegration_qpa.h.

73 { }

Functions

◆ clipboard()

QPlatformClipboard * QPlatformIntegration::clipboard ( ) const
virtual

Accessor for the platform integrations clipboard.

Default implementation returns a default QPlatformClipboard.

See also
QPlatformClipboard

Reimplemented in QBBIntegration, QXlibIntegration, and QWaylandIntegration.

Definition at line 98 of file qplatformintegration_qpa.cpp.

Referenced by QWaylandDisplay::displayHandleGlobal(), and QXlibScreen::handleSelectionRequest().

99 {
100  static QPlatformClipboard *clipboard = 0;
101  if (!clipboard) {
102  clipboard = new QPlatformClipboard;
103  }
104  return clipboard;
105 }
virtual QPlatformClipboard * clipboard() const
Accessor for the platform integrations clipboard.

◆ createEventLoopIntegration()

QPlatformEventLoopIntegration * QPlatformIntegration::createEventLoopIntegration ( ) const
virtual

Factory function for the eventloop integration interface.

Default implementation returns 0, which causes the eventloop to run in a single thread mode.

See also
QPlatformEventLoopIntegration

Reimplemented in QOpenKODEIntegration, QCocoaIntegration, and QUIKitIntegration.

Definition at line 66 of file qplatformintegration_qpa.cpp.

67 {
68  return 0;
69 }

◆ createPixmapData()

QPixmapData * QPlatformIntegration::createPixmapData ( QPixmapData::PixelType  type) const
pure virtual

◆ createPlatformWindow()

QPlatformWindow * QPlatformIntegration::createPlatformWindow ( QWidget widget,
WId  winId = 0 
) const
pure 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

Implemented in QOpenKODEIntegration, QVNCIntegration, QLinuxFbIntegration, QVFbIntegration, QCocoaIntegration, QMinimalIntegration, QBBIntegration, QXlibIntegration, QDirectFbIntegration, QEglFSIntegration, QXcbIntegration, QWaylandIntegration, and QUIKitIntegration.

◆ createWindowSurface()

QWindowSurface * QPlatformIntegration::createWindowSurface ( QWidget widget,
WId  winId 
) const
pure 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

Implemented in QOpenKODEIntegration, QVNCIntegration, QLinuxFbIntegration, QVFbIntegration, QCocoaIntegration, QMinimalIntegration, QBBIntegration, QXlibIntegration, QDirectFbIntegration, QEglFSIntegration, QXcbIntegration, QWaylandIntegration, and QUIKitIntegration.

◆ fontDatabase()

QPlatformFontDatabase * QPlatformIntegration::fontDatabase ( ) const
virtual

Accessor for the platform integrations fontdatabase.

Default implementation returns a default QPlatformFontDatabase.

See also
QPlatformFontDatabase

Reimplemented in QOpenKODEIntegration, QVNCIntegration, QLinuxFbIntegration, QVFbIntegration, QCocoaIntegration, QBBIntegration, QXlibIntegration, QDirectFbIntegration, QXcbIntegration, QEglFSIntegration, QWaylandIntegration, and QUIKitIntegration.

Definition at line 78 of file qplatformintegration_qpa.cpp.

Referenced by QtFontStyle::~QtFontStyle().

79 {
80  static QPlatformFontDatabase *db = 0;
81  if (!db) {
82  db = new QPlatformFontDatabase;
83  }
84  return db;
85 }
The QPlatformFontDatabase class makes it possible to customize how fonts are discovered and how they ...

◆ grabWindow()

QPixmap QPlatformIntegration::grabWindow ( WId  window,
int  x,
int  y,
int  width,
int  height 
) const
virtual

This function is called when Qt needs to be able to grab the content of a window.

Returnes the content of the window specified with the WId handle within the boundaries of QRect(x,y,width,height).

Reimplemented in QVNCIntegration, QXlibIntegration, and QXcbIntegration.

Definition at line 49 of file qplatformintegration_qpa.cpp.

50 {
52  Q_UNUSED(x);
53  Q_UNUSED(y);
54  Q_UNUSED(width);
55  Q_UNUSED(height);
56  return QPixmap();
57 }
NSWindow * window
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
#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

◆ hasCapability()

bool QPlatformIntegration::hasCapability ( Capability  cap) const
virtual

◆ isVirtualDesktop()

bool QPlatformIntegration::isVirtualDesktop ( )
inlinevirtual

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.

Default implementation returns false.

Reimplemented in QVNCIntegration, and QXcbIntegration.

Definition at line 85 of file qplatformintegration_qpa.h.

85 { return false; }

◆ moveToScreen()

void QPlatformIntegration::moveToScreen ( QWidget window,
int  screen 
)
inlinevirtual

This function is called when a QWidget is displayed on screen, or the QWidget is to be displayed on a new screen.

The QWidget parameter is a pointer to the top level widget and the int parameter is the index to the screen in QList<QPlatformScreen *> screens() const.

Default implementation does nothing.

See also
screens() const

Reimplemented in QVNCIntegration, QBBIntegration, and QXcbIntegration.

Definition at line 84 of file qplatformintegration_qpa.h.

Referenced by QWidgetPrivate::init(), and q_createNativeChildrenAndSetParent().

84 {Q_UNUSED(window); Q_UNUSED(screen);}
#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

◆ nativeInterface()

QPlatformNativeInterface * QPlatformIntegration::nativeInterface ( ) const
virtual

Reimplemented in QXlibIntegration, QBBIntegration, QXcbIntegration, and QWaylandIntegration.

Definition at line 109 of file qplatformintegration_qpa.cpp.

110 {
111  return 0;
112 }

◆ screens()

QList< QPlatformScreen * > QPlatformIntegration::screens ( ) const
pure virtual

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