Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QXcbIntegration Class Reference

#include <qxcbintegration.h>

+ Inheritance diagram for QXcbIntegration:
+ Collaboration diagram for QXcbIntegration:

Public Member Functions

 QXcbIntegration (const QStringList &parameters, int &argc, char **argv)
 
 ~QXcbIntegration ()
 
QPlatformPixmapcreatePlatformPixmap (QPlatformPixmap::PixelType type) const override
 Factory function for QPlatformPixmap.
 
QPlatformWindowcreatePlatformWindow (QWindow *window) const override
 Factory function for QPlatformWindow.
 
QPlatformWindowcreateForeignWindow (QWindow *window, WId nativeHandle) const override
 
QPlatformOpenGLContextcreatePlatformOpenGLContext (QOpenGLContext *context) const override
 Factory function for QPlatformOpenGLContext.
 
QPlatformBackingStorecreatePlatformBackingStore (QWindow *window) const override
 Factory function for QPlatformBackingStore.
 
QPlatformOffscreenSurfacecreatePlatformOffscreenSurface (QOffscreenSurface *surface) const override
 Factory function for QOffscreenSurface.
 
bool hasCapability (Capability cap) const override
 
QAbstractEventDispatchercreateEventDispatcher () const override
 Factory function for the GUI event dispatcher.
 
void initialize () override
 Performs initialization steps that depend on having an event dispatcher available.
 
void moveToScreen (QWindow *window, int screen)
 
QPlatformFontDatabasefontDatabase () const override
 Accessor for the platform integration's fontdatabase.
 
QPlatformNativeInterfacenativeInterface () const override
 
QPlatformClipboardclipboard () const override
 Accessor for the platform integration's clipboard.
 
QPlatformInputContextinputContext () const override
 Returns the platforms input context.
 
QPlatformServicesservices () const override
 
QPlatformKeyMapperkeyMapper () const override
 Accessor for the platform integration's key mapper.
 
QStringList themeNames () const override
 
QPlatformThemecreatePlatformTheme (const QString &name) const override
 
QVariant styleHint (StyleHint hint) const override
 
bool hasConnection () const
 
QXcbConnectionconnection () const
 
QByteArray wmClass () const
 
void sync () override
 
void beep () const override
 
bool nativePaintingEnabled () const
 
void setApplicationBadge (qint64 number) override
 
- Public Member Functions inherited from QPlatformIntegration
virtual ~QPlatformIntegration ()
 
virtual QPlatformSharedGraphicsCachecreatePlatformSharedGraphicsCache (const char *cacheId) const
 Factory function for QPlatformSharedGraphicsCache.
 
virtual QPaintEnginecreateImagePaintEngine (QPaintDevice *paintDevice) const
 Factory function for QPaintEngine.
 
virtual void destroy ()
 Called before the platform integration is deleted.
 
virtual Qt::WindowState defaultWindowState (Qt::WindowFlags) const
 
virtual QPlatformSessionManagercreatePlatformSessionManager (const QString &id, const QString &key) const
 
virtual QOpenGLContext::OpenGLModuleType openGLModuleType ()
 Platform integration function for querying the OpenGL implementation type.
 
virtual void setApplicationIcon (const QIcon &icon) const
 
virtual void quit () const
 
template<auto func, typename... Args>
auto call (Args... args)
 

Static Public Member Functions

static QXcbIntegrationinstance ()
 

Additional Inherited Members

- Public Types inherited from QPlatformIntegration
enum  Capability {
  ThreadedPixmaps = 1 , OpenGL , ThreadedOpenGL , SharedGraphicsCache ,
  BufferQueueingOpenGL , WindowMasks , MultipleWindows , ApplicationState ,
  ForeignWindows , NonFullScreenWindows , NativeWidgets , WindowManagement ,
  WindowActivation , SyncState , RasterGLSurface , AllGLFunctionsQueryable ,
  ApplicationIcon , SwitchableWidgetComposition , TopStackedNativeChildWindows , OpenGLOnRasterSurface ,
  MaximizeUsingFullscreenGeometry , PaintEvents , RhiBasedRendering , ScreenWindowGrabbing ,
  BackingStoreStaticContents
}
 Capabilities are used to determine specific features of a platform integration. More...
 
enum  StyleHint {
  CursorFlashTime , KeyboardInputInterval , MouseDoubleClickInterval , StartDragDistance ,
  StartDragTime , KeyboardAutoRepeatRate , ShowIsFullScreen , PasswordMaskDelay ,
  FontSmoothingGamma , StartDragVelocity , UseRtlExtensions , PasswordMaskCharacter ,
  SetFocusOnTouchRelease , ShowIsMaximized , MousePressAndHoldInterval , TabFocusBehavior ,
  ReplayMousePressOutsidePopup , ItemViewActivateItemOnSingleClick , UiEffects , WheelScrollLines ,
  ShowShortcutsInContextMenus , MouseQuickSelectionThreshold , MouseDoubleClickDistance , FlickStartDistance ,
  FlickMaximumVelocity , FlickDeceleration , UnderlineShortcut
}
 
- Protected Member Functions inherited from QPlatformIntegration
virtual Qt::KeyboardModifiers queryKeyboardModifiers () const
 
virtual QList< int > possibleKeys (const QKeyEvent *) const
 Should be used to obtain a list of possible shortcuts for the given key event.
 
 QPlatformIntegration ()=default
 

Detailed Description

Definition at line 22 of file qxcbintegration.h.

Constructor & Destructor Documentation

◆ QXcbIntegration()

QXcbIntegration::QXcbIntegration ( const QStringList & parameters,
int & argc,
char ** argv )

Definition at line 105 of file qxcbintegration.cpp.

References Qt::AA_CompressHighFrequencyEvents, arg, connection(), QScopedPointer< T, Cleanup >::data(), displayName(), i, QXcbBasicConnection::isConnected(), j, nativePaintingEnabled(), ok, Q_UNUSED, qApp, QByteArray(), qCDebug, qEnvironmentVariableIsSet(), qt_xcb_native_x11_info_init(), qWarning, QScopedPointer< T, Cleanup >::reset(), and runningUnderDebugger().

+ Here is the call graph for this function:

◆ ~QXcbIntegration()

QXcbIntegration::~QXcbIntegration ( )

Definition at line 187 of file qxcbintegration.cpp.

Member Function Documentation

◆ beep()

void QXcbIntegration::beep ( ) const
overridevirtual
Since
5.7

Should sound a bell, using the default volume and sound.

See also
QApplication::beep()

Reimplemented from QPlatformIntegration.

Definition at line 563 of file qxcbintegration.cpp.

References connection(), QScreen::handle(), QGuiApplication::primaryScreen, and screen.

+ Here is the call graph for this function:

◆ clipboard()

QPlatformClipboard * QXcbIntegration::clipboard ( ) const
overridevirtual

Accessor for the platform integration's clipboard.

Default implementation returns a default QPlatformClipboard.

See also
QPlatformClipboard

Reimplemented from QPlatformIntegration.

Definition at line 386 of file qxcbintegration.cpp.

References QXcbConnection::clipboard().

+ Here is the call graph for this function:

◆ connection()

◆ createEventDispatcher()

QAbstractEventDispatcher * QXcbIntegration::createEventDispatcher ( ) const
overridevirtual

Factory function for the GUI event dispatcher.

The platform plugin should create and return a QAbstractEventDispatcher subclass when this function is called.

If the platform plugin for some reason creates the event dispatcher outside of this function (for example in the constructor), it needs to handle the case where this function is never called, ensuring that the event dispatcher is still deleted at some point (typically in the destructor).

Note that the platform plugin should never explicitly set the event dispatcher itself, using QCoreApplication::setEventDispatcher(), but let QCoreApplication decide when and which event dispatcher to create.

Since
5.2

Implements QPlatformIntegration.

Definition at line 330 of file qxcbintegration.cpp.

References connection(), and QXcbEventDispatcher::createEventDispatcher().

+ Here is the call graph for this function:

◆ createForeignWindow()

QPlatformWindow * QXcbIntegration::createForeignWindow ( QWindow * window,
WId nativeHandle ) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 232 of file qxcbintegration.cpp.

References window().

+ Here is the call graph for this function:

◆ createPlatformBackingStore()

QPlatformBackingStore * QXcbIntegration::createPlatformBackingStore ( QWindow * window) const
overridevirtual

Factory function for QPlatformBackingStore.

The QWindow parameter is a pointer to the top level widget(tlw) the window surface is created for. A QPlatformWindow is always created before the QPlatformBackingStore for tlw where the widget also requires a backing store.

See also
QBackingStore
createPlatformWindow()

Implements QPlatformIntegration.

Definition at line 272 of file qxcbintegration.cpp.

References QXcbWindow::isTrayIconWindow(), nativePaintingEnabled(), Q_ASSERT, and window().

+ Here is the call graph for this function:

◆ createPlatformOffscreenSurface()

QPlatformOffscreenSurface * QXcbIntegration::createPlatformOffscreenSurface ( QOffscreenSurface * surface) const
overridevirtual

Factory function for QOffscreenSurface.

An offscreen surface will typically be implemented with a pixel buffer (pbuffer). If the platform doesn't support offscreen surfaces, an invisible window will be used by QOffscreenSurface instead.

Reimplemented from QPlatformIntegration.

Definition at line 290 of file qxcbintegration.cpp.

References QXcbGlIntegration::createPlatformOffscreenSurface(), QScreen::handle(), qWarning, QOffscreenSurface::screen(), and screen.

+ Here is the call graph for this function:

◆ createPlatformOpenGLContext()

QPlatformOpenGLContext * QXcbIntegration::createPlatformOpenGLContext ( QOpenGLContext * context) const
overridevirtual

Factory function for QPlatformOpenGLContext.

The context parameter is a pointer to the context for which a platform-specific context backend needs to be created. Configuration settings like the format, share context and screen have to be taken from this QOpenGLContext and the resulting platform context is expected to be backed by a native context that fulfills these criteria.

If the context has native handles set, no new native context is expected to be created. Instead, the provided handles have to be used. In this case the ownership of the handle must not be taken and the platform implementation is not allowed to destroy the native context. Configuration parameters like the format are also to be ignored. Instead, the platform implementation is responsible for querying the configuriation from the provided native context.

Returns a pointer to a QPlatformOpenGLContext instance or \nullptr if the context could not be created.

See also
QOpenGLContext

Reimplemented from QPlatformIntegration.

Definition at line 238 of file qxcbintegration.cpp.

References context, QXcbGlIntegration::createPlatformOpenGLContext(), QXcbConnection::glIntegration(), and qWarning.

+ Here is the call graph for this function:

◆ createPlatformPixmap()

QPlatformPixmap * QXcbIntegration::createPlatformPixmap ( QPlatformPixmap::PixelType type) const
overridevirtual

Factory function for QPlatformPixmap.

PixelType can be either PixmapType or BitmapType.

See also
QPlatformPixmap

Reimplemented from QPlatformIntegration.

Definition at line 194 of file qxcbintegration.cpp.

References QPlatformIntegration::createPlatformPixmap(), and nativePaintingEnabled().

+ Here is the call graph for this function:

◆ createPlatformTheme()

QPlatformTheme * QXcbIntegration::createPlatformTheme ( const QString & name) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 443 of file qxcbintegration.cpp.

References QGenericUnixTheme::createUnixTheme().

+ Here is the call graph for this function:

◆ createPlatformWindow()

QPlatformWindow * QXcbIntegration::createPlatformWindow ( QWindow * window) const
overridevirtual

Factory function for QPlatformWindow.

The window parameter is a pointer to the window which the QPlatformWindow is supposed to be created for.

All windows have to have a QPlatformWindow, and it will be created on-demand when the QWindow is made visible for the first time, or explicitly through calling QWindow::create().

In the constructor, of the QPlatformWindow, the window flags, state, title and geometry of the window should be applied to the underlying window. If the resulting flags or state differs, the resulting values should be set on the window using QWindow::setWindowFlags() or QWindow::setWindowState(), respectively.

See also
QPlatformWindow, QPlatformWindowFormat
createPlatformBackingStore()

Implements QPlatformIntegration.

Definition at line 204 of file qxcbintegration.cpp.

References connection(), QXcbGlIntegration::createWindow(), Qt::Desktop, QXcbConnection::glIntegration(), QXcbWindow::isTrayIconWindow(), Q_ASSERT, QSurface::RasterGLSurface, QSurface::VulkanSurface, and window().

+ Here is the call graph for this function:

◆ fontDatabase()

QPlatformFontDatabase * QXcbIntegration::fontDatabase ( ) const
overridevirtual

Accessor for the platform integration's fontdatabase.

Default implementation returns a default QPlatformFontDatabase.

See also
QPlatformFontDatabase

Reimplemented from QPlatformIntegration.

Definition at line 375 of file qxcbintegration.cpp.

References QScopedPointer< T, Cleanup >::data().

+ Here is the call graph for this function:

◆ hasCapability()

◆ hasConnection()

bool QXcbIntegration::hasConnection ( ) const
inline

Definition at line 83 of file qxcbintegration.h.

◆ initialize()

void QXcbIntegration::initialize ( )
overridevirtual

Performs initialization steps that depend on having an event dispatcher available.

Called after the event dispatcher has been created.

Tasks that require an event dispatcher, for example creating socket notifiers, cannot be performed in the constructor. Instead, they should be performed here. The default implementation does nothing.

Reimplemented from QPlatformIntegration.

Definition at line 342 of file qxcbintegration.cpp.

References connection(), QPlatformInputContextFactory::create(), QWindowSystemInterface::handleThemeChange(), QXcbKeyboard::initialize(), QXcbConnection::keyboard(), QXcbConnection::primaryScreen(), QXcbXSettings::registerCallbackForProperty(), QPlatformInputContextFactory::requested(), QScopedPointer< T, Cleanup >::reset(), QXcbScreen::xSettings(), xsNetCursorBlink, xsNetCursorBlinkTime, xsNetDndDragThreshold, xsNetDoubleClickDistance, and xsNetDoubleClickTime.

+ Here is the call graph for this function:

◆ inputContext()

QPlatformInputContext * QXcbIntegration::inputContext ( ) const
overridevirtual

Returns the platforms input context.

The default implementation returns \nullptr, implying no input method support.

Reimplemented from QPlatformIntegration.

Definition at line 408 of file qxcbintegration.cpp.

References QScopedPointer< T, Cleanup >::data().

+ Here is the call graph for this function:

◆ instance()

◆ keyMapper()

QPlatformKeyMapper * QXcbIntegration::keyMapper ( ) const
overridevirtual

Accessor for the platform integration's key mapper.

Default implementation returns a default QPlatformKeyMapper.

See also
QPlatformKeyMapper

Reimplemented from QPlatformIntegration.

Definition at line 433 of file qxcbintegration.cpp.

References QXcbConnection::keyboard().

+ Here is the call graph for this function:

◆ moveToScreen()

void QXcbIntegration::moveToScreen ( QWindow * window,
int screen )

Definition at line 369 of file qxcbintegration.cpp.

References Q_UNUSED, screen, and window().

+ Here is the call graph for this function:

◆ nativeInterface()

QPlatformNativeInterface * QXcbIntegration::nativeInterface ( ) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 380 of file qxcbintegration.cpp.

References QScopedPointer< T, Cleanup >::data().

+ Here is the call graph for this function:

◆ nativePaintingEnabled()

bool QXcbIntegration::nativePaintingEnabled ( ) const

Definition at line 576 of file qxcbintegration.cpp.

References enabled, and qEnvironmentVariableIsSet().

Referenced by QXcbIntegration(), createPlatformBackingStore(), and createPlatformPixmap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ services()

QPlatformServices * QXcbIntegration::services ( ) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 428 of file qxcbintegration.cpp.

References QScopedPointer< T, Cleanup >::data().

Referenced by setApplicationBadge().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setApplicationBadge()

void QXcbIntegration::setApplicationBadge ( qint64 number)
overridevirtual
Since
6.5

Should set the application's badge to number.

If the number is 0 the badge should be cleared.

See also
QGuiApplication::setBadge()

Reimplemented from QPlatformIntegration.

Definition at line 593 of file qxcbintegration.cpp.

References number, services(), and QGenericUnixServices::setApplicationBadge().

+ Here is the call graph for this function:

◆ styleHint()

◆ sync()

void QXcbIntegration::sync ( )
overridevirtual
Since
5.2

Function to sync the platform integrations state with the window system.

This is often implemented as a roundtrip from the platformintegration to the window system.

This function should not call QWindowSystemInterface::flushWindowSystemEvents() or QCoreApplication::processEvents()

Reimplemented from QPlatformIntegration.

Definition at line 557 of file qxcbintegration.cpp.

References QXcbConnection::sync().

+ Here is the call graph for this function:

◆ themeNames()

QStringList QXcbIntegration::themeNames ( ) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 438 of file qxcbintegration.cpp.

References QGenericUnixTheme::themeNames().

+ Here is the call graph for this function:

◆ wmClass()

QByteArray QXcbIntegration::wmClass ( ) const

Definition at line 523 of file qxcbintegration.cpp.

References QCoreApplication::applicationName, argv0BaseName(), className, QString::fromLocal8Bit(), QByteArray::isEmpty(), qEnvironmentVariableIsSet(), qgetenv(), and resourceNameVar.

+ Here is the call graph for this function:

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