8#include <private/qguiapplication_p.h>
9#include <qpa/qwindowsysteminterface.h>
10#include <QtGui/qwindow.h>
11#include <QtGui/qscreen.h>
12#include <private/qhighdpiscaling_p.h>
13#include <private/qwindow_p.h>
53 return static_cast<QWindow *
>(m_surface);
61 return window()->parent() ?
window()->parent()->handle() :
nullptr;
71 return scr ? scr->
handle() :
nullptr;
173 return window()->isVisible();
227 result +=
p->geometry().topLeft();
259 result -=
p->geometry().topLeft();
297 qWarning(
"This plugin does not support setParent!");
329 return QWindowSystemInterface::handleCloseEvent<QWindowSystemInterface::SynchronousDelivery>(
window());
356 qWarning(
"This plugin does not support setting window opacity");
366 qWarning(
"This plugin does not support setting window masks");
416 qWarning(
"This plugin does not support grabbing the keyboard");
423 qWarning(
"This plugin does not support grabbing the mouse");
453 d->updateTimer.stop();
526 if (!fullTitle.isEmpty())
527 fullTitle += separator;
529 }
else if (fullTitle.isEmpty()) {
557 if (!
parent() && currentScreen && !currentScreen->
geometry().contains(center)) {
558 const auto screens = currentScreen->virtualSiblings();
561 if (screenGeometry.
contains(center))
620 if (siblings.size() > 1) {
622 for (
const QScreen *sibling : siblings) {
623 if (sibling->geometry().contains(referencePoint))
646 int deviceIndependentDefaultHeight)
648 if (
size.width() == 0) {
649 const int minWidth =
w->minimumWidth();
650 size.setWidth(minWidth > 0 ? minWidth : deviceIndependentDefaultWidth);
652 if (
size.height() == 0) {
653 const int minHeight =
w->minimumHeight();
654 size.setHeight(minHeight > 0 ? minHeight : deviceIndependentDefaultHeight);
673 int defaultWidth,
int defaultHeight,
674 const QScreen **resultingScreenReturn)
676 if (resultingScreenReturn)
677 *resultingScreenReturn =
w->screen();
678 if (!
w->isTopLevel()) {
680 const QSize deviceIndependentSize =
682 defaultWidth, defaultHeight);
687 if (!
position && !wp->resizeAutomatic)
694 if (resultingScreenReturn)
695 *resultingScreenReturn =
screen;
698 if (wp->resizeAutomatic)
699 deviceIndependentRect.setSize(
700 fixInitialSize(deviceIndependentRect.size(),
w, defaultWidth, defaultHeight));
704 if (deviceIndependentRect.height() < (availableDeviceIndependentGeometry.height() * 8) / 9
705 && deviceIndependentRect.width()
706 < (availableDeviceIndependentGeometry.width() * 8) / 9) {
707 const QWindow *tp =
w->transientParent();
710 deviceIndependentRect.moveCenter(tp->geometry().
center());
714 deviceIndependentRect.moveCenter(availableDeviceIndependentGeometry.center());
741 static bool customUpdateIntervalValid =
false;
743 &customUpdateIntervalValid);
744 int updateInterval = customUpdateInterval;
745 if (!customUpdateIntervalValid) {
748 const qreal refreshRate = currentScreen->refreshRate();
749 if (refreshRate > 60.0)
750 updateInterval /= refreshRate / 60.0;
786 qWarning() <<
"The cached device pixel ratio value was stale on window update. "
787 <<
"Please file a QTBUG which explains how to reproduce.";
862 return !correctedGeometryF.isEmpty() && rectF != correctedGeometryF
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
QString applicationName
the name of this application
static QPoint pos()
Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates.
static QString * displayName
QScreen * primaryScreen
the primary (or default) screen of the application.
static QScreen * screenAt(const QPoint &point)
Returns the screen at point, or \nullptr if outside of any screen.
static qreal factor(C *context)
The QIcon class provides scalable icons in different modes and states.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr bool isEmpty() const noexcept
Returns true if the rectangle is empty, otherwise returns false.
bool intersects(const QRect &r) const noexcept
Returns true if this rectangle intersects with the given rectangle (i.e., there is at least one pixel...
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr QPoint center() const noexcept
Returns the center point of the rectangle.
The QRegion class specifies a clip region for a painter.
The QScreen class is used to query screen properties. \inmodule QtGui.
QList< QScreen * > virtualSiblings() const
Get the screen's virtual siblings.
QPlatformScreen * handle() const
Get the platform screen handle.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
bool updateRequestPending
bool updateDevicePixelRatio()
static bool flushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
Make Qt Gui process all events on the event queue immediately.
static void handleFocusWindowChanged(QWindow *window, Qt::FocusReason r=Qt::OtherFocusReason)
static bool handleExposeEvent(QWindow *window, const QRegion ®ion)
T toNativePixels(const T &value, const C *context)
T toNative(const T &value, qreal scaleFactor, QPoint origin=QPoint(0, 0))
T fromNativePixels(const T &value, const C *context)
T fromNative(const T &value, qreal scaleFactor, QPoint origin=QPoint(0, 0))
T toNativeWindowGeometry(const T &value, const C *context)
T fromNativeWindowGeometry(const T &value, const C *context)
Combined button and popup list for selecting options.
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei const GLuint GLboolean enabled
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
Q_GUI_EXPORT QWindowPrivate * qt_window_private(QWindow *window)
static QRect frameGeometry(HWND hwnd, bool topLevel)
QtConcurrent::task([]{ qDebug("Hello, world!");}).spawn(FutureResult void increment(QPromise< int > &promise, int i)
[10]
QNetworkRequest request(url)