44 #include <qpa/qplatformscreen.h>
45 #include <qpa/qplatformscreen_p.h>
47 #include <QtCore/QDebug>
48 #include <QtCore/private/qobject_p.h>
97 if (availableGeometryChanged)
100 if (geometryChanged || availableGeometryChanged) {
101 const auto siblings =
q->virtualSiblings();
102 for (
QScreen* sibling : siblings)
103 emit sibling->virtualGeometryChanged(sibling->virtualGeometry());
107 emit q->physicalDotsPerInchChanged(
q->physicalDotsPerInch());
143 if (wasPrimary && newPrimaryScreen)
144 emit qGuiApp->primaryScreenChanged(newPrimaryScreen);
153 bool movingFromVirtualSibling = newPrimaryScreen
162 const bool wasVisible =
window->isVisible();
163 window->setScreen(newPrimaryScreen);
167 if (movingFromVirtualSibling)
168 window->setVisible(wasVisible);
180 return d->platformScreen;
193 return d->platformScreen->name();
205 return d->platformScreen->manufacturer();
217 return d->platformScreen->model();
229 return d->platformScreen->serialNumber();
239 return d->platformScreen->depth();
249 return d->geometry.size();
325 return d->logicalDpi.first;
341 return d->logicalDpi.second;
394 return d->platformScreen->physicalSize();
407 return d->availableGeometry.size();
437 return d->availableGeometry;
454 screens << platformScreen->screen();
544 return d->orientation;
559 return d->refreshRate;
578 return d->primaryOrientation;
595 return d->platformScreen->nativeOrientation();
719 for (
QScreen *sibling : siblings) {
720 if (sibling->geometry().contains(point))
775 if (!platformScreen) {
793 void *QScreen::resolveInterface(
const char *
name,
int revision)
const
797 auto *platformScreen =
handle();
810 #if defined(Q_OS_WEBOS)
817 #ifndef QT_NO_DEBUG_STREAM
819 static inline void formatRect(
QDebug &
debug,
const QRect
r)
821 debug <<
r.width() <<
'x' <<
r.height()
832 if (
debug.verbosity() > 2) {
834 debug <<
", primary";
835 debug <<
", geometry=";
837 debug <<
", available=";
856 #include "moc_qscreen.cpp"
static bool closingDown()
The QDebug class provides an output stream for debugging information.
Convenience class for custom QDebug operators.
static QWindowList allWindows()
QScreen * primaryScreen
the primary (or default) screen of the application.
static QList< QScreen * > screen_list
static void resetCachedDevicePixelRatio()
static qreal factor(C *context)
static QDpi logicalDpi(const QScreen *screen)
bool removeOne(const AT &t)
qsizetype count() const noexcept
void reserve(qsizetype size)
The QObject class is the base class of all Qt objects.
The QPixmap class is an off-screen image representation that can be used as a paint device.
void setDevicePixelRatio(qreal scaleFactor)
The QPoint class defines a point in the plane using integer precision.
constexpr int x() const noexcept
constexpr int y() const noexcept
The QRect class defines a rectangle in the plane using integer precision.
constexpr int height() const noexcept
constexpr QSize size() const noexcept
constexpr int width() const noexcept
The QScreen class is used to query screen properties. \inmodule QtGui.
QSize availableVirtualSize
the available size of the virtual desktop to which this screen belongs
qreal logicalDotsPerInchY
the number of logical dots or pixels per inch in the vertical direction
qreal devicePixelRatio
the screen's ratio between physical pixels and device-independent pixels
QString model
the model of the screen
bool isPortrait(Qt::ScreenOrientation orientation) const
bool isLandscape(Qt::ScreenOrientation orientation) const
int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b) const
Qt::ScreenOrientation nativeOrientation
the native screen orientation
QTransform transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target) const
qreal logicalDotsPerInchX
the number of logical dots or pixels per inch in the horizontal direction
QList< QScreen * > virtualSiblings() const
QRect availableGeometry
the screen's available geometry in pixels
QSizeF physicalSize
the screen's physical size (in millimeters)
QRect geometry
the screen's geometry in pixels
QPixmap grabWindow(WId window=0, int x=0, int y=0, int w=-1, int h=-1)
qreal refreshRate
the approximate vertical refresh rate of the screen in Hz
qreal physicalDotsPerInchY
the number of physical dots or pixels per inch in the vertical direction
QSize size
the pixel resolution of the screen
Qt::ScreenOrientation primaryOrientation
the primary screen orientation
QRect virtualGeometry
the pixel geometry of the virtual desktop to which this screen belongs
QSize virtualSize
the pixel size of the virtual desktop to which this screen belongs
int depth
the color depth of the screen
QString manufacturer
the manufacturer of the screen
Qt::ScreenOrientation orientation
the screen orientation
QString name
a user presentable string representing the screen
QSize availableSize
the screen's available size in pixels
qreal logicalDotsPerInch
the number of logical dots or pixels per inch
qreal physicalDotsPerInchX
the number of physical dots or pixels per inch in the horizontal direction
QString serialNumber
the serial number of the screen
QScreen * virtualSiblingAt(QPoint point)
QRect mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect) const
QPlatformScreen * handle() const
QRect availableVirtualGeometry
the available geometry of the virtual desktop to which this screen belongs
qreal physicalDotsPerInch
the number of physical dots or pixels per inch
void setPlatformScreen(QPlatformScreen *screen)
Qt::ScreenOrientation primaryOrientation
void updatePrimaryOrientation()
Qt::ScreenOrientation orientation
QPlatformScreen * platformScreen
void emitGeometryChangeSignals(bool geometryChanged, bool availableGeometryChanged)
void updateGeometriesWithSignals()
The QSizeF class defines the size of a two-dimensional object using floating point precision.
constexpr qreal width() const noexcept
constexpr qreal height() const noexcept
The QSize class defines the size of a two-dimensional object using integer point precision.
constexpr int height() const noexcept
constexpr int width() const noexcept
constexpr bool isValid() const noexcept
The QString class provides a Unicode character string.
The QWindow class represents a window in the underlying windowing system.
T toNative(const T &value, qreal scaleFactor, QPoint origin=QPoint(0, 0))
Q_WIDGETS_EXPORT qreal dpi(const QStyleOption *option)
QTextStream & noforcesign(QTextStream &stream)
@ InvertedLandscapeOrientation
@ InvertedPortraitOrientation
QTextStream & forcesign(QTextStream &stream)
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
QT_END_INCLUDE_NAMESPACE typedef double qreal
QPair< qreal, qreal > QDpi
#define QT_NATIVE_INTERFACE_RETURN_IF(NativeInterface, baseType)
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLdouble GLdouble GLdouble GLdouble q
Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QScreen *screen)
bool contains(const AT &t) const noexcept