QtBase  v6.3.1
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Friends | List of all members
QCocoaWindow Class Reference

#include <qcocoawindow.h>

Inheritance diagram for QCocoaWindow:
Inheritance graph
[legend]
Collaboration diagram for QCocoaWindow:
Collaboration graph
[legend]

Classes

struct  BorderRange
 

Public Types

enum  RecreationReason {
  RecreationNotNeeded = 0 , ParentChanged = 0x1 , MissingWindow = 0x2 , WindowModalityChanged = 0x4 ,
  ContentViewChanged = 0x10 , PanelChanged = 0x20
}
 
enum  HandleFlags { NoHandleFlags = 0 , HandleUnconditionally = 1 }
 

Public Member Functions

 QCocoaWindow (QWindow *tlw, WId nativeHandle=0)
 
 ~QCocoaWindow ()
 
void initialize () override
 
void setGeometry (const QRect &rect) override
 
QRect geometry () const override
 
QRect normalGeometry () const override
 the geometry of the window as it will appear when shown as a normal (not maximized or full screen) top-level window. More...
 
void setCocoaGeometry (const QRect &rect)
 
void setVisible (bool visible) override
 
void setWindowFlags (Qt::WindowFlags flags) override
 
void setWindowState (Qt::WindowStates state) override
 
void setWindowTitle (const QString &title) override
 
void setWindowFilePath (const QString &filePath) override
 
void setWindowIcon (const QIcon &icon) override
 
void setAlertState (bool enabled) override
 
bool isAlertState () const override
 
void raise () override
 
void lower () override
 
bool isExposed () const override
 
bool isEmbedded () const override
 
bool isOpaque () const
 
void propagateSizeHints () override
 
void setOpacity (qreal level) override
 
void setMask (const QRegion &region) override
 
bool setKeyboardGrabEnabled (bool grab) override
 
bool setMouseGrabEnabled (bool grab) override
 
QMargins frameMargins () const override
 
QSurfaceFormat format () const override
 
bool isForeignWindow () const override
 
void requestUpdate () override
 
bool updatesWithDisplayLink () const
 
void deliverUpdateRequest () override
 
void requestActivateWindow () override
 
WId winId () const override
 
void setParent (const QPlatformWindow *window) override
 
NSView * view () const
 
NSWindow * nativeWindow () const
 
void setEmbeddedInForeignView ()
 
 Q_NOTIFICATION_HANDLER (NSViewFrameDidChangeNotification) void viewDidChangeFrame()
 
 Q_NOTIFICATION_HANDLER (NSViewGlobalFrameDidChangeNotification) void viewDidChangeGlobalFrame()
 
 Q_NOTIFICATION_HANDLER (NSWindowDidMoveNotification) void windowDidMove()
 
 Q_NOTIFICATION_HANDLER (NSWindowDidResizeNotification) void windowDidResize()
 
 Q_NOTIFICATION_HANDLER (NSWindowDidEndLiveResizeNotification) void windowDidEndLiveResize()
 
 Q_NOTIFICATION_HANDLER (NSWindowDidBecomeKeyNotification) void windowDidBecomeKey()
 
 Q_NOTIFICATION_HANDLER (NSWindowDidResignKeyNotification) void windowDidResignKey()
 
 Q_NOTIFICATION_HANDLER (NSWindowDidMiniaturizeNotification) void windowDidMiniaturize()
 
 Q_NOTIFICATION_HANDLER (NSWindowDidDeminiaturizeNotification) void windowDidDeminiaturize()
 
 Q_NOTIFICATION_HANDLER (NSWindowWillEnterFullScreenNotification) void windowWillEnterFullScreen()
 
 Q_NOTIFICATION_HANDLER (NSWindowDidEnterFullScreenNotification) void windowDidEnterFullScreen()
 
 Q_NOTIFICATION_HANDLER (NSWindowWillExitFullScreenNotification) void windowWillExitFullScreen()
 
 Q_NOTIFICATION_HANDLER (NSWindowDidExitFullScreenNotification) void windowDidExitFullScreen()
 
 Q_NOTIFICATION_HANDLER (NSWindowDidOrderOnScreenAndFinishAnimatingNotification) void windowDidOrderOnScreen()
 
 Q_NOTIFICATION_HANDLER (NSWindowDidOrderOffScreenNotification) void windowDidOrderOffScreen()
 
 Q_NOTIFICATION_HANDLER (NSWindowDidChangeOcclusionStateNotification) void windowDidChangeOcclusionState()
 
 Q_NOTIFICATION_HANDLER (NSWindowDidChangeScreenNotification) void windowDidChangeScreen()
 
void windowWillZoom ()
 
bool windowShouldClose ()
 
bool windowIsPopupType (Qt::WindowType type=Qt::Widget) const
 
NSInteger windowLevel (Qt::WindowFlags flags)
 
NSUInteger windowStyleMask (Qt::WindowFlags flags)
 
void updateTitleBarButtons (Qt::WindowFlags flags)
 
bool isFixedSize () const
 
bool setWindowModified (bool modified) override
 
void setFrameStrutEventsEnabled (bool enabled) override
 
bool frameStrutEventsEnabled () const override
 
void setMenubar (QCocoaMenuBar *mb)
 
QCocoaMenuBarmenubar () const
 
void setWindowCursor (NSCursor *cursor)
 
void registerTouch (bool enable)
 
void setContentBorderThickness (int topThickness, int bottomThickness)
 
void registerContentBorderArea (quintptr identifier, int upper, int lower)
 
void setContentBorderAreaEnabled (quintptr identifier, bool enable)
 
void setContentBorderEnabled (bool enable) override
 
bool testContentBorderAreaPosition (int position) const
 
void applyContentBorderThickness (NSWindow *window=nullptr)
 
void updateNSToolbar ()
 
qreal devicePixelRatio () const override
 
QWindowchildWindowAt (QPoint windowPoint)
 
bool shouldRefuseKeyWindowAndFirstResponder ()
 
QPoint bottomLeftClippedByNSWindowOffset () const override
 
void updateNormalGeometry ()
 
bool isContentView () const
 
bool alwaysShowToolWindow () const
 
void handleGeometryChange ()
 
void handleWindowStateChanged (HandleFlags flags=NoHandleFlags)
 
void handleExposeEvent (const QRegion &region)
 
- Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 
virtual ~QObject ()
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
QString objectName () const
 
void setObjectName (const QString &name)
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const noexcept
 
bool blockSignals (bool b) noexcept
 
QThreadthread () const
 
void moveToThread (QThread *thread)
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 
template<typename T >
T findChild (const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<typename T >
QList< TfindChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<typename T >
QList< TfindChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
const QObjectListchildren () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
 
bool disconnect (const QObject *receiver, const char *member=nullptr) const
 
void dumpObjectTree () const
 
void dumpObjectInfo () const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 
bool inherits (const char *classname) const
 
- Public Member Functions inherited from QPlatformWindow
 QPlatformWindow (QWindow *window)
 
 ~QPlatformWindow () override
 
QWindowwindow () const
 
QPlatformWindowparent () const
 
QPlatformScreenscreen () const override
 
virtual QMargins safeAreaMargins () const
 
virtual bool close ()
 
virtual bool isActive () const
 
virtual bool isAncestorOf (const QPlatformWindow *child) const
 
virtual QPoint mapToGlobal (const QPoint &pos) const
 
QPointF mapToGlobalF (const QPointF &pos) const
 
virtual QPoint mapFromGlobal (const QPoint &pos) const
 
QPointF mapFromGlobalF (const QPointF &pos) const
 
virtual void handleContentOrientationChange (Qt::ScreenOrientation orientation)
 
virtual bool windowEvent (QEvent *event)
 
virtual bool startSystemResize (Qt::Edges edges)
 
virtual void invalidateSurface ()
 
bool hasPendingUpdateRequest () const
 
QSize windowMinimumSize () const
 
QSize windowMaximumSize () const
 
QSize windowBaseSize () const
 
QSize windowSizeIncrement () const
 
QRect windowGeometry () const
 
QRect windowFrameGeometry () const
 
QRectF windowClosestAcceptableGeometry (const QRectF &nativeRect) const
 
- Public Member Functions inherited from QPlatformSurface
virtual ~QPlatformSurface ()
 
QSurfacesurface () const
 

Public Attributes

NSView * m_view
 
QCocoaNSWindow * m_nsWindow
 
Qt::WindowStates m_lastReportedWindowState
 
Qt::WindowModality m_windowModality
 
bool m_initialized
 
bool m_inSetVisible
 
bool m_inSetGeometry
 
bool m_inSetStyleMask
 
QCocoaMenuBarm_menubar
 
bool m_frameStrutEventsEnabled
 
QRect m_exposedRect
 
QRect m_normalGeometry
 
int m_registerTouchCount
 
bool m_resizableTransientParent
 
NSInteger m_alertRequest
 
bool m_drawContentBorderGradient
 
int m_topContentBorderThickness
 
int m_bottomContentBorderThickness
 
QHash< quintptr, BorderRangem_contentBorderAreas
 
QHash< quintptr, bool > m_enabledContentBorderAreas
 

Static Public Attributes

static QPointer< QCocoaWindows_windowUnderMouse
 
static const int NoAlertRequest = -1
 

Protected Member Functions

void recreateWindowIfNeeded ()
 
QCocoaNSWindow * createNSWindow (bool shouldBePanel)
 
Qt::WindowState windowState () const
 
void applyWindowState (Qt::WindowStates newState)
 
void toggleMaximized ()
 
void toggleFullScreen ()
 
bool isTransitioningToFullScreen () const
 
bool startSystemMove () override
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
 
- Protected Member Functions inherited from QPlatformWindow
QPlatformScreenscreenForGeometry (const QRect &newGeometry) const
 

Friends

class QCocoaBackingStore
 
class QCocoaNativeInterface
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 
- Signals inherited from QObject
void destroyed (QObject *=nullptr)
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 
- Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
static QMetaObject::Connection ::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 slot)
 
static QMetaObject::Connection ::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static std::enable_if< QtPrivate::FunctionPointer< Func2 >::ArgumentCount==-1 &&!std::is_convertible_v< Func2, const char * >, QMetaObject::Connection >::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 slot)
 
template<typename Func1 , typename Func2 >
static std::enable_if< QtPrivate::FunctionPointer< Func2 >::ArgumentCount==-1 &&!std::is_convertible_v< Func2, const char * >, QMetaObject::Connection >::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
 
template<typename Func1 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
 
- Static Public Member Functions inherited from QPlatformWindow
static QRect initialGeometry (const QWindow *w, const QRect &initialGeometry, int defaultWidth, int defaultHeight, const QScreen **resultingScreenReturn=nullptr)
 
static QRectF closestAcceptableGeometry (const QWindow *w, const QRectF &nativeRect)
 
- Static Public Member Functions inherited from QPlatformSurface
static bool isRasterSurface (QSurface *surface)
 
- Static Protected Member Functions inherited from QPlatformWindow
static QString formatWindowTitle (const QString &title, const QString &separator)
 
static QSize constrainWindowSize (const QSize &size)
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Protected Attributes inherited from QPlatformWindow
QScopedPointer< QPlatformWindowPrivated_ptr
 
- Properties inherited from QObject
QString objectName
 the name of this object More...
 

Detailed Description

Definition at line 104 of file qcocoawindow.h.

Member Enumeration Documentation

◆ HandleFlags

Enumerator
NoHandleFlags 
HandleUnconditionally 

Definition at line 245 of file qcocoawindow.h.

◆ RecreationReason

Enumerator
RecreationNotNeeded 
ParentChanged 
MissingWindow 
WindowModalityChanged 
ContentViewChanged 
PanelChanged 

Definition at line 213 of file qcocoawindow.h.

Constructor & Destructor Documentation

◆ QCocoaWindow()

QCocoaWindow::QCocoaWindow ( QWindow tlw,
WId  nativeHandle = 0 
)

Definition at line 137 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ ~QCocoaWindow()

QCocoaWindow::~QCocoaWindow ( )

Definition at line 191 of file qcocoawindow.mm.

Here is the call graph for this function:

Member Function Documentation

◆ alwaysShowToolWindow()

bool QCocoaWindow::alwaysShowToolWindow ( ) const

Definition at line 1734 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ applyContentBorderThickness()

void QCocoaWindow::applyContentBorderThickness ( NSWindow *  window = nullptr)

Definition at line 1824 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyWindowState()

void QCocoaWindow::applyWindowState ( Qt::WindowStates  newState)
protected

Definition at line 692 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bottomLeftClippedByNSWindowOffset()

QPoint QCocoaWindow::bottomLeftClippedByNSWindowOffset ( ) const
override

Definition at line 1949 of file qcocoawindow.mm.

◆ childWindowAt()

QWindow * QCocoaWindow::childWindowAt ( QPoint  windowPoint)

Definition at line 1920 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ createNSWindow()

QCocoaNSWindow * QCocoaWindow::createNSWindow ( bool  shouldBePanel)
protected

Definition at line 1612 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deliverUpdateRequest()

void QCocoaWindow::deliverUpdateRequest ( )
overridevirtual

Delivers an QEvent::UpdateRequest event to the window.

QPlatformWindow subclasses can re-implement this function to provide e.g. logging or tracing of the delivery, but should always call the base class function.

Reimplemented from QPlatformWindow.

Definition at line 1599 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ devicePixelRatio()

qreal QCocoaWindow::devicePixelRatio ( ) const
overridevirtual

Reimplement this function in subclass to return the device pixel ratio for the window. This is the ratio between physical pixels and device-independent pixels.

See also
QPlatformWindow::devicePixelRatio();

Reimplemented from QPlatformWindow.

Definition at line 1909 of file qcocoawindow.mm.

◆ format()

QSurfaceFormat QCocoaWindow::format ( ) const
overridevirtual

Returns the actual surface format of the window.

Reimplemented from QPlatformWindow.

Definition at line 226 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ frameMargins()

QMargins QCocoaWindow::frameMargins ( ) const
overridevirtual

Reimplemented from QPlatformWindow.

Definition at line 1960 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ frameStrutEventsEnabled()

bool QCocoaWindow::frameStrutEventsEnabled ( ) const
inlineoverridevirtual

Reimplement this method to return whether frame strut events are enabled.

Reimplemented from QPlatformWindow.

Definition at line 188 of file qcocoawindow.h.

◆ geometry()

QRect QCocoaWindow::geometry ( ) const
overridevirtual

Returns the current geometry of a window

Reimplemented from QPlatformWindow.

Definition at line 256 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleExposeEvent()

void QCocoaWindow::handleExposeEvent ( const QRegion region)

Definition at line 1422 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ handleGeometryChange()

void QCocoaWindow::handleGeometryChange ( )

Definition at line 1385 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleWindowStateChanged()

void QCocoaWindow::handleWindowStateChanged ( HandleFlags  flags = NoHandleFlags)

Definition at line 900 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize()

void QCocoaWindow::initialize ( )
overridevirtual

Called as part of QWindow::create(), after constructing the window. Platforms should prefer to do initialization here instead of in the constructor, as the platform window object will be fully constructed, and associated to the corresponding QWindow, allowing synchronous event delivery.

Reimplemented from QPlatformWindow.

Definition at line 164 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ isAlertState()

bool QCocoaWindow::isAlertState ( ) const
overridevirtual

Reimplement this method return whether the window is in an alert state.

See also
setAlertState()
Since
5.1

Reimplemented from QPlatformWindow.

Definition at line 978 of file qcocoawindow.mm.

◆ isContentView()

bool QCocoaWindow::isContentView ( ) const

Checks if the window is the content view of its immediate NSWindow.

Being the content view of a NSWindow means the QWindow is the highest accessible NSView object in the window's view hierarchy.

This is the case if the QWindow is a top level window.

Definition at line 1468 of file qcocoawindow.mm.

Here is the caller graph for this function:

◆ isEmbedded()

bool QCocoaWindow::isEmbedded ( ) const
overridevirtual

Returns true if the window is a child of a non-Qt window.

A embedded window has no parent platform window as reflected though parent(), but will have a native parent window.

Reimplemented from QPlatformWindow.

Definition at line 1025 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isExposed()

bool QCocoaWindow::isExposed ( ) const
overridevirtual

Returns if this window is exposed in the windowing system.

An exposeEvent() is sent every time this value changes.

Reimplemented from QPlatformWindow.

Definition at line 1020 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ isFixedSize()

bool QCocoaWindow::isFixedSize ( ) const

Definition at line 584 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isForeignWindow()

bool QCocoaWindow::isForeignWindow ( ) const
overridevirtual

Reimplemented from QPlatformWindow.

Definition at line 251 of file qcocoawindow.mm.

Here is the caller graph for this function:

◆ isOpaque()

bool QCocoaWindow::isOpaque ( ) const

Definition at line 1041 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ isTransitioningToFullScreen()

bool QCocoaWindow::isTransitioningToFullScreen ( ) const
protected

Definition at line 831 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lower()

void QCocoaWindow::lower ( )
overridevirtual

Reimplement to be able to let Qt lower windows to the bottom of the desktop

Reimplemented from QPlatformWindow.

Definition at line 1008 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ menubar()

QCocoaMenuBar * QCocoaWindow::menubar ( ) const

Definition at line 1753 of file qcocoawindow.mm.

Here is the caller graph for this function:

◆ nativeWindow()

NSWindow * QCocoaWindow::nativeWindow ( ) const

Definition at line 1161 of file qcocoawindow.mm.

Here is the caller graph for this function:

◆ normalGeometry()

QRect QCocoaWindow::normalGeometry ( ) const
overridevirtual

the geometry of the window as it will appear when shown as a normal (not maximized or full screen) top-level window.

For child windows this property always holds an empty rectangle.

See also
QWidget::normalGeometry()

Reimplemented from QPlatformWindow.

Definition at line 281 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ propagateSizeHints()

void QCocoaWindow::propagateSizeHints ( )
overridevirtual

Reimplement to propagate the size hints of the QWindow.

The size hints include QWindow::minimumSize(), QWindow::maximumSize(), QWindow::sizeIncrement(), and QWindow::baseSize().

Reimplemented from QPlatformWindow.

Definition at line 1054 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Q_NOTIFICATION_HANDLER() [1/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSViewFrameDidChangeNotification  )

◆ Q_NOTIFICATION_HANDLER() [2/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSViewGlobalFrameDidChangeNotification  )

◆ Q_NOTIFICATION_HANDLER() [3/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowDidBecomeKeyNotification  )

◆ Q_NOTIFICATION_HANDLER() [4/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowDidChangeOcclusionStateNotification  )

◆ Q_NOTIFICATION_HANDLER() [5/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowDidChangeScreenNotification  )

◆ Q_NOTIFICATION_HANDLER() [6/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowDidDeminiaturizeNotification  )

◆ Q_NOTIFICATION_HANDLER() [7/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowDidEndLiveResizeNotification  )

◆ Q_NOTIFICATION_HANDLER() [8/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowDidEnterFullScreenNotification  )

◆ Q_NOTIFICATION_HANDLER() [9/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowDidExitFullScreenNotification  )

◆ Q_NOTIFICATION_HANDLER() [10/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowDidMiniaturizeNotification  )

◆ Q_NOTIFICATION_HANDLER() [11/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowDidMoveNotification  )

◆ Q_NOTIFICATION_HANDLER() [12/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowDidOrderOffScreenNotification  )

◆ Q_NOTIFICATION_HANDLER() [13/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowDidOrderOnScreenAndFinishAnimatingNotification  )

◆ Q_NOTIFICATION_HANDLER() [14/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowDidResignKeyNotification  )

◆ Q_NOTIFICATION_HANDLER() [15/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowDidResizeNotification  )

◆ Q_NOTIFICATION_HANDLER() [16/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowWillEnterFullScreenNotification  )

◆ Q_NOTIFICATION_HANDLER() [17/17]

QCocoaWindow::Q_NOTIFICATION_HANDLER ( NSWindowWillExitFullScreenNotification  )

◆ raise()

void QCocoaWindow::raise ( )
overridevirtual

Reimplement to be able to let Qt raise windows to the top of the desktop

Reimplemented from QPlatformWindow.

Definition at line 983 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ recreateWindowIfNeeded()

void QCocoaWindow::recreateWindowIfNeeded ( )
protected

Recreates (or removes) the NSWindow for this QWindow, if needed.

A QWindow may need a corresponding NSWindow/NSPanel, depending on whether or not it's a top level or not, window flags, etc.

Definition at line 1479 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerContentBorderArea()

void QCocoaWindow::registerContentBorderArea ( quintptr  identifier,
int  upper,
int  lower 
)

Definition at line 1806 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ registerTouch()

void QCocoaWindow::registerTouch ( bool  enable)

Definition at line 1787 of file qcocoawindow.mm.

◆ requestActivateWindow()

void QCocoaWindow::requestActivateWindow ( )
overridevirtual

Reimplement to let Qt be able to request activation/focus for a window

Some window systems will probably not have callbacks for this functionality, and then calling QWindowSystemInterface::handleWindowActivated(QWindow *w) would be sufficient.

If the window system has some event handling/callbacks then call QWindowSystemInterface::handleWindowActivated(QWindow *w) when the window system gives the notification.

Default implementation calls QWindowSystem::handleWindowActivated(QWindow *w)

Reimplemented from QPlatformWindow.

Definition at line 1605 of file qcocoawindow.mm.

◆ requestUpdate()

void QCocoaWindow::requestUpdate ( )
overridevirtual

Requests an QEvent::UpdateRequest event. The event will be delivered to the QWindow.

QPlatformWindow subclasses can re-implement this function to provide display refresh synchronized updates. The event should be delivered using QPlatformWindow::deliverUpdateRequest() to not get out of sync with the internal state of QWindow.

The default implementation posts an UpdateRequest event to the window after 5 ms. The additional time is there to give the event loop a bit of idle time to gather system events.

Reimplemented from QPlatformWindow.

Definition at line 1580 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ setAlertState()

void QCocoaWindow::setAlertState ( bool  enable)
overridevirtual

Reimplement this method to set whether the window demands attention (for example, by flashing the taskbar icon) depending on enabled.

See also
isAlertState()
Since
5.1

Reimplemented from QPlatformWindow.

Definition at line 968 of file qcocoawindow.mm.

◆ setCocoaGeometry()

void QCocoaWindow::setCocoaGeometry ( const QRect rect)

Definition at line 307 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setContentBorderAreaEnabled()

void QCocoaWindow::setContentBorderAreaEnabled ( quintptr  identifier,
bool  enable 
)

Definition at line 1812 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ setContentBorderEnabled()

void QCocoaWindow::setContentBorderEnabled ( bool  enable)
override

Definition at line 1818 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ setContentBorderThickness()

void QCocoaWindow::setContentBorderThickness ( int  topThickness,
int  bottomThickness 
)

Definition at line 1796 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ setEmbeddedInForeignView()

void QCocoaWindow::setEmbeddedInForeignView ( )

Definition at line 1166 of file qcocoawindow.mm.

◆ setFrameStrutEventsEnabled()

void QCocoaWindow::setFrameStrutEventsEnabled ( bool  enabled)
overridevirtual

Reimplement this method to set whether frame strut events should be sent to enabled.

See also
frameStrutEventsEnabled

Reimplemented from QPlatformWindow.

Definition at line 1974 of file qcocoawindow.mm.

◆ setGeometry()

void QCocoaWindow::setGeometry ( const QRect rect)
overridevirtual

This function is called by Qt whenever a window is moved or resized using the QWindow API.

Unless you also override QPlatformWindow::geometry(), you need to call the baseclass implementation of this function in any override of QPlatformWindow::setGeometry(), as QWindow::geometry() is expected to report back the set geometry until a confirmation (or rejection) of the new geometry comes back from the window manager and is reported via QWindowSystemInterface::handleGeometryChange().

Window move/resizes can also be triggered spontaneously by the window manager, or as a response to an earlier requested move/resize via the Qt APIs. There is no need to call this function from the window manager callback, instead call QWindowSystemInterface::handleGeometryChange().

The position(x, y) part of the rect might be inclusive or exclusive of the window frame as returned by frameMargins(). You can detect this in the plugin by checking qt_window_private(window())->positionPolicy.

Reimplemented from QPlatformWindow.

Definition at line 231 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setKeyboardGrabEnabled()

bool QCocoaWindow::setKeyboardGrabEnabled ( bool  grab)
overridevirtual

Reimplemented from QPlatformWindow.

Definition at line 1117 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ setMask()

void QCocoaWindow::setMask ( const QRegion region)
overridevirtual

Reimplement to be able to let Qt set the mask of a window

Reimplemented from QPlatformWindow.

Definition at line 1101 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMenubar()

void QCocoaWindow::setMenubar ( QCocoaMenuBar mb)

Definition at line 1748 of file qcocoawindow.mm.

Here is the caller graph for this function:

◆ setMouseGrabEnabled()

bool QCocoaWindow::setMouseGrabEnabled ( bool  grab)
overridevirtual

Reimplemented from QPlatformWindow.

Definition at line 1129 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ setOpacity()

void QCocoaWindow::setOpacity ( qreal  level)
overridevirtual

Reimplement to be able to let Qt set the opacity level of a window

Reimplemented from QPlatformWindow.

Definition at line 1092 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setParent()

void QCocoaWindow::setParent ( const QPlatformWindow parent)
overridevirtual

This function is called to enable native child window in QPA. It is common not to support this feature in Window systems, but can be faked. When this function is called all geometry of this platform window will be relative to the parent.

Reimplemented from QPlatformWindow.

Definition at line 1146 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ setVisible()

void QCocoaWindow::setVisible ( bool  visible)
overridevirtual

Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.

The default implementation sends a synchronous expose event.

Reimplemented from QPlatformWindow.

Definition at line 350 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ setWindowCursor()

void QCocoaWindow::setWindowCursor ( NSCursor *  cursor)

Definition at line 1758 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ setWindowFilePath()

void QCocoaWindow::setWindowFilePath ( const QString filePath)
overridevirtual

Reimplement to set the window file path to filePath

Reimplemented from QPlatformWindow.

Definition at line 930 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setWindowFlags()

void QCocoaWindow::setWindowFlags ( Qt::WindowFlags  flags)
overridevirtual

Requests setting the window flags of this surface to flags.

Reimplemented from QPlatformWindow.

Definition at line 621 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setWindowIcon()

void QCocoaWindow::setWindowIcon ( const QIcon icon)
overridevirtual

Reimplement to set the window icon to icon

Reimplemented from QPlatformWindow.

Definition at line 946 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setWindowModified()

bool QCocoaWindow::setWindowModified ( bool  modified)
overridevirtual

Reimplement to be able to let Qt indicate that the window has been modified. Return true if the native window supports setting the modified flag, false otherwise.

Reimplemented from QPlatformWindow.

Definition at line 1739 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ setWindowState()

void QCocoaWindow::setWindowState ( Qt::WindowStates  state)
overridevirtual

Changes the state of the NSWindow, going in/out of minimize/zoomed/fullscreen

When this is called from QWindow::setWindowState(), the QWindow state has not been updated yet, so window()->windowState() will reflect the previous state that was reported to QtGui.

Reimplemented from QPlatformWindow.

Definition at line 686 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setWindowTitle()

void QCocoaWindow::setWindowTitle ( const QString title)
overridevirtual

Reimplement to set the window title to title.

The implementation might want to append the application display name to the window title, like Windows and Linux do.

See also
QGuiApplication::applicationDisplayName()

Reimplemented from QPlatformWindow.

Definition at line 916 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shouldRefuseKeyWindowAndFirstResponder()

bool QCocoaWindow::shouldRefuseKeyWindowAndFirstResponder ( )

Definition at line 1932 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ startSystemMove()

bool QCocoaWindow::startSystemMove ( )
overrideprotectedvirtual

Reimplement this method to start a system move operation if the system supports it and return true to indicate success.

The default implementation is empty and does nothing.

Since
5.15

Reimplemented from QPlatformWindow.

Definition at line 331 of file qcocoawindow.mm.

◆ testContentBorderAreaPosition()

bool QCocoaWindow::testContentBorderAreaPosition ( int  position) const

Definition at line 1894 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ toggleFullScreen()

void QCocoaWindow::toggleFullScreen ( )
protected

Definition at line 805 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggleMaximized()

void QCocoaWindow::toggleMaximized ( )
protected

Definition at line 784 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateNormalGeometry()

void QCocoaWindow::updateNormalGeometry ( )

Definition at line 296 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateNSToolbar()

void QCocoaWindow::updateNSToolbar ( )

Definition at line 1879 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updatesWithDisplayLink()

bool QCocoaWindow::updatesWithDisplayLink ( ) const

Definition at line 1593 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateTitleBarButtons()

void QCocoaWindow::updateTitleBarButtons ( Qt::WindowFlags  flags)

Definition at line 590 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ view()

NSView * QCocoaWindow::view ( ) const

Definition at line 1156 of file qcocoawindow.mm.

Here is the caller graph for this function:

◆ windowIsPopupType()

bool QCocoaWindow::windowIsPopupType ( Qt::WindowType  type = Qt::Widget) const

Definition at line 1449 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ windowLevel()

NSInteger QCocoaWindow::windowLevel ( Qt::WindowFlags  flags)

Definition at line 478 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ windowShouldClose()

bool QCocoaWindow::windowShouldClose ( )

Definition at line 1364 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ windowState()

Qt::WindowState QCocoaWindow::windowState ( ) const
protected

Definition at line 765 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ windowStyleMask()

NSUInteger QCocoaWindow::windowStyleMask ( Qt::WindowFlags  flags)

Definition at line 530 of file qcocoawindow.mm.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ windowWillZoom()

void QCocoaWindow::windowWillZoom ( )

Definition at line 800 of file qcocoawindow.mm.

Here is the call graph for this function:

◆ winId()

WId QCocoaWindow::winId ( ) const
overridevirtual

Reimplement in subclasses to return a handle to the native window

Reimplemented from QPlatformWindow.

Definition at line 1141 of file qcocoawindow.mm.

Friends And Related Function Documentation

◆ QCocoaBackingStore

friend class QCocoaBackingStore
friend

Definition at line 238 of file qcocoawindow.h.

◆ QCocoaNativeInterface

friend class QCocoaNativeInterface
friend

Definition at line 239 of file qcocoawindow.h.

Member Data Documentation

◆ m_alertRequest

NSInteger QCocoaWindow::m_alertRequest

Definition at line 275 of file qcocoawindow.h.

◆ m_bottomContentBorderThickness

int QCocoaWindow::m_bottomContentBorderThickness

Definition at line 279 of file qcocoawindow.h.

◆ m_contentBorderAreas

QHash<quintptr, BorderRange> QCocoaWindow::m_contentBorderAreas

Definition at line 290 of file qcocoawindow.h.

◆ m_drawContentBorderGradient

bool QCocoaWindow::m_drawContentBorderGradient

Definition at line 277 of file qcocoawindow.h.

◆ m_enabledContentBorderAreas

QHash<quintptr, bool> QCocoaWindow::m_enabledContentBorderAreas

Definition at line 291 of file qcocoawindow.h.

◆ m_exposedRect

QRect QCocoaWindow::m_exposedRect

Definition at line 269 of file qcocoawindow.h.

◆ m_frameStrutEventsEnabled

bool QCocoaWindow::m_frameStrutEventsEnabled

Definition at line 268 of file qcocoawindow.h.

◆ m_initialized

bool QCocoaWindow::m_initialized

Definition at line 262 of file qcocoawindow.h.

◆ m_inSetGeometry

bool QCocoaWindow::m_inSetGeometry

Definition at line 264 of file qcocoawindow.h.

◆ m_inSetStyleMask

bool QCocoaWindow::m_inSetStyleMask

Definition at line 265 of file qcocoawindow.h.

◆ m_inSetVisible

bool QCocoaWindow::m_inSetVisible

Definition at line 263 of file qcocoawindow.h.

◆ m_lastReportedWindowState

Qt::WindowStates QCocoaWindow::m_lastReportedWindowState

Definition at line 257 of file qcocoawindow.h.

◆ m_menubar

QCocoaMenuBar* QCocoaWindow::m_menubar

Definition at line 266 of file qcocoawindow.h.

◆ m_normalGeometry

QRect QCocoaWindow::m_normalGeometry

Definition at line 270 of file qcocoawindow.h.

◆ m_nsWindow

QCocoaNSWindow* QCocoaWindow::m_nsWindow

Definition at line 255 of file qcocoawindow.h.

◆ m_registerTouchCount

int QCocoaWindow::m_registerTouchCount

Definition at line 271 of file qcocoawindow.h.

◆ m_resizableTransientParent

bool QCocoaWindow::m_resizableTransientParent

Definition at line 272 of file qcocoawindow.h.

◆ m_topContentBorderThickness

int QCocoaWindow::m_topContentBorderThickness

Definition at line 278 of file qcocoawindow.h.

◆ m_view

NSView* QCocoaWindow::m_view

Definition at line 254 of file qcocoawindow.h.

◆ m_windowModality

Qt::WindowModality QCocoaWindow::m_windowModality

Definition at line 258 of file qcocoawindow.h.

◆ NoAlertRequest

const int QCocoaWindow::NoAlertRequest = -1
static

Definition at line 274 of file qcocoawindow.h.

◆ s_windowUnderMouse

QPointer< QCocoaWindow > QCocoaWindow::s_windowUnderMouse
static

Definition at line 260 of file qcocoawindow.h.


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