Qt 6.x
The Qt SDK
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/qplatformtheme.h>
10#include <QtGui/private/qguiapplication_p.h>
11#include <QtGui/private/qpixmap_raster_p.h>
12
13#if QT_CONFIG(draganddrop)
14#include <private/qdnd_p.h>
15#include <private/qsimpledrag_p.h>
16#endif
17
18#ifndef QT_NO_SESSIONMANAGER
19# include <qpa/qplatformsessionmanager.h>
20#endif
21
23
32{
33 static QPlatformFontDatabase *db = nullptr;
34 if (!db) {
36 }
37 return db;
38}
39
49#ifndef QT_NO_CLIPBOARD
50
52{
53 static QPlatformClipboard *clipboard = nullptr;
54 if (!clipboard) {
56 }
57 return clipboard;
58}
59
60#endif
61
62#if QT_CONFIG(draganddrop)
69QPlatformDrag *QPlatformIntegration::drag() const
70{
71 static QSimpleDrag *drag = nullptr;
72 if (!drag) {
73 drag = new QSimpleDrag;
74 }
75 return drag;
76}
77#endif // QT_CONFIG(draganddrop)
78
80{
81 return nullptr;
82}
83
85{
86 return nullptr;
87}
88
253{
257}
258
260{
261 return new QRasterPlatformPixmap(type);
262}
263
264#ifndef QT_NO_OPENGL
285{
287 qWarning("This plugin does not support createPlatformOpenGLContext!");
288 return nullptr;
289}
290#endif // QT_NO_OPENGL
291
297{
298 qWarning("This plugin does not support createPlatformSharedGraphicsBuffer for cacheId: %s!",
299 cacheId);
300 return nullptr;
301}
302
308{
309 Q_UNUSED(paintDevice);
310 return nullptr;
311}
312
322{
323}
324
332{
333}
334
341{
342 return nullptr;
343}
344
345#if QT_CONFIG(accessibility)
346
353QPlatformAccessibility *QPlatformIntegration::accessibility() const
354{
355 static QPlatformAccessibility *accessibility = nullptr;
356 if (Q_UNLIKELY(!accessibility)) {
357 accessibility = new QPlatformAccessibility;
358 }
359 return accessibility;
360}
361
362#endif
363
365{
366 switch (hint) {
367 case CursorFlashTime:
377 case StartDragTime:
379 case ShowIsFullScreen:
380 return false;
381 case ShowIsMaximized:
382 return false;
390 return qreal(1.7);
393 case UseRtlExtensions:
394 return QVariant(false);
399 case TabFocusBehavior:
402 return true;
405 case UiEffects:
407 case WheelScrollLines:
420 return true;
421 }
422
423 return 0;
424}
425
427{
428 // Leave popup-windows as is
429 if (flags & Qt::Popup & ~Qt::Window)
430 return Qt::WindowNoState;
431
432 if (flags & Qt::SubWindow)
433 return Qt::WindowNoState;
434
438 return Qt::WindowMaximized;
439
440 return Qt::WindowNoState;
441}
442
444{
446}
447
459{
460 return QList<int>();
461}
462
464{
465 return QStringList();
466}
467
469{
470 Q_UNUSED(name);
471 return new QPlatformTheme;
472}
473
480{
481 Q_UNUSED(surface);
482 return nullptr;
483}
484
485#ifndef QT_NO_SESSIONMANAGER
493{
494 return new QPlatformSessionManager(id, key);
495}
496#endif
497
509{
510}
511
520{
521}
522
533{
534 QWindowSystemInterface::handleApplicationTermination<QWindowSystemInterface::SynchronousDelivery>();
535}
536
537#ifndef QT_NO_OPENGL
556{
557 qWarning("This plugin does not support dynamic OpenGL loading!");
559}
560#endif
561
570{
571 Q_UNUSED(icon);
572}
573
584{
586}
587
588#if QT_CONFIG(vulkan) || defined(Q_QDOC)
589
601QPlatformVulkanInstance *QPlatformIntegration::createPlatformVulkanInstance(QVulkanInstance *instance) const
602{
603 Q_UNUSED(instance);
604 qWarning("This plugin does not support createPlatformVulkanInstance");
605 return nullptr;
606}
607
608#endif // QT_CONFIG(vulkan)
609
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:423
Definition qlist.h:74
\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 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:127
\inmodule QtCore
Definition qvariant.h:64
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:250
@ WindowFullScreen
Definition qnamespace.h:254
@ WindowNoState
Definition qnamespace.h:251
@ WindowMaximized
Definition qnamespace.h:253
@ Popup
Definition qnamespace.h:210
@ Window
Definition qnamespace.h:206
@ SubWindow
Definition qnamespace.h:215
static void * context
#define Q_UNLIKELY(x)
#define qWarning
Definition qlogging.h:162
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:55
double qreal
Definition qtypes.h:92
QMimeDatabase db
[0]
QT_BEGIN_NAMESPACE bool toBool(const QString &str)
Definition utils.h:14