qplatformintegration.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qplatformintegration.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtGui module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qplatformintegration.h"-
41-
42#include <qpa/qplatformfontdatabase.h>-
43#include <qpa/qplatformclipboard.h>-
44#include <qpa/qplatformaccessibility.h>-
45#include <qpa/qplatformtheme.h>-
46#include <QtGui/private/qguiapplication_p.h>-
47#include <QtGui/private/qpixmap_raster_p.h>-
48#include <private/qdnd_p.h>-
49#include <private/qsimpledrag_p.h>-
50-
51#ifndef QT_NO_SESSIONMANAGER-
52# include <qpa/qplatformsessionmanager.h>-
53#endif-
54-
55QT_BEGIN_NAMESPACE-
56-
57/*!-
58 Accessor for the platform integration's fontdatabase.-
59-
60 Default implementation returns a default QPlatformFontDatabase.-
61-
62 \sa QPlatformFontDatabase-
63*/-
64QPlatformFontDatabase *QPlatformIntegration::fontDatabase() const-
65{-
66 static QPlatformFontDatabase *db = 0;-
67 if (!db) {
!dbDescription
TRUEnever evaluated
FALSEnever evaluated
0
68 db = new QPlatformFontDatabase;-
69 }
never executed: end of block
0
70 return db;
never executed: return db;
0
71}-
72-
73/*!-
74 Accessor for the platform integration's clipboard.-
75-
76 Default implementation returns a default QPlatformClipboard.-
77-
78 \sa QPlatformClipboard-
79-
80*/-
81-
82#ifndef QT_NO_CLIPBOARD-
83-
84QPlatformClipboard *QPlatformIntegration::clipboard() const-
85{-
86 static QPlatformClipboard *clipboard = 0;-
87 if (!clipboard) {
!clipboardDescription
TRUEnever evaluated
FALSEnever evaluated
0
88 clipboard = new QPlatformClipboard;-
89 }
never executed: end of block
0
90 return clipboard;
never executed: return clipboard;
0
91}-
92-
93#endif-
94-
95#ifndef QT_NO_DRAGANDDROP-
96/*!-
97 Accessor for the platform integration's drag object.-
98-
99 Default implementation returns 0, implying no drag and drop support.-
100-
101*/-
102QPlatformDrag *QPlatformIntegration::drag() const-
103{-
104 static QSimpleDrag *drag = 0;-
105 if (!drag) {
!dragDescription
TRUEnever evaluated
FALSEnever evaluated
0
106 drag = new QSimpleDrag;-
107 }
never executed: end of block
0
108 return drag;
never executed: return drag;
0
109}-
110#endif-
111-
112QPlatformNativeInterface * QPlatformIntegration::nativeInterface() const-
113{-
114 return 0;
never executed: return 0;
0
115}-
116-
117QPlatformServices *QPlatformIntegration::services() const-
118{-
119 return 0;
never executed: return 0;
0
120}-
121-
122/*!-
123 \class QPlatformIntegration-
124 \since 4.8-
125 \internal-
126 \preliminary-
127 \ingroup qpa-
128 \brief The QPlatformIntegration class is the entry for WindowSystem specific functionality.-
129-
130 QPlatformIntegration is the single entry point for windowsystem specific functionality when-
131 using the QPA platform. It has factory functions for creating platform specific pixmaps and-
132 windows. The class also controls the font subsystem.-
133-
134 QPlatformIntegration is a singleton class which gets instantiated in the QGuiApplication-
135 constructor. The QPlatformIntegration instance do not have ownership of objects it creates in-
136 functions where the name starts with create. However, functions which don't have a name-
137 starting with create acts as accessors to member variables.-
138-
139 It is not trivial to create or build a platform plugin outside of the Qt source tree. Therefore-
140 the recommended approach for making new platform plugin is to copy an existing plugin inside-
141 the QTSRCTREE/src/plugins/platform and develop the plugin inside the source tree.-
142-
143 The minimal platform integration is the smallest platform integration it is possible to make,-
144 which makes it an ideal starting point for new plugins. For a slightly more advanced plugin,-
145 consider reviewing the directfb plugin, or the testlite plugin.-
146*/-
147-
148/*!-
149 \fn QPlatformPixmap *QPlatformIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const-
150-
151 Factory function for QPlatformPixmap. PixelType can be either PixmapType or BitmapType.-
152 \sa QPlatformPixmap-
153*/-
154-
155/*!-
156 \fn QPlatformWindow *QPlatformIntegration::createPlatformWindow(QWindow *window) const-
157-
158 Factory function for QPlatformWindow. The \a window parameter is a pointer to the window-
159 which the QPlatformWindow is supposed to be created for.-
160-
161 All windows have to have a QPlatformWindow, and it will be created on-demand when the-
162 QWindow is made visible for the first time, or explicitly through calling QWindow::create().-
163-
164 In the constructor, of the QPlatformWindow, the window flags, state, title and geometry-
165 of the \a window should be applied to the underlying window. If the resulting flags or state-
166 differs, the resulting values should be set on the \a window using QWindow::setWindowFlags()-
167 or QWindow::setWindowState(), respectively.-
168-
169 \sa QPlatformWindow, QPlatformWindowFormat-
170 \sa createPlatformBackingStore()-
171*/-
172-
173/*!-
174 \fn QPlatformBackingStore *QPlatformIntegration::createPlatformBackingStore(QWindow *window) const-
175-
176 Factory function for QPlatformBackingStore. The QWindow parameter is a pointer to the-
177 top level widget(tlw) the window surface is created for. A QPlatformWindow is always created-
178 before the QPlatformBackingStore for tlw where the widget also requires a backing store.-
179-
180 \sa QBackingStore-
181 \sa createPlatformWindow()-
182*/-
183-
184/*!-
185 \enum QPlatformIntegration::Capability-
186-
187 Capabilities are used to determing specific features of a platform integration-
188-
189 \value ThreadedPixmaps The platform uses a pixmap implementation that is reentrant-
190 and can be used from multiple threads, like the raster paint engine and QImage based-
191 pixmaps.-
192-
193 \value OpenGL The platform supports OpenGL-
194-
195 \value ThreadedOpenGL The platform supports using OpenGL outside the GUI thread.-
196-
197 \value SharedGraphicsCache The platform supports a shared graphics cache-
198-
199 \value BufferQueueingOpenGL The OpenGL implementation on the platform will queue-
200 up buffers when swapBuffers() is called and block only when its buffer pipeline-
201 is full, rather than block immediately.-
202-
203 \value MultipleWindows The platform supports multiple QWindows, i.e. does some kind-
204 of compositing either client or server side. Some platforms might only support a-
205 single fullscreen window.-
206-
207 \value ApplicationState The platform handles the application state explicitly.-
208 This means that QEvent::ApplicationActivate and QEvent::ApplicationDeativate-
209 will not be posted automatically. Instead, the platform must handle application-
210 state explicitly by using QWindowSystemInterface::handleApplicationStateChanged().-
211 If not set, application state will follow window activation, which is the normal-
212 behavior for desktop platforms.-
213-
214 \value ForeignWindows The platform allows creating QWindows which represent-
215 native windows created by other processes or by using native libraries.-
216-
217 \value NonFullScreenWindows The platform supports top-level windows which do not-
218 fill the screen. The default implementation returns \c true. Returning false for-
219 this will cause all windows, including dialogs and popups, to be resized to fill the-
220 screen.-
221-
222 \value WindowManagement The platform is based on a system that performs window-
223 management. This includes the typical desktop platforms. Can be set to false on-
224 platforms where no window management is available, meaning for example that windows-
225 are never repositioned by the window manager. The default implementation returns \c true.-
226-
227 \value AllGLFunctionsQueryable Deprecated. Used to indicate whether the QOpenGLContext-
228 backend provided by the platform is-
229 able to return function pointers from getProcAddress() even for standard OpenGL-
230 functions, for example OpenGL 1 functions like glClear() or glDrawArrays(). This is-
231 important because the OpenGL specifications do not require this ability from the-
232 getProcAddress implementations of the windowing system interfaces (EGL, WGL, GLX). The-
233 platform plugins may however choose to enhance the behavior in the backend-
234 implementation for QOpenGLContext::getProcAddress() and support returning a function-
235 pointer also for the standard, non-extension functions. This capability is a-
236 prerequisite for dynamic OpenGL loading. Starting with Qt 5.7, the platform plugin-
237 is required to have this capability.-
238-
239 \value ApplicationIcon The platform supports setting the application icon. (since 5.5)-
240 */-
241-
242/*!-
243-
244 \fn QAbstractEventDispatcher *QPlatformIntegration::createEventDispatcher() const = 0-
245-
246 Factory function for the GUI event dispatcher. The platform plugin should create-
247 and return a QAbstractEventDispatcher subclass when this function is called.-
248-
249 If the platform plugin for some reason creates the event dispatcher outside of-
250 this function (for example in the constructor), it needs to handle the case-
251 where this function is never called, ensuring that the event dispatcher is-
252 still deleted at some point (typically in the destructor).-
253-
254 Note that the platform plugin should never explicitly set the event dispatcher-
255 itself, using QCoreApplication::setEventDispatcher(), but let QCoreApplication-
256 decide when and which event dispatcher to create.-
257-
258 \since 5.2-
259*/-
260-
261bool QPlatformIntegration::hasCapability(Capability cap) const-
262{-
263 return cap == NonFullScreenWindows || cap == NativeWidgets || cap == WindowManagement;
never executed: return cap == NonFullScreenWindows || cap == NativeWidgets || cap == WindowManagement;
0
264}-
265-
266QPlatformPixmap *QPlatformIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const-
267{-
268 return new QRasterPlatformPixmap(type);
never executed: return new QRasterPlatformPixmap(type);
0
269}-
270-
271#ifndef QT_NO_OPENGL-
272/*!-
273 Factory function for QPlatformOpenGLContext. The \a context parameter is a pointer to-
274 the context for which a platform-specific context backend needs to be-
275 created. Configuration settings like the format, share context and screen have to be-
276 taken from this QOpenGLContext and the resulting platform context is expected to be-
277 backed by a native context that fulfills these criteria.-
278-
279 If the context has native handles set, no new native context is expected to be created.-
280 Instead, the provided handles have to be used. In this case the ownership of the handle-
281 must not be taken and the platform implementation is not allowed to destroy the native-
282 context. Configuration parameters like the format are also to be ignored. Instead, the-
283 platform implementation is responsible for querying the configuriation from the provided-
284 native context.-
285-
286 Returns a pointer to a QPlatformOpenGLContext instance or \c NULL if the context could-
287 not be created.-
288-
289 \sa QOpenGLContext-
290*/-
291QPlatformOpenGLContext *QPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const-
292{-
293 Q_UNUSED(context);-
294 qWarning("This plugin does not support createPlatformOpenGLContext!");-
295 return 0;
never executed: return 0;
0
296}-
297#endif // QT_NO_OPENGL-
298-
299/*!-
300 Factory function for QPlatformSharedGraphicsCache. This function will return 0 if the platform-
301 integration does not support any shared graphics cache mechanism for the given \a cacheId.-
302*/-
303QPlatformSharedGraphicsCache *QPlatformIntegration::createPlatformSharedGraphicsCache(const char *cacheId) const-
304{-
305 qWarning("This plugin does not support createPlatformSharedGraphicsBuffer for cacheId: %s!",-
306 cacheId);-
307 return 0;
never executed: return 0;
0
308}-
309-
310/*!-
311 Factory function for QPaintEngine. This function will return 0 if the platform-
312 integration does not support creating any paint engine the given \a paintDevice.-
313*/-
314QPaintEngine *QPlatformIntegration::createImagePaintEngine(QPaintDevice *paintDevice) const-
315{-
316 Q_UNUSED(paintDevice)-
317 return 0;
never executed: return 0;
0
318}-
319-
320/*!-
321 Performs initialization steps that depend on having an event dispatcher-
322 available. Called after the event dispatcher has been created.-
323-
324 Tasks that require an event dispatcher, for example creating socket notifiers, cannot be-
325 performed in the constructor. Instead, they should be performed here. The default-
326 implementation does nothing.-
327*/-
328void QPlatformIntegration::initialize()-
329{-
330}-
331-
332/*!-
333 Called before the platform integration is deleted. Useful when cleanup relies on virtual-
334 functions.-
335-
336 \since 5.5-
337*/-
338void QPlatformIntegration::destroy()-
339{-
340}-
341-
342/*!-
343 Returns the platforms input context.-
344-
345 The default implementation returns 0, implying no input method support.-
346*/-
347QPlatformInputContext *QPlatformIntegration::inputContext() const-
348{-
349 return 0;
never executed: return 0;
0
350}-
351-
352#ifndef QT_NO_ACCESSIBILITY-
353-
354/*!-
355 Returns the platforms accessibility.-
356-
357 The default implementation returns 0, implying no accessibility support.-
358*/-
359QPlatformAccessibility *QPlatformIntegration::accessibility() const-
360{-
361 return 0;
never executed: return 0;
0
362}-
363-
364#endif-
365-
366QVariant QPlatformIntegration::styleHint(StyleHint hint) const-
367{-
368 switch (hint) {-
369 case CursorFlashTime:
never executed: case CursorFlashTime:
0
370 return QPlatformTheme::defaultThemeHint(QPlatformTheme::CursorFlashTime);
never executed: return QPlatformTheme::defaultThemeHint(QPlatformTheme::CursorFlashTime);
0
371 case KeyboardInputInterval:
never executed: case KeyboardInputInterval:
0
372 return QPlatformTheme::defaultThemeHint(QPlatformTheme::KeyboardInputInterval);
never executed: return QPlatformTheme::defaultThemeHint(QPlatformTheme::KeyboardInputInterval);
0
373 case KeyboardAutoRepeatRate:
never executed: case KeyboardAutoRepeatRate:
0
374 return QPlatformTheme::defaultThemeHint(QPlatformTheme::KeyboardAutoRepeatRate);
never executed: return QPlatformTheme::defaultThemeHint(QPlatformTheme::KeyboardAutoRepeatRate);
0
375 case MouseDoubleClickInterval:
never executed: case MouseDoubleClickInterval:
0
376 return QPlatformTheme::defaultThemeHint(QPlatformTheme::MouseDoubleClickInterval);
never executed: return QPlatformTheme::defaultThemeHint(QPlatformTheme::MouseDoubleClickInterval);
0
377 case StartDragDistance:
never executed: case StartDragDistance:
0
378 return QPlatformTheme::defaultThemeHint(QPlatformTheme::StartDragDistance);
never executed: return QPlatformTheme::defaultThemeHint(QPlatformTheme::StartDragDistance);
0
379 case StartDragTime:
never executed: case StartDragTime:
0
380 return QPlatformTheme::defaultThemeHint(QPlatformTheme::StartDragTime);
never executed: return QPlatformTheme::defaultThemeHint(QPlatformTheme::StartDragTime);
0
381 case ShowIsFullScreen:
never executed: case ShowIsFullScreen:
0
382 return false;
never executed: return false;
0
383 case ShowIsMaximized:
never executed: case ShowIsMaximized:
0
384 return false;
never executed: return false;
0
385 case PasswordMaskDelay:
never executed: case PasswordMaskDelay:
0
386 return QPlatformTheme::defaultThemeHint(QPlatformTheme::PasswordMaskDelay);
never executed: return QPlatformTheme::defaultThemeHint(QPlatformTheme::PasswordMaskDelay);
0
387 case PasswordMaskCharacter:
never executed: case PasswordMaskCharacter:
0
388 return QPlatformTheme::defaultThemeHint(QPlatformTheme::PasswordMaskCharacter);
never executed: return QPlatformTheme::defaultThemeHint(QPlatformTheme::PasswordMaskCharacter);
0
389 case FontSmoothingGamma:
never executed: case FontSmoothingGamma:
0
390 return qreal(1.7);
never executed: return qreal(1.7);
0
391 case StartDragVelocity:
never executed: case StartDragVelocity:
0
392 return QPlatformTheme::defaultThemeHint(QPlatformTheme::StartDragVelocity);
never executed: return QPlatformTheme::defaultThemeHint(QPlatformTheme::StartDragVelocity);
0
393 case UseRtlExtensions:
never executed: case UseRtlExtensions:
0
394 return QVariant(false);
never executed: return QVariant(false);
0
395 case SetFocusOnTouchRelease:
never executed: case SetFocusOnTouchRelease:
0
396 return QVariant(false);
never executed: return QVariant(false);
0
397 case MousePressAndHoldInterval:
never executed: case MousePressAndHoldInterval:
0
398 return QPlatformTheme::defaultThemeHint(QPlatformTheme::MousePressAndHoldInterval);
never executed: return QPlatformTheme::defaultThemeHint(QPlatformTheme::MousePressAndHoldInterval);
0
399 case TabFocusBehavior:
never executed: case TabFocusBehavior:
0
400 return QPlatformTheme::defaultThemeHint(QPlatformTheme::TabFocusBehavior);
never executed: return QPlatformTheme::defaultThemeHint(QPlatformTheme::TabFocusBehavior);
0
401 case ReplayMousePressOutsidePopup:
never executed: case ReplayMousePressOutsidePopup:
0
402 return true;
never executed: return true;
0
403 case ItemViewActivateItemOnSingleClick:
never executed: case ItemViewActivateItemOnSingleClick:
0
404 return QPlatformTheme::defaultThemeHint(QPlatformTheme::ItemViewActivateItemOnSingleClick);
never executed: return QPlatformTheme::defaultThemeHint(QPlatformTheme::ItemViewActivateItemOnSingleClick);
0
405 }-
406-
407 return 0;
never executed: return 0;
0
408}-
409-
410Qt::WindowState QPlatformIntegration::defaultWindowState(Qt::WindowFlags flags) const-
411{-
412 // Leave popup-windows as is-
413 if (flags & Qt::Popup & ~Qt::Window)
flags & Qt::Po... & ~Qt::WindowDescription
TRUEnever evaluated
FALSEnever evaluated
0
414 return Qt::WindowNoState;
never executed: return Qt::WindowNoState;
0
415-
416 if (styleHint(QPlatformIntegration::ShowIsFullScreen).toBool())
styleHint(QPla...reen).toBool()Description
TRUEnever evaluated
FALSEnever evaluated
0
417 return Qt::WindowFullScreen;
never executed: return Qt::WindowFullScreen;
0
418 else if (styleHint(QPlatformIntegration::ShowIsMaximized).toBool())
styleHint(QPla...ized).toBool()Description
TRUEnever evaluated
FALSEnever evaluated
0
419 return Qt::WindowMaximized;
never executed: return Qt::WindowMaximized;
0
420-
421 return Qt::WindowNoState;
never executed: return Qt::WindowNoState;
0
422}-
423-
424Qt::KeyboardModifiers QPlatformIntegration::queryKeyboardModifiers() const-
425{-
426 return QGuiApplication::keyboardModifiers();
never executed: return QGuiApplication::keyboardModifiers();
0
427}-
428-
429/*!-
430 Should be used to obtain a list of possible shortcuts for the given key-
431 event. As that needs system functionality it cannot be done in qkeymapper.-
432-
433 One example for more than 1 possibility is the key combination of Shift+5.-
434 That one might trigger a shortcut which is set as "Shift+5" as well as one-
435 using %. These combinations depend on the currently set keyboard layout-
436 which cannot be obtained by Qt functionality.-
437*/-
438QList<int> QPlatformIntegration::possibleKeys(const QKeyEvent *) const-
439{-
440 return QList<int>();
never executed: return QList<int>();
0
441}-
442-
443/*!-
444 Should be called by the implementation whenever a new screen is added.-
445-
446 The first screen added will be the primary screen, used for default-created-
447 windows, GL contexts, and other resources unless otherwise specified.-
448-
449 This adds the screen to QGuiApplication::screens(), and emits the-
450 QGuiApplication::screenAdded() signal.-
451-
452 The screen should be deleted by calling QPlatformIntegration::destroyScreen().-
453*/-
454void QPlatformIntegration::screenAdded(QPlatformScreen *ps, bool isPrimary)-
455{-
456 QScreen *screen = new QScreen(ps);-
457-
458 if (isPrimary) {
isPrimaryDescription
TRUEnever evaluated
FALSEnever evaluated
0
459 QGuiApplicationPrivate::screen_list.prepend(screen);-
460 } else {
never executed: end of block
0
461 QGuiApplicationPrivate::screen_list.append(screen);-
462 }
never executed: end of block
0
463 emit qGuiApp->screenAdded(screen);-
464-
465 if (isPrimary)
isPrimaryDescription
TRUEnever evaluated
FALSEnever evaluated
0
466 emit qGuiApp->primaryScreenChanged(screen);
never executed: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->primaryScreenChanged(screen);
0
467}
never executed: end of block
0
468-
469/*!-
470 Just removes the screen, call destroyScreen instead.-
471-
472 \sa destroyScreen()-
473*/-
474-
475void QPlatformIntegration::removeScreen(QScreen *screen)-
476{-
477 const bool wasPrimary = (!QGuiApplicationPrivate::screen_list.isEmpty() && QGuiApplicationPrivate::screen_list.at(0) == screen);
!QGuiApplicati...list.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
QGuiApplicatio...t(0) == screenDescription
TRUEnever evaluated
FALSEnever evaluated
0
478 QGuiApplicationPrivate::screen_list.removeOne(screen);-
479-
480 if (wasPrimary && qGuiApp && !QGuiApplicationPrivate::screen_list.isEmpty())
wasPrimaryDescription
TRUEnever evaluated
FALSEnever evaluated
(static_cast<Q...::instance()))Description
TRUEnever evaluated
FALSEnever evaluated
!QGuiApplicati...list.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
481 emit qGuiApp->primaryScreenChanged(QGuiApplicationPrivate::screen_list.at(0));
never executed: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->primaryScreenChanged(QGuiApplicationPrivate::screen_list.at(0));
0
482}
never executed: end of block
0
483-
484/*!-
485 Should be called by the implementation whenever a screen is removed.-
486-
487 This removes the screen from QGuiApplication::screens(), and deletes it.-
488-
489 Failing to call this and manually deleting the QPlatformScreen instead may-
490 lead to a crash due to a pure virtual call.-
491*/-
492void QPlatformIntegration::destroyScreen(QPlatformScreen *screen)-
493{-
494 QScreen *qScreen = screen->screen();-
495 removeScreen(qScreen);-
496 delete qScreen;-
497 delete screen;-
498}
never executed: end of block
0
499-
500/*!-
501 Should be called whenever the primary screen changes.-
502-
503 When the screen specified as primary changes, this method will notify-
504 QGuiApplication and emit the QGuiApplication::primaryScreenChanged signal.-
505 */-
506-
507void QPlatformIntegration::setPrimaryScreen(QPlatformScreen *newPrimary)-
508{-
509 QScreen* newPrimaryScreen = newPrimary->screen();-
510 int idx = QGuiApplicationPrivate::screen_list.indexOf(newPrimaryScreen);-
511 Q_ASSERT(idx >= 0);-
512 if (idx == 0)
idx == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
513 return;
never executed: return;
0
514-
515 QGuiApplicationPrivate::screen_list.swap(0, idx);-
516 emit qGuiApp->primaryScreenChanged(newPrimaryScreen);-
517}
never executed: end of block
0
518-
519QStringList QPlatformIntegration::themeNames() const-
520{-
521 return QStringList();
never executed: return QStringList();
0
522}-
523-
524class QPlatformTheme *QPlatformIntegration::createPlatformTheme(const QString &name) const-
525{-
526 Q_UNUSED(name)-
527 return new QPlatformTheme;
never executed: return new QPlatformTheme;
0
528}-
529-
530/*!-
531 Factory function for QOffscreenSurface. An offscreen surface will typically be implemented with a-
532 pixel buffer (pbuffer). If the platform doesn't support offscreen surfaces, an invisible window-
533 will be used by QOffscreenSurface instead.-
534*/-
535QPlatformOffscreenSurface *QPlatformIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const-
536{-
537 Q_UNUSED(surface)-
538 return 0;
never executed: return 0;
0
539}-
540-
541#ifndef QT_NO_SESSIONMANAGER-
542/*!-
543 \since 5.2-
544-
545 Factory function for QPlatformSessionManager. The default QPlatformSessionManager provides the same-
546 functionality as the QSessionManager.-
547*/-
548QPlatformSessionManager *QPlatformIntegration::createPlatformSessionManager(const QString &id, const QString &key) const-
549{-
550 return new QPlatformSessionManager(id, key);
never executed: return new QPlatformSessionManager(id, key);
0
551}-
552#endif-
553-
554/*!-
555 \since 5.2-
556-
557 Function to sync the platform integrations state with the window system.-
558-
559 This is often implemented as a roundtrip from the platformintegration to the window system.-
560-
561 This function should not call QWindowSystemInterface::flushWindowSystemEvents() or-
562 QCoreApplication::processEvents()-
563*/-
564void QPlatformIntegration::sync()-
565{-
566}-
567-
568/*!-
569 \since 5.7-
570-
571 Should sound a bell, using the default volume and sound.-
572-
573 \sa QApplication::beep()-
574*/-
575void QPlatformIntegration::beep() const-
576{-
577}-
578-
579#ifndef QT_NO_OPENGL-
580/*!-
581 Platform integration function for querying the OpenGL implementation type.-
582-
583 Used only when dynamic OpenGL implementation loading is enabled.-
584-
585 Subclasses should reimplement this function and return a value based on-
586 the OpenGL implementation they have chosen to load.-
587-
588 \note The return value does not indicate or limit the types of-
589 contexts that can be created by a given implementation. For example-
590 a desktop OpenGL implementation may be capable of creating OpenGL-
591 ES-compatible contexts too.-
592-
593 \sa QOpenGLContext::openGLModuleType(), QOpenGLContext::isOpenGLES()-
594-
595 \since 5.3-
596 */-
597QOpenGLContext::OpenGLModuleType QPlatformIntegration::openGLModuleType()-
598{-
599 qWarning("This plugin does not support dynamic OpenGL loading!");-
600 return QOpenGLContext::LibGL;
never executed: return QOpenGLContext::LibGL;
0
601}-
602#endif-
603-
604/*!-
605 \since 5.5-
606-
607 Platform integration function for setting the application icon.-
608-
609 \sa QGuiApplication::setWindowIcon()-
610*/-
611void QPlatformIntegration::setApplicationIcon(const QIcon &icon) const-
612{-
613 Q_UNUSED(icon);-
614}
never executed: end of block
0
615-
616QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9