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
qplatformintegration.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
6#include <qpa/qplatformfontdatabase.h>
7#include <qpa/qplatformclipboard.h>
8#include <qpa/qplatformaccessibility.h>
9#include <qpa/qplatformkeymapper.h>
10#include <qpa/qplatformtheme.h>
11#include <QtGui/private/qguiapplication_p.h>
12#include <QtGui/private/qpixmap_raster_p.h>
13
14#if QT_CONFIG(draganddrop)
15#include <private/qdnd_p.h>
16#include <private/qsimpledrag_p.h>
17#endif
18
19#ifndef QT_NO_SESSIONMANAGER
20# include <qpa/qplatformsessionmanager.h>
21#endif
22
24
33{
34 static QPlatformFontDatabase *db = nullptr;
35 if (!db) {
37 }
38 return db;
39}
40
50#ifndef QT_NO_CLIPBOARD
51
53{
54 static QPlatformClipboard *clipboard = nullptr;
55 if (!clipboard) {
57 }
58 return clipboard;
59}
60
61#endif
62
63#if QT_CONFIG(draganddrop)
70QPlatformDrag *QPlatformIntegration::drag() const
71{
72 static QSimpleDrag *drag = nullptr;
73 if (!drag) {
74 drag = new QSimpleDrag;
75 }
76 return drag;
77}
78#endif // QT_CONFIG(draganddrop)
79
84
86{
87 return nullptr;
88}
89
264
269
270#ifndef QT_NO_OPENGL
291{
293 qWarning("This plugin does not support createPlatformOpenGLContext!");
294 return nullptr;
295}
296#endif // QT_NO_OPENGL
297
303{
304 qWarning("This plugin does not support createPlatformSharedGraphicsBuffer for cacheId: %s!",
305 cacheId);
306 return nullptr;
307}
308
314{
315 Q_UNUSED(paintDevice);
316 return nullptr;
317}
318
330
340
347{
348 return nullptr;
349}
350
365
366#if QT_CONFIG(accessibility)
367
374QPlatformAccessibility *QPlatformIntegration::accessibility() const
375{
376 static QPlatformAccessibility *accessibility = nullptr;
377 if (Q_UNLIKELY(!accessibility)) {
378 accessibility = new QPlatformAccessibility;
379 }
380 return accessibility;
381}
382
383#endif
384
386{
387 switch (hint) {
388 case CursorFlashTime:
398 case StartDragTime:
400 case ShowIsFullScreen:
401 return false;
402 case ShowIsMaximized:
403 return false;
411 return qreal(1.7);
414 case UseRtlExtensions:
415 return QVariant(false);
420 case TabFocusBehavior:
423 return true;
426 case UiEffects:
428 case WheelScrollLines:
441 return true;
442 }
443
444 return 0;
445}
446
448{
449 // Leave popup-windows as is
450 if (flags & Qt::Popup & ~Qt::Window)
451 return Qt::WindowNoState;
452
453 if (flags & Qt::SubWindow)
454 return Qt::WindowNoState;
455
459 return Qt::WindowMaximized;
460
461 return Qt::WindowNoState;
462}
463
465{
467}
468
480{
481 return QList<int>();
482}
483
488
494
505
506#ifndef QT_NO_SESSIONMANAGER
517#endif
518
532
541{
542}
543
554{
555 QWindowSystemInterface::handleApplicationTermination<QWindowSystemInterface::SynchronousDelivery>();
556}
557
558#ifndef QT_NO_OPENGL
577{
578 qWarning("This plugin does not support dynamic OpenGL loading!");
580}
581#endif
582
594
608
609#if QT_CONFIG(vulkan) || defined(Q_QDOC)
610
622QPlatformVulkanInstance *QPlatformIntegration::createPlatformVulkanInstance(QVulkanInstance *instance) const
623{
624 Q_UNUSED(instance);
625 qWarning("This plugin does not support createPlatformVulkanInstance");
626 return nullptr;
627}
628
629#endif // QT_CONFIG(vulkan)
630
static Qt::KeyboardModifiers keyboardModifiers()
Returns the current state of the modifier keys on the keyboard.
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
The QKeyEvent class describes a key event.
Definition qevent.h:424
\inmodule QtGui
\inmodule QtGui
OpenGLModuleType
This enum defines the type of the underlying OpenGL implementation.
\inmodule QtGui
The QPlatformClipboard class provides an abstraction for the system clipboard.
The QPlatformDrag class provides an abstraction for drag.
The QPlatformFontDatabase class makes it possible to customize how fonts are discovered and how they ...
The QPlatformInputContext class abstracts the input method dependent data and composing state.
virtual QPlatformPixmap * createPlatformPixmap(QPlatformPixmap::PixelType type) const
Factory function for QPlatformPixmap.
virtual QPlatformSessionManager * createPlatformSessionManager(const QString &id, const QString &key) const
virtual QStringList themeNames() const
virtual QVariant styleHint(StyleHint hint) const
virtual Qt::WindowState defaultWindowState(Qt::WindowFlags) const
virtual QPlatformSharedGraphicsCache * createPlatformSharedGraphicsCache(const char *cacheId) const
Factory function for QPlatformSharedGraphicsCache.
virtual bool hasCapability(Capability cap) const
virtual void setApplicationBadge(qint64 number)
virtual QPlatformOpenGLContext * createPlatformOpenGLContext(QOpenGLContext *context) const
Factory function for QPlatformOpenGLContext.
virtual QPlatformOffscreenSurface * createPlatformOffscreenSurface(QOffscreenSurface *surface) const
Factory function for QOffscreenSurface.
virtual QPaintEngine * createImagePaintEngine(QPaintDevice *paintDevice) const
Factory function for QPaintEngine.
virtual QOpenGLContext::OpenGLModuleType openGLModuleType()
Platform integration function for querying the OpenGL implementation type.
virtual QPlatformClipboard * clipboard() const
Accessor for the platform integration's clipboard.
virtual QPlatformInputContext * inputContext() const
Returns the platforms input context.
virtual void setApplicationIcon(const QIcon &icon) const
virtual QPlatformKeyMapper * keyMapper() const
Accessor for the platform integration's key mapper.
virtual Qt::KeyboardModifiers queryKeyboardModifiers() const
virtual QPlatformServices * services() const
virtual QPlatformNativeInterface * nativeInterface() const
virtual QPlatformFontDatabase * fontDatabase() const
Accessor for the platform integration's fontdatabase.
virtual QPlatformTheme * createPlatformTheme(const QString &name) const
virtual void quit() const
virtual void beep() const
virtual void initialize()
Performs initialization steps that depend on having an event dispatcher available.
virtual QList< int > possibleKeys(const QKeyEvent *) const
Should be used to obtain a list of possible shortcuts for the given key event.
virtual void destroy()
Called before the platform integration is deleted.
Capability
Capabilities are used to determine specific features of a platform integration.
The QPlatformNativeInterface class provides an abstraction for retrieving native resource handles.
The QPlatformOpenGLContext class provides an abstraction for native GL contexts.
The QPlatformPixmap class provides an abstraction for native pixmaps.
The QPlatformServices provides the backend for desktop-related functionality.
The QPlatformSharedGraphicsCache is an abstraction of a cross-process graphics cache.
The QPlatformTheme class allows customizing the UI based on themes.
static QVariant defaultThemeHint(ThemeHint hint)
@ ItemViewActivateItemOnSingleClick
The QPlatformVulkanInstance class provides an abstraction for Vulkan instances.
QSimpleDrag implements QBasicDrag for Drag and Drop operations within the Qt Application itself.
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
The QVulkanInstance class represents a native Vulkan instance, enabling Vulkan rendering onto a QSurf...
Combined button and popup list for selecting options.
WindowState
Definition qnamespace.h:251
@ WindowFullScreen
Definition qnamespace.h:255
@ WindowNoState
Definition qnamespace.h:252
@ WindowMaximized
Definition qnamespace.h:254
@ Popup
Definition qnamespace.h:211
@ Window
Definition qnamespace.h:207
@ SubWindow
Definition qnamespace.h:216
static void * context
#define Q_UNLIKELY(x)
QList< QString > QStringList
Constructs a string list that contains the given string, str.
#define qWarning
Definition qlogging.h:166
GLuint64 key
GLenum type
GLbitfield flags
GLuint name
GLenum cap
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define Q_UNUSED(x)
long long qint64
Definition qtypes.h:60
double qreal
Definition qtypes.h:187
QMimeDatabase db
[0]
QT_BEGIN_NAMESPACE bool toBool(const QString &str)
Definition utils.h:14