Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QWindowPrivate Class Reference

#include <qwindow_p.h>

Inheritance diagram for QWindowPrivate:
Collaboration diagram for QWindowPrivate:

Public Types

enum  PositionPolicy { WindowFrameInclusive , WindowFrameExclusive }
enum  SiblingPosition { PositionTop , PositionBottom }
enum class  FocusTarget {
  First , Last , Current , Next ,
  Prev
}
Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>

Public Member Functions

 QWindowPrivate (decltype(QObjectPrivateVersion) version=QObjectPrivateVersion)
 ~QWindowPrivate () override
void init (QWindow *parent, QScreen *targetScreen=nullptr)
void setCursor (const QCursor *c=nullptr)
bool applyCursor ()
QPoint globalPosition () const
QWindowtopLevelWindow (QWindow::AncestorMode mode=QWindow::IncludeTransients) const
virtual QWindoweventReceiver ()
virtual QPalette windowPalette () const
virtual void setVisible (bool visible)
void updateVisibility ()
void _q_clearAlert ()
void updateSiblingPosition (SiblingPosition)
bool windowRecreationRequired (QScreen *newScreen) const
void create (bool recursive)
void destroy ()
void setTopLevelScreen (QScreen *newScreen, bool recreate)
void connectToScreen (QScreen *topLevelScreen)
void disconnectFromScreen ()
void emitScreenChangedRecursion (QScreen *newScreen)
QScreenscreenForGeometry (const QRect &rect) const
void setTransientParent (QWindow *parent)
virtual void clearFocusObject ()
virtual void setFocusToTarget (FocusTarget, Qt::FocusReason)
virtual QRectF closestAcceptableGeometry (const QRectF &rect) const
void setMinOrMaxSize (QSize *oldSizeMember, const QSize &size, qxp::function_ref< void()> funcWidthChanged, qxp::function_ref< void()> funcHeightChanged)
virtual bool participatesInLastWindowClosed () const
virtual bool treatAsVisible () const
virtual void maybeSynthesizeContextMenuEvent (QMouseEvent *event)
const QWindowforwardToPopup (QEvent *event, const QWindow *activePopupOnPress)
bool isPopup () const
void setAutomaticPositionAndResizeEnabled (bool a)
bool updateDevicePixelRatio ()
Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
void setObjectNameWithoutBindings (const QString &name)
 QObjectPrivate (decltype(QObjectPrivateVersion) version=QObjectPrivateVersion)
virtual ~QObjectPrivate ()
void deleteChildren ()
void clearBindingStorage ()
void setParent_helper (QObject *)
void moveToThread_helper ()
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
QObjectList receiverList (const char *signal) const
void ensureConnectionData ()
void addConnection (int signal, Connection *c)
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
bool maybeSignalConnected (uint signalIndex) const
bool isDeclarativeSignalConnected (uint signalIdx) const
void connectNotify (const QMetaMethod &signal)
void disconnectNotify (const QMetaMethod &signal)
void reinitBindingStorageAfterThreadMove ()
virtual std::string flagsForDumping () const
virtual void writeToDebugStream (QDebug &) const
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
Public Member Functions inherited from QObjectData
 QObjectData ()=default
virtual ~QObjectData ()=0
const QMetaObjectdynamicMetaObject () const

Static Public Member Functions

static QWindowPrivateget (QWindow *window)
static Qt::WindowState effectiveState (Qt::WindowStates)
Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
static QObjectPrivateget (QObject *o)
static const QObjectPrivateget (const QObject *o)
template<typename Func1, typename Func2>
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
template<typename Func1, typename Func2>
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
static QMetaObject::Connection connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject)
static QMetaObject::Connection connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
static QMetaObject::Connection connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
static bool disconnect (const QObject *sender, int signal_index, void **slot)
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot)

Public Attributes

QWindow::SurfaceType surfaceType = QWindow::RasterSurface
Qt::WindowFlags windowFlags = Qt::Window
QWindowparentWindow = nullptr
QPlatformWindowplatformWindow = nullptr
bool visible = false
bool visibilityOnDestroy = false
bool exposed = false
bool inClose = false
QSurfaceFormat requestedFormat
QString windowTitle
QString windowFilePath
QIcon windowIcon
QRect geometry
qreal devicePixelRatio = 1.0
Qt::WindowStates windowState = Qt::WindowNoState
QWindow::Visibility visibility = QWindow::Hidden
bool resizeEventPending = true
bool receivedExpose = false
PositionPolicy positionPolicy = WindowFrameExclusive
bool positionAutomatic = true
bool resizeAutomatic = true
Qt::ScreenOrientation contentOrientation = Qt::PrimaryOrientation
qreal opacity = 1
QRegion mask
QSize minimumSize = {0, 0}
QSize maximumSize = {QWINDOWSIZE_MAX, QWINDOWSIZE_MAX}
QSize baseSize
QSize sizeIncrement
Qt::WindowModality modality = Qt::NonModal
bool blockedByModalWindow = false
bool updateRequestPending = false
bool transientParentPropertySet = false
QPointer< QWindowtransientParent
QPointer< QScreentopLevelScreen
QCursor cursor = {Qt::ArrowCursor}
bool hasCursor = false
QElapsedTimer lastComposeTime
Public Attributes inherited from QObjectPrivate
ExtraDataextraData
QAtomicPointer< QThreadDatathreadData
QAtomicPointer< ConnectionDataconnections
union { 
   QObject *   currentChildBeingDeleted 
   QAbstractDeclarativeData *   declarativeData 
}; 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
Public Attributes inherited from QObjectData
QObjectq_ptr
QObjectparent
QObjectList children
uint isWidget: 1
uint blockSig: 1
uint wasDeleted: 1
uint isDeletingChildren: 1
uint sendChildEvents: 1
uint receiveChildEvents: 1
uint isWindow: 1
uint deleteLaterCalled: 1
uint isQuickItem: 1
uint willBeWidget: 1
uint wasWidget: 1
uint receiveParentEvents: 1
uint unused: 20
QAtomicInt postedEvents
QDynamicMetaObjectDatametaObject
QBindingStorage bindingStorage

Detailed Description

Definition at line 33 of file qwindow_p.h.

Member Enumeration Documentation

◆ FocusTarget

enum class QWindowPrivate::FocusTarget
strong
Enumerator
First 
Last 
Current 
Next 
Prev 

Definition at line 80 of file qwindow_p.h.

◆ PositionPolicy

Enumerator
WindowFrameInclusive 
WindowFrameExclusive 

Definition at line 38 of file qwindow_p.h.

◆ SiblingPosition

Enumerator
PositionTop 
PositionBottom 

Definition at line 65 of file qwindow_p.h.

Constructor & Destructor Documentation

◆ QWindowPrivate()

QWindowPrivate::QWindowPrivate ( decltype(QObjectPrivateVersion) version = QObjectPrivateVersion)

Definition at line 210 of file qwindow.cpp.

◆ ~QWindowPrivate()

QWindowPrivate::~QWindowPrivate ( )
overridedefault

Member Function Documentation

◆ _q_clearAlert()

void QWindowPrivate::_q_clearAlert ( )

Definition at line 3206 of file qwindow.cpp.

◆ applyCursor()

bool QWindowPrivate::applyCursor ( )

Definition at line 3283 of file qwindow.cpp.

◆ clearFocusObject()

void QWindowPrivate::clearFocusObject ( )
virtual

Reimplemented in QQuickWindowPrivate, QWidgetWindowPrivate, and QWidgetWindowPrivate.

Definition at line 620 of file qwindow.cpp.

◆ closestAcceptableGeometry()

QRectF QWindowPrivate::closestAcceptableGeometry ( const QRectF & rect) const
virtual

Reimplemented in QWidgetWindowPrivate, and QWidgetWindowPrivate.

Definition at line 627 of file qwindow.cpp.

◆ connectToScreen()

void QWindowPrivate::connectToScreen ( QScreen * topLevelScreen)

Definition at line 504 of file qwindow.cpp.

◆ create()

void QWindowPrivate::create ( bool recursive)

Definition at line 543 of file qwindow.cpp.

◆ destroy()

void QWindowPrivate::destroy ( )

Definition at line 2142 of file qwindow.cpp.

◆ disconnectFromScreen()

void QWindowPrivate::disconnectFromScreen ( )

Definition at line 498 of file qwindow.cpp.

◆ effectiveState()

Qt::WindowState QWindowPrivate::effectiveState ( Qt::WindowStates state)
static

Definition at line 1459 of file qwindow.cpp.

◆ emitScreenChangedRecursion()

void QWindowPrivate::emitScreenChangedRecursion ( QScreen * newScreen)

Definition at line 510 of file qwindow.cpp.

◆ eventReceiver()

virtual QWindow * QWindowPrivate::eventReceiver ( )
inlinevirtual

Reimplemented in QWidgetWindowPrivate, and QWidgetWindowPrivate.

Definition at line 58 of file qwindow_p.h.

◆ forwardToPopup()

const QWindow * QWindowPrivate::forwardToPopup ( QEvent * event,
const QWindow * activePopupOnPress )

Returns the popup window that has consumed event, if any. activePopupOnPress is the window that we have observed previously handling the press.

Definition at line 2496 of file qwindow.cpp.

◆ get()

QWindowPrivate * QWindowPrivate::get ( QWindow * window)
inlinestatic

Definition at line 108 of file qwindow_p.h.

◆ globalPosition()

QPoint QWindowPrivate::globalPosition ( ) const

Definition at line 3103 of file qwindow.cpp.

◆ init()

void QWindowPrivate::init ( QWindow * parent,
QScreen * targetScreen = nullptr )

Definition at line 217 of file qwindow.cpp.

◆ isPopup()

bool QWindowPrivate::isPopup ( ) const
inline

Definition at line 102 of file qwindow_p.h.

◆ maybeSynthesizeContextMenuEvent()

void QWindowPrivate::maybeSynthesizeContextMenuEvent ( QMouseEvent * event)
virtual

Synthesize and send a QContextMenuEvent if the given event is a suitable mouse event (a right-button press or release, depending on QStyleHints::contextMenuTrigger()). On most platforms, it's done on mouse press; on Windows, it's done on release, because of the potential to support right-button clicks and drags to select or lasso items, and then still getting a context menu at the end of that gesture. (That is in conflict with supporting the press-drag-release gesture to select menu items on the context menus themselves. Context menus can be implemented that way by handling the separate press, move and release events.)

Any time the event was already handled in some way, it should be accepted, but mere acceptance of the mouse event cannot be taken to indicate that it's not necessary to synthesize a QContextMenuEvent here, because the Windows use case requires doing one thing (selecting items) with the mouse events, and then doing something completely different with the QContextMenuEvent. In other words, QContextMenuEvent is very different from other kinds of optional followup events synthesized from unhandled events (like the way we synthesize a QMouseEvent only if a QTabletEvent was not handled). Furthermore, there's enough legacy widget code that doesn't call ignore() on unhandled mouse events. So it's uncertain whether this can change in Qt 7.

The QContextMenuEvent occurs at the scenePosition(). The position() was likely already "localized" during the previous delivery.

The synthesis from a mouse button event could be done in the platform plugin, but so far on Windows it's not done: WM_CONTEXTMENU is not generated by the OS, because we never call the default window procedure that would do that in response to unhandled WM_RBUTTONUP. If we eventually want to do that, we would have to avoid doing it here, on platforms where the platform plugin is responsible for it.

QGuiApplicationPrivate::processContextMenuEvent also allows keyboard-triggered context menu events that the QPA plugin might generate. On Windows, the keyboard may have a menu key. On macOS, control-return is the usual shortcut; on Gnome, it's shift-F10; and so on.

Reimplemented in QQuickWindowPrivate.

Definition at line 2826 of file qwindow.cpp.

◆ participatesInLastWindowClosed()

bool QWindowPrivate::participatesInLastWindowClosed ( ) const
virtual

Reimplemented in QWidgetWindowPrivate, and QWidgetWindowPrivate.

Definition at line 2465 of file qwindow.cpp.

◆ screenForGeometry()

QScreen * QWindowPrivate::screenForGeometry ( const QRect & rect) const

Definition at line 1895 of file qwindow.cpp.

◆ setAutomaticPositionAndResizeEnabled()

void QWindowPrivate::setAutomaticPositionAndResizeEnabled ( bool a)
inline

Definition at line 103 of file qwindow_p.h.

◆ setCursor()

void QWindowPrivate::setCursor ( const QCursor * c = nullptr)

Definition at line 3259 of file qwindow.cpp.

◆ setFocusToTarget()

virtual void QWindowPrivate::setFocusToTarget ( FocusTarget ,
Qt::FocusReason  )
inlinevirtual

Reimplemented in QQuickWindowPrivate, QWidgetWindowPrivate, and QWidgetWindowPrivate.

Definition at line 87 of file qwindow_p.h.

◆ setMinOrMaxSize()

void QWindowPrivate::setMinOrMaxSize ( QSize * oldSizeMember,
const QSize & size,
qxp::function_ref< void()> funcWidthChanged,
qxp::function_ref< void()> funcHeightChanged )

Definition at line 633 of file qwindow.cpp.

◆ setTopLevelScreen()

void QWindowPrivate::setTopLevelScreen ( QScreen * newScreen,
bool recreate )

Definition at line 520 of file qwindow.cpp.

◆ setTransientParent()

void QWindowPrivate::setTransientParent ( QWindow * parent)

Definition at line 1601 of file qwindow.cpp.

◆ setVisible()

void QWindowPrivate::setVisible ( bool visible)
virtual

◆ topLevelWindow()

QWindow * QWindowPrivate::topLevelWindow ( QWindow::AncestorMode mode = QWindow::IncludeTransients) const

Definition at line 3125 of file qwindow.cpp.

◆ treatAsVisible()

bool QWindowPrivate::treatAsVisible ( ) const
virtual

Reimplemented in QWidgetWindowPrivate, and QWidgetWindowPrivate.

Definition at line 2486 of file qwindow.cpp.

◆ updateDevicePixelRatio()

bool QWindowPrivate::updateDevicePixelRatio ( )

Definition at line 1432 of file qwindow.cpp.

◆ updateSiblingPosition()

void QWindowPrivate::updateSiblingPosition ( SiblingPosition position)

Definition at line 466 of file qwindow.cpp.

◆ updateVisibility()

void QWindowPrivate::updateVisibility ( )

Definition at line 445 of file qwindow.cpp.

◆ windowPalette()

virtual QPalette QWindowPrivate::windowPalette ( ) const
inlinevirtual

Reimplemented in QQuickApplicationWindowPrivate.

Definition at line 59 of file qwindow_p.h.

◆ windowRecreationRequired()

bool QWindowPrivate::windowRecreationRequired ( QScreen * newScreen) const

Definition at line 490 of file qwindow.cpp.

Member Data Documentation

◆ baseSize

QSize QWindowPrivate::baseSize

Definition at line 143 of file qwindow_p.h.

◆ blockedByModalWindow

bool QWindowPrivate::blockedByModalWindow = false

Definition at line 147 of file qwindow_p.h.

◆ contentOrientation

Qt::ScreenOrientation QWindowPrivate::contentOrientation = Qt::PrimaryOrientation

Definition at line 137 of file qwindow_p.h.

◆ cursor

QCursor QWindowPrivate::cursor = {Qt::ArrowCursor}

Definition at line 156 of file qwindow_p.h.

◆ devicePixelRatio

qreal QWindowPrivate::devicePixelRatio = 1.0

Definition at line 125 of file qwindow_p.h.

◆ exposed

bool QWindowPrivate::exposed = false

Definition at line 118 of file qwindow_p.h.

◆ geometry

QRect QWindowPrivate::geometry

Definition at line 124 of file qwindow_p.h.

◆ hasCursor

bool QWindowPrivate::hasCursor = false

Definition at line 157 of file qwindow_p.h.

◆ inClose

bool QWindowPrivate::inClose = false

Definition at line 119 of file qwindow_p.h.

◆ lastComposeTime

QElapsedTimer QWindowPrivate::lastComposeTime

Definition at line 160 of file qwindow_p.h.

◆ mask

QRegion QWindowPrivate::mask

Definition at line 139 of file qwindow_p.h.

◆ maximumSize

QSize QWindowPrivate::maximumSize = {QWINDOWSIZE_MAX, QWINDOWSIZE_MAX}

Definition at line 142 of file qwindow_p.h.

◆ minimumSize

QSize QWindowPrivate::minimumSize = {0, 0}

Definition at line 141 of file qwindow_p.h.

◆ modality

Qt::WindowModality QWindowPrivate::modality = Qt::NonModal

Definition at line 146 of file qwindow_p.h.

◆ opacity

qreal QWindowPrivate::opacity = 1

Definition at line 138 of file qwindow_p.h.

◆ parentWindow

QWindow* QWindowPrivate::parentWindow = nullptr

Definition at line 114 of file qwindow_p.h.

◆ platformWindow

QPlatformWindow* QWindowPrivate::platformWindow = nullptr

Definition at line 115 of file qwindow_p.h.

◆ positionAutomatic

bool QWindowPrivate::positionAutomatic = true

Definition at line 131 of file qwindow_p.h.

◆ positionPolicy

PositionPolicy QWindowPrivate::positionPolicy = WindowFrameExclusive

Definition at line 130 of file qwindow_p.h.

◆ receivedExpose

bool QWindowPrivate::receivedExpose = false

Definition at line 129 of file qwindow_p.h.

◆ requestedFormat

QSurfaceFormat QWindowPrivate::requestedFormat

Definition at line 120 of file qwindow_p.h.

◆ resizeAutomatic

bool QWindowPrivate::resizeAutomatic = true

Definition at line 136 of file qwindow_p.h.

◆ resizeEventPending

bool QWindowPrivate::resizeEventPending = true

Definition at line 128 of file qwindow_p.h.

◆ sizeIncrement

QSize QWindowPrivate::sizeIncrement

Definition at line 144 of file qwindow_p.h.

◆ surfaceType

QWindow::SurfaceType QWindowPrivate::surfaceType = QWindow::RasterSurface

Definition at line 112 of file qwindow_p.h.

◆ topLevelScreen

QPointer<QScreen> QWindowPrivate::topLevelScreen

Definition at line 153 of file qwindow_p.h.

◆ transientParent

QPointer<QWindow> QWindowPrivate::transientParent

Definition at line 152 of file qwindow_p.h.

◆ transientParentPropertySet

bool QWindowPrivate::transientParentPropertySet = false

Definition at line 150 of file qwindow_p.h.

◆ updateRequestPending

bool QWindowPrivate::updateRequestPending = false

Definition at line 149 of file qwindow_p.h.

◆ visibility

QWindow::Visibility QWindowPrivate::visibility = QWindow::Hidden

Definition at line 127 of file qwindow_p.h.

◆ visibilityOnDestroy

bool QWindowPrivate::visibilityOnDestroy = false

Definition at line 117 of file qwindow_p.h.

◆ visible

bool QWindowPrivate::visible = false

Definition at line 116 of file qwindow_p.h.

◆ windowFilePath

QString QWindowPrivate::windowFilePath

Definition at line 122 of file qwindow_p.h.

◆ windowFlags

Qt::WindowFlags QWindowPrivate::windowFlags = Qt::Window

Definition at line 113 of file qwindow_p.h.

◆ windowIcon

QIcon QWindowPrivate::windowIcon

Definition at line 123 of file qwindow_p.h.

◆ windowState

Qt::WindowStates QWindowPrivate::windowState = Qt::WindowNoState

Definition at line 126 of file qwindow_p.h.

◆ windowTitle

QString QWindowPrivate::windowTitle

Definition at line 121 of file qwindow_p.h.


The documentation for this class was generated from the following files: