Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QAndroidPlatformIntegration Class Reference

#include <qandroidplatformintegration.h>

+ Inheritance diagram for QAndroidPlatformIntegration:
+ Collaboration diagram for QAndroidPlatformIntegration:

Public Member Functions

 QAndroidPlatformIntegration (const QStringList &paramList)
 
 ~QAndroidPlatformIntegration ()
 
void initialize () override
 Performs initialization steps that depend on having an event dispatcher available.
 
bool hasCapability (QPlatformIntegration::Capability cap) const override
 
QPlatformWindowcreatePlatformWindow (QWindow *window) const override
 Factory function for QPlatformWindow.
 
QPlatformWindowcreateForeignWindow (QWindow *window, WId nativeHandle) const override
 
QPlatformBackingStorecreatePlatformBackingStore (QWindow *window) const override
 Factory function for QPlatformBackingStore.
 
QPlatformOpenGLContextcreatePlatformOpenGLContext (QOpenGLContext *context) const override
 Factory function for QPlatformOpenGLContext.
 
QOpenGLContextcreateOpenGLContext (EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override
 
QAbstractEventDispatchercreateEventDispatcher () const override
 Factory function for the GUI event dispatcher.
 
QAndroidPlatformScreenscreen ()
 
QPlatformOffscreenSurfacecreatePlatformOffscreenSurface (QOffscreenSurface *surface) const override
 Factory function for QOffscreenSurface.
 
QOffscreenSurfacecreateOffscreenSurface (ANativeWindow *nativeSurface) const override
 
void setAvailableGeometry (const QRect &availableGeometry)
 
void setPhysicalSize (int width, int height)
 
void setScreenSize (int width, int height)
 
void setScreenSizeParameters (const QSize &physicalSize, const QSize &screenSize, const QRect &availableGeometry)
 
void setRefreshRate (qreal refreshRate)
 
bool isVirtualDesktop ()
 
QPlatformFontDatabasefontDatabase () const override
 Accessor for the platform integration's fontdatabase.
 
void handleScreenAdded (int displayId)
 
void handleScreenChanged (int displayId)
 
void handleScreenRemoved (int displayId)
 
QPlatformClipboardclipboard () const override
 Accessor for the platform integration's clipboard.
 
QPlatformInputContextinputContext () const override
 Returns the platforms input context.
 
QPlatformNativeInterfacenativeInterface () const override
 
QPlatformServicesservices () const override
 
QVariant styleHint (StyleHint hint) const override
 
Qt::WindowState defaultWindowState (Qt::WindowFlags flags) const override
 
QStringList themeNames () const override
 
QPlatformThemecreatePlatformTheme (const QString &name) const override
 
QPointingDevicetouchDevice () const
 
void setTouchDevice (QPointingDevice *touchDevice)
 
void flushPendingUpdates ()
 
- Public Member Functions inherited from QPlatformIntegration
virtual ~QPlatformIntegration ()
 
virtual bool hasCapability (Capability cap) const
 
virtual QPlatformPixmapcreatePlatformPixmap (QPlatformPixmap::PixelType type) const
 Factory function for QPlatformPixmap.
 
virtual QPlatformWindowcreatePlatformWindow (QWindow *window) const =0
 Factory function for QPlatformWindow.
 
virtual QPlatformWindowcreateForeignWindow (QWindow *, WId) const
 
virtual QPlatformBackingStorecreatePlatformBackingStore (QWindow *window) const =0
 Factory function for QPlatformBackingStore.
 
virtual QPlatformOpenGLContextcreatePlatformOpenGLContext (QOpenGLContext *context) const
 Factory function for QPlatformOpenGLContext.
 
virtual QPlatformSharedGraphicsCachecreatePlatformSharedGraphicsCache (const char *cacheId) const
 Factory function for QPlatformSharedGraphicsCache.
 
virtual QPaintEnginecreateImagePaintEngine (QPaintDevice *paintDevice) const
 Factory function for QPaintEngine.
 
virtual QAbstractEventDispatchercreateEventDispatcher () const =0
 Factory function for the GUI event dispatcher.
 
virtual void initialize ()
 Performs initialization steps that depend on having an event dispatcher available.
 
virtual void destroy ()
 Called before the platform integration is deleted.
 
virtual QPlatformFontDatabasefontDatabase () const
 Accessor for the platform integration's fontdatabase.
 
virtual QPlatformClipboardclipboard () const
 Accessor for the platform integration's clipboard.
 
virtual QPlatformInputContextinputContext () const
 Returns the platforms input context.
 
virtual QPlatformNativeInterfacenativeInterface () const
 
virtual QPlatformServicesservices () const
 
virtual QVariant styleHint (StyleHint hint) const
 
virtual Qt::WindowState defaultWindowState (Qt::WindowFlags) const
 
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.
 
virtual QStringList themeNames () const
 
virtual QPlatformThemecreatePlatformTheme (const QString &name) const
 
virtual QPlatformOffscreenSurfacecreatePlatformOffscreenSurface (QOffscreenSurface *surface) const
 Factory function for QOffscreenSurface.
 
virtual QPlatformSessionManagercreatePlatformSessionManager (const QString &id, const QString &key) const
 
virtual void sync ()
 
virtual QOpenGLContext::OpenGLModuleType openGLModuleType ()
 Platform integration function for querying the OpenGL implementation type.
 
virtual void setApplicationIcon (const QIcon &icon) const
 
virtual void setApplicationBadge (qint64 number)
 
virtual void beep () const
 
virtual void quit () const
 
template<auto func, typename... Args>
auto call (Args... args)
 

Static Public Member Functions

static void setDefaultDisplayMetrics (int availableLeft, int availableTop, int availableWidth, int availableHeight, int physicalWidth, int physicalHeight, int screenWidth, int screenHeight)
 
static void setScreenOrientation (Qt::ScreenOrientation currentOrientation, Qt::ScreenOrientation nativeOrientation)
 
static void setColorScheme (Qt::ColorScheme colorScheme)
 
static Qt::ColorScheme colorScheme ()
 

Friends

class QAndroidPlatformScreen
 

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
}
 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
 QPlatformIntegration ()=default
 

Detailed Description

Definition at line 42 of file qandroidplatformintegration.h.

Constructor & Destructor Documentation

◆ QAndroidPlatformIntegration()

QAndroidPlatformIntegration::QAndroidPlatformIntegration ( const QStringList paramList)

◆ ~QAndroidPlatformIntegration()

QAndroidPlatformIntegration::~QAndroidPlatformIntegration ( )

Definition at line 405 of file qandroidplatformintegration.cpp.

References QtAndroid::setAndroidPlatformIntegration().

+ Here is the call graph for this function:

Member Function Documentation

◆ clipboard()

QPlatformClipboard * QAndroidPlatformIntegration::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 427 of file qandroidplatformintegration.cpp.

◆ colorScheme()

static Qt::ColorScheme QAndroidPlatformIntegration::colorScheme ( )
inlinestatic

Definition at line 114 of file qandroidplatformintegration.h.

Referenced by QAndroidPlatformTheme::colorScheme(), AndroidStyle::loadStyleData(), and setColorScheme().

+ Here is the caller graph for this function:

◆ createEventDispatcher()

QAbstractEventDispatcher * QAndroidPlatformIntegration::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 400 of file qandroidplatformintegration.cpp.

◆ createForeignWindow()

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

Reimplemented from QPlatformIntegration.

Definition at line 395 of file qandroidplatformintegration.cpp.

References window().

+ Here is the call graph for this function:

◆ createOffscreenSurface()

QOffscreenSurface * QAndroidPlatformIntegration::createOffscreenSurface ( ANativeWindow *  nativeSurface) const
override

Definition at line 371 of file qandroidplatformintegration.cpp.

References QtAndroid::activity(), and QOffscreenSurfacePrivate::get().

+ Here is the call graph for this function:

◆ createOpenGLContext()

QOpenGLContext * QAndroidPlatformIntegration::createOpenGLContext ( EGLContext  context,
EGLDisplay  display,
QOpenGLContext shareContext 
) const
override

Definition at line 352 of file qandroidplatformintegration.cpp.

References context.

◆ createPlatformBackingStore()

QPlatformBackingStore * QAndroidPlatformIntegration::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 331 of file qandroidplatformintegration.cpp.

References QtAndroid::activity(), and window().

+ Here is the call graph for this function:

◆ createPlatformOffscreenSurface()

QPlatformOffscreenSurface * QAndroidPlatformIntegration::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 357 of file qandroidplatformintegration.cpp.

References QtAndroid::activity(), and QOffscreenSurface::requestedFormat().

+ Here is the call graph for this function:

◆ createPlatformOpenGLContext()

QPlatformOpenGLContext * QAndroidPlatformIntegration::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 339 of file qandroidplatformintegration.cpp.

References QtAndroid::activity(), and context.

+ Here is the call graph for this function:

◆ createPlatformTheme()

QPlatformTheme * QAndroidPlatformIntegration::createPlatformTheme ( const QString name) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 476 of file qandroidplatformintegration.cpp.

References androidThemeName, and QAndroidPlatformTheme::instance().

+ Here is the call graph for this function:

◆ createPlatformWindow()

QPlatformWindow * QAndroidPlatformIntegration::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 382 of file qandroidplatformintegration.cpp.

References QtAndroid::activity(), QSurface::VulkanSurface, and window().

+ Here is the call graph for this function:

◆ defaultWindowState()

Qt::WindowState QAndroidPlatformIntegration::defaultWindowState ( Qt::WindowFlags  flags) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 461 of file qandroidplatformintegration.cpp.

References QPlatformIntegration::defaultWindowState(), Qt::Dialog, Qt::Window, and Qt::WindowNoState.

+ Here is the call graph for this function:

◆ flushPendingUpdates()

void QAndroidPlatformIntegration::flushPendingUpdates ( )

Definition at line 502 of file qandroidplatformintegration.cpp.

References QAndroidPlatformScreen::setSizeParameters().

Referenced by QAndroidPlatformNativeInterface::customEvent().

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

◆ fontDatabase()

QPlatformFontDatabase * QAndroidPlatformIntegration::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 421 of file qandroidplatformintegration.cpp.

◆ handleScreenAdded()

void QAndroidPlatformIntegration::handleScreenAdded ( int  displayId)

Definition at line 565 of file qandroidplatformintegration.cpp.

References QWindowSystemInterface::handleScreenAdded(), QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::insert(), it, and qWarning.

Referenced by handleScreenAdded(), and handleScreenChanged().

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

◆ handleScreenChanged()

void QAndroidPlatformIntegration::handleScreenChanged ( int  displayId)

Definition at line 582 of file qandroidplatformintegration.cpp.

References QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::end(), QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::find(), handleScreenAdded(), and it.

Referenced by handleScreenChanged().

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

◆ handleScreenRemoved()

void QAndroidPlatformIntegration::handleScreenRemoved ( int  displayId)

Definition at line 594 of file qandroidplatformintegration.cpp.

References QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::end(), QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::erase(), QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::find(), QWindowSystemInterface::handleScreenRemoved(), and it.

Referenced by handleScreenRemoved().

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

◆ hasCapability()

◆ initialize()

void QAndroidPlatformIntegration::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 305 of file qandroidplatformintegration.cpp.

References QPlatformInputContextFactory::create(), QString::isNull(), QPlatformInputContextFactory::requested(), and QScopedPointer< T, Cleanup >::reset().

+ Here is the call graph for this function:

◆ inputContext()

QPlatformInputContext * QAndroidPlatformIntegration::inputContext ( ) const
overridevirtual

Returns the platforms input context.

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

Reimplemented from QPlatformIntegration.

Definition at line 433 of file qandroidplatformintegration.cpp.

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

+ Here is the call graph for this function:

◆ isVirtualDesktop()

bool QAndroidPlatformIntegration::isVirtualDesktop ( )
inline

Definition at line 76 of file qandroidplatformintegration.h.

◆ nativeInterface()

QPlatformNativeInterface * QAndroidPlatformIntegration::nativeInterface ( ) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 438 of file qandroidplatformintegration.cpp.

◆ screen()

QAndroidPlatformScreen * QAndroidPlatformIntegration::screen ( )
inline

Definition at line 62 of file qandroidplatformintegration.h.

Referenced by QAndroidPlatformIntegration(), handleOrientationChanged(), QAndroidPlatformTheme::themeHint(), QtAndroid::topLevelWindowAt(), QAndroidInputContext::updateSelectionHandles(), and updateWindow().

+ Here is the caller graph for this function:

◆ services()

QPlatformServices * QAndroidPlatformIntegration::services ( ) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 443 of file qandroidplatformintegration.cpp.

◆ setAvailableGeometry()

void QAndroidPlatformIntegration::setAvailableGeometry ( const QRect availableGeometry)

Definition at line 517 of file qandroidplatformintegration.cpp.

References Qt::AutoConnection, QMetaObject::invokeMethod(), and Q_ARG.

+ Here is the call graph for this function:

◆ setColorScheme()

void QAndroidPlatformIntegration::setColorScheme ( Qt::ColorScheme  colorScheme)
static

Definition at line 537 of file qandroidplatformintegration.cpp.

References colorScheme(), QAndroidPlatformTheme::instance(), QMetaObject::invokeMethod(), qGuiApp, and QAndroidPlatformTheme::updateColorScheme().

Referenced by handleUiDarkModeChanged().

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

◆ setDefaultDisplayMetrics()

void QAndroidPlatformIntegration::setDefaultDisplayMetrics ( int  availableLeft,
int  availableTop,
int  availableWidth,
int  availableHeight,
int  physicalWidth,
int  physicalHeight,
int  screenWidth,
int  screenHeight 
)
static

Definition at line 484 of file qandroidplatformintegration.cpp.

Referenced by setDisplayMetrics().

+ Here is the caller graph for this function:

◆ setPhysicalSize()

void QAndroidPlatformIntegration::setPhysicalSize ( int  width,
int  height 
)

Definition at line 523 of file qandroidplatformintegration.cpp.

References Qt::AutoConnection, QMetaObject::invokeMethod(), and Q_ARG.

+ Here is the call graph for this function:

◆ setRefreshRate()

void QAndroidPlatformIntegration::setRefreshRate ( qreal  refreshRate)

Definition at line 558 of file qandroidplatformintegration.cpp.

References Qt::AutoConnection, QMetaObject::invokeMethod(), and Q_ARG.

Referenced by handleRefreshRateChanged(), and setDisplayMetrics().

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

◆ setScreenOrientation()

void QAndroidPlatformIntegration::setScreenOrientation ( Qt::ScreenOrientation  currentOrientation,
Qt::ScreenOrientation  nativeOrientation 
)
static

Definition at line 495 of file qandroidplatformintegration.cpp.

Referenced by handleOrientationChanged().

+ Here is the caller graph for this function:

◆ setScreenSize()

void QAndroidPlatformIntegration::setScreenSize ( int  width,
int  height 
)

Definition at line 529 of file qandroidplatformintegration.cpp.

References Qt::AutoConnection, QMetaObject::invokeMethod(), and Q_ARG.

+ Here is the call graph for this function:

◆ setScreenSizeParameters()

void QAndroidPlatformIntegration::setScreenSizeParameters ( const QSize physicalSize,
const QSize screenSize,
const QRect availableGeometry 
)

Definition at line 547 of file qandroidplatformintegration.cpp.

References Qt::AutoConnection, QMetaObject::invokeMethod(), and Q_ARG.

Referenced by setDisplayMetrics().

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

◆ setTouchDevice()

void QAndroidPlatformIntegration::setTouchDevice ( QPointingDevice touchDevice)
inline

Definition at line 109 of file qandroidplatformintegration.h.

References touchDevice().

Referenced by QtAndroidInput::getTouchDevice().

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

◆ styleHint()

QVariant QAndroidPlatformIntegration::styleHint ( StyleHint  hint) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 448 of file qandroidplatformintegration.cpp.

References hint(), QPlatformIntegration::PasswordMaskDelay, QPlatformIntegration::ShowIsMaximized, and QPlatformIntegration::styleHint().

+ Here is the call graph for this function:

◆ themeNames()

QStringList QAndroidPlatformIntegration::themeNames ( ) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 471 of file qandroidplatformintegration.cpp.

References androidThemeName.

◆ touchDevice()

QPointingDevice * QAndroidPlatformIntegration::touchDevice ( ) const
inline

Definition at line 108 of file qandroidplatformintegration.h.

Referenced by QtAndroidInput::getTouchDevice(), and setTouchDevice().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QAndroidPlatformScreen

friend class QAndroidPlatformScreen
friend

Definition at line 46 of file qandroidplatformintegration.h.

Referenced by QAndroidPlatformIntegration().


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