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
qandroidplatformscreen.h
Go to the documentation of this file.
1// Copyright (C) 2014 BogDan Vatra <bogdan@kde.org>
2// Copyright (C) 2016 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QANDROIDPLATFORMSCREEN_H
6#define QANDROIDPLATFORMSCREEN_H
7
8#include <QList>
9#include <QPainter>
10#include <QTimer>
11#include <QWaitCondition>
12#include <QtCore/QJniObject>
13#include <qpa/qplatformscreen.h>
14#include <QtGui/qscreen_platform.h>
15
17
19
20
22 public QPlatformScreen,
24{
26public:
27 QAndroidPlatformScreen(const QJniObject &displayObject);
29
30 QRect geometry() const override { return QRect(QPoint(), m_size); }
31 QRect availableGeometry() const override { return m_availableGeometry; }
32 int depth() const override { return m_depth; }
33 QImage::Format format() const override { return m_format; }
34 QSizeF physicalSize() const override { return m_physicalSize; }
35
36 QString name() const override { return m_name; }
37 QList<Mode> modes() const override { return m_modes; }
38 int currentMode() const override { return m_currentMode; }
39 int preferredMode() const override { return m_currentMode; }
40 qreal refreshRate() const override { return m_refreshRate; }
41 inline QWindow *topVisibleWindow() const;
42 QWindow *topLevelAt(const QPoint & p) const override;
43
49 int displayId() const override;
50
51public slots:
52 void setPhysicalSize(const QSize &size);
53 void setAvailableGeometry(const QRect &rect);
54 void setSize(const QSize &size);
55 void setSizeParameters(const QSize &physicalSize, const QSize &size,
59
60protected:
61 typedef QList<QAndroidPlatformWindow *> WindowStackType;
69 QList<Mode> m_modes;
71 int m_displayId = -1;
72
73private:
74 QDpi logicalDpi() const override;
75 QDpi logicalBaseDpi() const override;
76 Qt::ScreenOrientation orientation() const override;
78 void applicationStateChanged(Qt::ApplicationState);
79private:
80 QSize m_size;
81};
82
84#endif
Qt::ScreenOrientation orientation() const override
Reimplement this function in subclass to return the current orientation of the screen,...
QSizeF physicalSize() const override
Reimplement this function in subclass to return the physical size of the screen, in millimeters.
void lower(QAndroidPlatformWindow *window)
QString name() const override
int currentMode() const override
Reimplement this function in subclass to return the index of the current mode from the modes list.
QWindow * topLevelAt(const QPoint &p) const override
Return the given top level window for a given position.
QList< QAndroidPlatformWindow * > WindowStackType
void setSizeParameters(const QSize &physicalSize, const QSize &size, const QRect &availableGeometry)
QDpi logicalBaseDpi() const override
Reimplement to return the base logical DPI for the platform.
QDpi logicalDpi() const override
Reimplement this function in subclass to return the logical horizontal and vertical dots per inch met...
QRect geometry() const override
Reimplement in subclass to return the pixel geometry of the screen.
void raise(QAndroidPlatformWindow *window)
int preferredMode() const override
Reimplement this function in subclass to return the preferred mode index from the modes list.
void setPhysicalSize(const QSize &size)
void setAvailableGeometry(const QRect &rect)
void setOrientation(Qt::ScreenOrientation orientation)
QRect availableGeometry() const override
Reimplement in subclass to return the pixel geometry of the available space This normally is the desk...
QAndroidPlatformScreen(const QJniObject &displayObject)
void removeWindow(QAndroidPlatformWindow *window)
Qt::ScreenOrientation nativeOrientation() const override
Reimplement this function in subclass to return the native orientation of the screen,...
QImage::Format format() const override
Reimplement in subclass to return the image format which corresponds to the screen format.
void setSize(const QSize &size)
void setRefreshRate(qreal refreshRate)
QList< Mode > modes() const override
Reimplement this function in subclass to return the list of modes for this screen.
qreal refreshRate() const override
Reimplement this function in subclass to return the vertical refresh rate of the screen,...
void addWindow(QAndroidPlatformWindow *window)
int depth() const override
Reimplement in subclass to return current depth of the screen.
Format
The following image formats are available in Qt.
Definition qimage.h:41
\inmodule QtCore
Native interface to a screen.
\inmodule QtCore
Definition qobject.h:103
The QPlatformScreen class provides an abstraction for visual displays.
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:208
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtGui
Definition qwindow.h:63
rect
[4]
Combined button and popup list for selecting options.
ScreenOrientation
Definition qnamespace.h:271
ApplicationState
Definition qnamespace.h:262
QPair< qreal, qreal > QDpi
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLfloat GLfloat p
[1]
#define Q_OBJECT
#define slots
double qreal
Definition qtypes.h:187
aWidget window() -> setWindowTitle("New Window Title")
[2]