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>.
|
#include <qwindowsintegration.h>
Public Member Functions | |
QWindowsIntegration (const QStringList ¶mList) | |
~QWindowsIntegration () override | |
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 |
QPlatformOpenGLContext * | createPlatformOpenGLContext (QOpenGLContext *context) const override |
Factory function for QPlatformOpenGLContext. | |
QOpenGLContext::OpenGLModuleType | openGLModuleType () override |
Platform integration function for querying the OpenGL implementation type. | |
HMODULE | openGLModuleHandle () const override |
QOpenGLContext * | createOpenGLContext (HGLRC context, HWND window, QOpenGLContext *shareContext) const override |
QAbstractEventDispatcher * | createEventDispatcher () const override |
Factory function for the GUI event dispatcher. | |
void | initialize () override |
Performs initialization steps that depend on having an event dispatcher available. | |
QPlatformInputContext * | inputContext () const override |
Returns the platforms input context. | |
QPlatformFontDatabase * | fontDatabase () const override |
Accessor for the platform integration's fontdatabase. | |
QStringList | themeNames () const override |
QPlatformTheme * | createPlatformTheme (const QString &name) const override |
QPlatformServices * | services () const override |
QVariant | styleHint (StyleHint hint) const override |
QPlatformKeyMapper * | keyMapper () const override |
Accessor for the platform integration's key mapper. | |
unsigned | options () const |
void | beep () const override |
void | setApplicationBadge (qint64 number) override |
void | setApplicationBadge (const QImage &image) |
void | updateApplicationBadge () |
Public Member Functions inherited from QPlatformIntegration | |
virtual | ~QPlatformIntegration () |
virtual QPlatformPixmap * | createPlatformPixmap (QPlatformPixmap::PixelType type) const |
Factory function for QPlatformPixmap. | |
virtual QPlatformBackingStore * | createPlatformBackingStore (QWindow *window) const =0 |
Factory function for QPlatformBackingStore. | |
virtual QPlatformSharedGraphicsCache * | createPlatformSharedGraphicsCache (const char *cacheId) const |
Factory function for QPlatformSharedGraphicsCache. | |
virtual QPaintEngine * | createImagePaintEngine (QPaintDevice *paintDevice) const |
Factory function for QPaintEngine. | |
virtual void | destroy () |
Called before the platform integration is deleted. | |
virtual QPlatformClipboard * | clipboard () const |
Accessor for the platform integration's clipboard. | |
virtual QPlatformNativeInterface * | nativeInterface () const |
virtual Qt::WindowState | defaultWindowState (Qt::WindowFlags) 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 void | setApplicationIcon (const QIcon &icon) const |
virtual void | quit () const |
template<auto func, typename... Args> | |
auto | call (Args... args) |
Public Member Functions inherited from QWindowsApplication | |
void | setTouchWindowTouchType (TouchWindowTouchTypes type) override |
TouchWindowTouchTypes | touchWindowTouchType () const override |
WindowActivationBehavior | windowActivationBehavior () const override |
void | setWindowActivationBehavior (WindowActivationBehavior behavior) override |
void | setHasBorderInFullScreenDefault (bool border) override |
bool | isTabletMode () const override |
bool | isWinTabEnabled () const override |
bool | setWinTabEnabled (bool enabled) override |
DarkModeHandling | darkModeHandling () const override |
void | setDarkModeHandling (DarkModeHandling handling) override |
void | registerMime (QWindowsMimeConverter *mime) override |
void | unregisterMime (QWindowsMimeConverter *mime) override |
int | registerMimeType (const QString &mime) override |
HWND | createMessageWindow (const QString &classNameTemplate, const QString &windowName, QFunctionPointer eventProc=nullptr) const override |
bool | asyncExpose () const override |
void | setAsyncExpose (bool value) override |
QVariant | gpu () const override |
QVariant | gpuList () const override |
void | populateLightSystemPalette (QPalette &palette) const override |
Static Public Member Functions | |
static QWindowsStaticOpenGLContext * | staticOpenGLContext () |
static QWindowsIntegration * | instance () |
Protected Member Functions | |
virtual QWindowsWindow * | createPlatformWindowHelper (QWindow *window, const QWindowsWindowData &) const |
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 | |
Definition at line 25 of file qwindowsintegration.h.
Definition at line 33 of file qwindowsintegration.h.
|
explicit |
Definition at line 240 of file qwindowsintegration.cpp.
References DetectAltGrModifier, QWindowsScreenManager::initialize(), QWindowsIntegrationPrivate::m_context, QWindowsIntegrationPrivate::m_options, QWindowsIntegrationPrivate::parseOptions(), QWindowsContext::screenManager(), and QWindowsContext::setDetectAltGrModifier().
|
override |
Definition at line 252 of file qwindowsintegration.cpp.
|
overridevirtual |
Should sound a bell, using the default volume and sound.
Reimplemented from QPlatformIntegration.
Definition at line 609 of file qwindowsintegration.cpp.
|
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 587 of file qwindowsintegration.cpp.
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 344 of file qwindowsintegration.cpp.
References Qt::dec(), Qt::hex(), Qt::noshowbase(), qCDebug, qWarning, screen, Qt::showbase(), and window().
|
override |
Definition at line 452 of file qwindowsintegration.cpp.
References context, QOpenGLContextPrivate::get(), staticOpenGLContext(), and window().
|
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 422 of file qwindowsintegration.cpp.
References context, qCDebug, and staticOpenGLContext().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 597 of file qwindowsintegration.cpp.
References QPlatformIntegration::createPlatformTheme(), and QWindowsTheme::name.
|
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 297 of file qwindowsintegration.cpp.
References QWindowsWindowData::create(), createPlatformWindowHelper(), QWindowsWindowData::customMargins, Qt::dec(), Qt::Desktop, QWindowsWindow::DisableNonClientScaling, QWindowsWindowData::flags, QWindowsWindow::formatWindowTitle(), Qt::FramelessWindowHint, QWindowsWindowData::geometry, Qt::hex(), QWindowsMenuBar::menuBarOf(), Qt::noshowbase(), QWindowsGeometryHint::positionIncludesFrame(), Q_ASSERT, Q_UNLIKELY, qCDebug, QWindowsContext::shouldHaveNonClientDpiScaling(), Qt::showbase(), QHighDpi::toNativeLocalPosition(), QHighDpi::toNativePixels(), and window().
|
protectedvirtual |
Reimplemented in QWindowsDirect2DIntegration.
Definition at line 364 of file qwindowsintegration.cpp.
References window().
Referenced by createPlatformWindow().
|
overridevirtual |
Accessor for the platform integration's fontdatabase.
Default implementation returns a default QPlatformFontDatabase.
Reimplemented from QPlatformIntegration.
Definition at line 484 of file qwindowsintegration.cpp.
References DontUseDirectWriteFonts, FontDatabaseFreeType, FontDatabaseGDI, QWindowsIntegrationPrivate::m_fontDatabase, and QWindowsIntegrationPrivate::m_options.
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 264 of file qwindowsintegration.cpp.
References QPlatformIntegration::AllGLFunctionsQueryable, QPlatformIntegration::BackingStoreStaticContents, QPlatformIntegration::ForeignWindows, QPlatformIntegration::hasCapability(), QPlatformIntegration::MultipleWindows, QPlatformIntegration::OpenGL, QPlatformIntegration::RasterGLSurface, staticOpenGLContext(), QPlatformIntegration::SwitchableWidgetComposition, QPlatformIntegration::ThreadedOpenGL, QPlatformIntegration::ThreadedPixmaps, and QPlatformIntegration::WindowMasks.
|
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 257 of file qwindowsintegration.cpp.
References QPlatformInputContextFactory::create(), QWindowsIntegrationPrivate::m_inputContext, 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 563 of file qwindowsintegration.cpp.
References QScopedPointer< T, Cleanup >::data(), and QWindowsIntegrationPrivate::m_inputContext.
|
inlinestatic |
Definition at line 87 of file qwindowsintegration.h.
Referenced by QWindowsGLContext::QWindowsGLContext(), QWindowsDialogs::createHelper(), doUseNativeMenus(), WindowCreationData::fromWindow(), QWindowsTheme::handleSettingsChanged(), QWindowsContext::initTouch(), QWindowsDirect2DIntegration::instance(), QWindowsDrag::instance(), QWindowsWindow::registerTouchWindow(), QWindowsWindow::requestActivateWindow(), shouldApplyDarkFrame(), staticOpenGLContext(), QWindowsMouseHandler::translateMouseEvent(), QWindowsPointerHandler::translateMouseEvent(), QWindowsDialogs::useHelper(), windowsInputContext(), and QWindowsContext::windowsProc().
|
overridevirtual |
Accessor for the platform integration's key mapper.
Default implementation returns a default QPlatformKeyMapper.
Reimplemented from QPlatformIntegration.
Definition at line 545 of file qwindowsintegration.cpp.
References QWindowsContext::keyMapper(), and QWindowsIntegrationPrivate::m_context.
|
override |
Definition at line 444 of file qwindowsintegration.cpp.
References staticOpenGLContext().
|
overridevirtual |
Platform integration function for querying the OpenGL implementation type.
Used only when dynamic OpenGL implementation loading is enabled.
Subclasses should reimplement this function and return a value based on the OpenGL implementation they have chosen to load.
Reimplemented from QPlatformIntegration.
Definition at line 433 of file qwindowsintegration.cpp.
References QOpenGLContext::LibGL, and staticOpenGLContext().
unsigned QWindowsIntegration::options | ( | ) | const |
Definition at line 575 of file qwindowsintegration.cpp.
References QWindowsIntegrationPrivate::m_options.
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 604 of file qwindowsintegration.cpp.
References QWindowsIntegrationPrivate::m_services.
Definition at line 722 of file qwindowsintegration.cpp.
References QGuiApplication::topLevelWindows().
Should set the application's badge to number.
If the number is 0 the badge should be cleared.
Reimplemented from QPlatformIntegration.
Definition at line 614 of file qwindowsintegration.cpp.
References Qt::AlignCenter, QPainter::Antialiasing, Qt::black, QOperatingSystemVersionBase::current(), Qt::Dark, QFont::DemiBold, QPainter::drawEllipse(), QPainter::drawText(), QPainter::end(), QPainter::font(), font, QImage::Format_ARGB32_Premultiplied, QWindowsTheme::instance(), isDarkMode(), QFont::Medium, Qt::NoPen, number, QString::number(), painter, qApp, qCeil(), qMax(), QT_CATCH, QT_TRY, qt_win_hasPackageIdentity(), QColor::setAlphaF(), setApplicationBadge(), QPainter::setBrush(), QPainter::setFont(), QPainter::setPen(), QFont::setPixelSize(), QPainter::setRenderHint(), settings, QFont::setWeight(), text, QPainter::TextAntialiasing, QPainter::translate(), Qt::transparent, Qt::white, and QOperatingSystemVersion::Windows11.
Referenced by setApplicationBadge(), and updateApplicationBadge().
|
static |
Definition at line 471 of file qwindowsintegration.cpp.
References QWindowsStaticOpenGLContext::create(), d, QScopedPointer< T, Cleanup >::data(), instance(), and lock.
Referenced by createOpenGLContext(), createPlatformOpenGLContext(), hasCapability(), QWindowsWindow::invalidateSurface(), QWindowsNativeInterface::nativeResourceForIntegration(), openGLModuleHandle(), openGLModuleType(), and QWindowsWindow::surface().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 512 of file qwindowsintegration.cpp.
References QPlatformIntegration::CursorFlashTime, QPlatformIntegration::FontSmoothingGamma, QWindowsFontDatabase::fontSmoothingGamma(), hint(), QPlatformIntegration::KeyboardAutoRepeatRate, QPlatformIntegration::KeyboardInputInterval, QWindowsIntegrationPrivate::m_context, QPlatformIntegration::MouseDoubleClickInterval, QPlatformIntegration::PasswordMaskDelay, QPlatformIntegration::ShowIsFullScreen, QPlatformIntegration::ShowIsMaximized, QPlatformIntegration::StartDragDistance, QPlatformIntegration::StartDragTime, QPlatformIntegration::StartDragVelocity, QPlatformIntegration::styleHint(), QPlatformIntegration::UseRtlExtensions, and QWindowsContext::useRTLExtensions().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 592 of file qwindowsintegration.cpp.
References QWindowsTheme::name.
void QWindowsIntegration::updateApplicationBadge | ( | ) |
Definition at line 759 of file qwindowsintegration.cpp.
References setApplicationBadge().