![]() |
Qt 6.x
The Qt SDK
|
#include <qandroidplatformintegration.h>
Public Member Functions | |
QAndroidPlatformIntegration (const QStringList ¶mList) | |
~QAndroidPlatformIntegration () | |
void | initialize () override |
Performs initialization steps that depend on having an event dispatcher available. | |
bool | hasCapability (QPlatformIntegration::Capability cap) const override |
QPlatformWindow * | createPlatformWindow (QWindow *window) const override |
Factory function for QPlatformWindow. | |
QPlatformWindow * | createForeignWindow (QWindow *window, WId nativeHandle) const override |
QPlatformBackingStore * | createPlatformBackingStore (QWindow *window) const override |
Factory function for QPlatformBackingStore. | |
QPlatformOpenGLContext * | createPlatformOpenGLContext (QOpenGLContext *context) const override |
Factory function for QPlatformOpenGLContext. | |
QOpenGLContext * | createOpenGLContext (EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override |
QAbstractEventDispatcher * | createEventDispatcher () const override |
Factory function for the GUI event dispatcher. | |
QAndroidPlatformScreen * | screen () |
QPlatformOffscreenSurface * | createPlatformOffscreenSurface (QOffscreenSurface *surface) const override |
Factory function for QOffscreenSurface. | |
QOffscreenSurface * | createOffscreenSurface (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 () |
QPlatformFontDatabase * | fontDatabase () const override |
Accessor for the platform integration's fontdatabase. | |
void | handleScreenAdded (int displayId) |
void | handleScreenChanged (int displayId) |
void | handleScreenRemoved (int displayId) |
QPlatformClipboard * | clipboard () const override |
Accessor for the platform integration's clipboard. | |
QPlatformInputContext * | inputContext () const override |
Returns the platforms input context. | |
QPlatformNativeInterface * | nativeInterface () const override |
QPlatformServices * | services () const override |
QVariant | styleHint (StyleHint hint) const override |
Qt::WindowState | defaultWindowState (Qt::WindowFlags flags) const override |
QStringList | themeNames () const override |
QPlatformTheme * | createPlatformTheme (const QString &name) const override |
QPointingDevice * | touchDevice () const |
void | setTouchDevice (QPointingDevice *touchDevice) |
void | flushPendingUpdates () |
![]() | |
virtual | ~QPlatformIntegration () |
virtual bool | hasCapability (Capability cap) const |
virtual QPlatformPixmap * | createPlatformPixmap (QPlatformPixmap::PixelType type) const |
Factory function for QPlatformPixmap. | |
virtual QPlatformWindow * | createPlatformWindow (QWindow *window) const =0 |
Factory function for QPlatformWindow. | |
virtual QPlatformWindow * | createForeignWindow (QWindow *, WId) const |
virtual QPlatformBackingStore * | createPlatformBackingStore (QWindow *window) const =0 |
Factory function for QPlatformBackingStore. | |
virtual QPlatformOpenGLContext * | createPlatformOpenGLContext (QOpenGLContext *context) const |
Factory function for QPlatformOpenGLContext. | |
virtual QPlatformSharedGraphicsCache * | createPlatformSharedGraphicsCache (const char *cacheId) const |
Factory function for QPlatformSharedGraphicsCache. | |
virtual QPaintEngine * | createImagePaintEngine (QPaintDevice *paintDevice) const |
Factory function for QPaintEngine. | |
virtual QAbstractEventDispatcher * | createEventDispatcher () 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 QPlatformFontDatabase * | fontDatabase () const |
Accessor for the platform integration's fontdatabase. | |
virtual QPlatformClipboard * | clipboard () const |
Accessor for the platform integration's clipboard. | |
virtual QPlatformInputContext * | inputContext () const |
Returns the platforms input context. | |
virtual QPlatformNativeInterface * | nativeInterface () const |
virtual QPlatformServices * | services () 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 QPlatformTheme * | createPlatformTheme (const QString &name) const |
virtual QPlatformOffscreenSurface * | createPlatformOffscreenSurface (QOffscreenSurface *surface) const |
Factory function for QOffscreenSurface. | |
virtual QPlatformSessionManager * | createPlatformSessionManager (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 |
Definition at line 42 of file qandroidplatformintegration.h.
QAndroidPlatformIntegration::QAndroidPlatformIntegration | ( | const QStringList & | paramList | ) |
Definition at line 166 of file qandroidplatformintegration.cpp.
References QtAndroid::activity(), QInputDevice::Area, QThread::currentThread(), defaultScreen, QPointingDevice::Finger, QWindowSystemInterface::handleScreenAdded(), i, QInputDevice::NormalizedPosition, ok, QInputDevice::Position, QCoreApplication::postEvent(), QInputDevice::Pressure, Q_ASSERT, Q_UNLIKELY, Q_UNUSED, QAndroidPlatformScreen, qFatal, QWindowSystemInterface::registerInputDevice(), screen(), QtAndroid::service(), QInputDevice::TouchScreen, and QEvent::User.
QAndroidPlatformIntegration::~QAndroidPlatformIntegration | ( | ) |
Definition at line 405 of file qandroidplatformintegration.cpp.
References QtAndroid::setAndroidPlatformIntegration().
|
overridevirtual |
Accessor for the platform integration's clipboard.
Default implementation returns a default QPlatformClipboard.
Reimplemented from QPlatformIntegration.
Definition at line 427 of file qandroidplatformintegration.cpp.
|
inlinestatic |
Definition at line 114 of file qandroidplatformintegration.h.
Referenced by QAndroidPlatformTheme::colorScheme(), AndroidStyle::loadStyleData(), and setColorScheme().
|
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.
Implements QPlatformIntegration.
Definition at line 400 of file qandroidplatformintegration.cpp.
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 395 of file qandroidplatformintegration.cpp.
References window().
|
override |
Definition at line 371 of file qandroidplatformintegration.cpp.
References QtAndroid::activity(), and QOffscreenSurfacePrivate::get().
|
override |
Definition at line 352 of file qandroidplatformintegration.cpp.
References context.
|
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.
Implements QPlatformIntegration.
Definition at line 331 of file qandroidplatformintegration.cpp.
References QtAndroid::activity(), and window().
|
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().
|
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.
Reimplemented from QPlatformIntegration.
Definition at line 339 of file qandroidplatformintegration.cpp.
References QtAndroid::activity(), and context.
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 476 of file qandroidplatformintegration.cpp.
References androidThemeName, and QAndroidPlatformTheme::instance().
|
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.
Implements QPlatformIntegration.
Definition at line 382 of file qandroidplatformintegration.cpp.
References QtAndroid::activity(), QSurface::VulkanSurface, and window().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 461 of file qandroidplatformintegration.cpp.
References QPlatformIntegration::defaultWindowState(), Qt::Dialog, Qt::Window, and Qt::WindowNoState.
void QAndroidPlatformIntegration::flushPendingUpdates | ( | ) |
Definition at line 502 of file qandroidplatformintegration.cpp.
References QAndroidPlatformScreen::setSizeParameters().
Referenced by QAndroidPlatformNativeInterface::customEvent().
|
overridevirtual |
Accessor for the platform integration's fontdatabase.
Default implementation returns a default QPlatformFontDatabase.
Reimplemented from QPlatformIntegration.
Definition at line 421 of file qandroidplatformintegration.cpp.
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().
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().
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().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 314 of file qandroidplatformintegration.cpp.
References QtAndroid::activity(), QPlatformIntegration::ApplicationState, QPlatformIntegration::ForeignWindows, QPlatformIntegration::hasCapability(), QPlatformIntegration::MaximizeUsingFullscreenGeometry, QPlatformIntegration::NativeWidgets, needsBasicRenderloopWorkaround(), QPlatformIntegration::OpenGL, QPlatformIntegration::RasterGLSurface, QPlatformIntegration::ThreadedOpenGL, QPlatformIntegration::ThreadedPixmaps, and QPlatformIntegration::TopStackedNativeChildWindows.
|
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().
|
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().
|
inline |
Definition at line 76 of file qandroidplatformintegration.h.
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 438 of file qandroidplatformintegration.cpp.
|
inline |
Definition at line 62 of file qandroidplatformintegration.h.
Referenced by QAndroidPlatformIntegration(), handleOrientationChanged(), QAndroidPlatformTheme::themeHint(), QtAndroid::topLevelWindowAt(), QAndroidInputContext::updateSelectionHandles(), and updateWindow().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 443 of file qandroidplatformintegration.cpp.
Definition at line 517 of file qandroidplatformintegration.cpp.
References Qt::AutoConnection, QMetaObject::invokeMethod(), and Q_ARG.
|
static |
Definition at line 537 of file qandroidplatformintegration.cpp.
References colorScheme(), QAndroidPlatformTheme::instance(), QMetaObject::invokeMethod(), qGuiApp, and QAndroidPlatformTheme::updateColorScheme().
Referenced by handleUiDarkModeChanged().
|
static |
Definition at line 484 of file qandroidplatformintegration.cpp.
Referenced by setDisplayMetrics().
void QAndroidPlatformIntegration::setPhysicalSize | ( | int | width, |
int | height | ||
) |
Definition at line 523 of file qandroidplatformintegration.cpp.
References Qt::AutoConnection, QMetaObject::invokeMethod(), and Q_ARG.
Definition at line 558 of file qandroidplatformintegration.cpp.
References Qt::AutoConnection, QMetaObject::invokeMethod(), and Q_ARG.
Referenced by handleRefreshRateChanged(), and setDisplayMetrics().
|
static |
Definition at line 495 of file qandroidplatformintegration.cpp.
Referenced by handleOrientationChanged().
void QAndroidPlatformIntegration::setScreenSize | ( | int | width, |
int | height | ||
) |
Definition at line 529 of file qandroidplatformintegration.cpp.
References Qt::AutoConnection, QMetaObject::invokeMethod(), and Q_ARG.
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().
|
inline |
Definition at line 109 of file qandroidplatformintegration.h.
References touchDevice().
Referenced by QtAndroidInput::getTouchDevice().
Reimplemented from QPlatformIntegration.
Definition at line 448 of file qandroidplatformintegration.cpp.
References hint(), QPlatformIntegration::PasswordMaskDelay, QPlatformIntegration::ShowIsMaximized, and QPlatformIntegration::styleHint().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 471 of file qandroidplatformintegration.cpp.
References androidThemeName.
|
inline |
Definition at line 108 of file qandroidplatformintegration.h.
Referenced by QtAndroidInput::getTouchDevice(), and setTouchDevice().
|
friend |
Definition at line 46 of file qandroidplatformintegration.h.
Referenced by QAndroidPlatformIntegration().