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
QCocoaWindow Class Reference

#include <qcocoawindow.h>

+ Inheritance diagram for QCocoaWindow:
+ Collaboration diagram for QCocoaWindow:

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
 Called as part of QWindow::create(), after constructing the window.
 
void setGeometry (const QRect &rect) override
 This function is called by Qt whenever a window is moved or resized using the QWindow API.
 
QRect geometry () const override
 Returns the current geometry of a window.
 
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.
 
void setCocoaGeometry (const QRect &rect)
 
void setVisible (bool visible) override
 Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
 
void setWindowFlags (Qt::WindowFlags flags) override
 Requests setting the window flags of this surface to flags.
 
void setWindowState (Qt::WindowStates state) override
 Changes the state of the NSWindow, going in/out of minimize/zoomed/fullscreen.
 
void setWindowTitle (const QString &title) override
 Reimplement to set the window title to title.
 
void setWindowFilePath (const QString &filePath) override
 Reimplement to set the window file path to filePath.
 
void setWindowIcon (const QIcon &icon) override
 Reimplement to set the window icon to icon.
 
void setAlertState (bool enabled) override
 Reimplement this method to set whether the window demands attention (for example, by flashing the taskbar icon) depending on enabled.
 
bool isAlertState () const override
 Reimplement this method return whether the window is in an alert state.
 
void raise () override
 Reimplement to be able to let Qt raise windows to the top of the desktop.
 
void lower () override
 Reimplement to be able to let Qt lower windows to the bottom of the desktop.
 
bool isExposed () const override
 Returns if this window is exposed in the windowing system.
 
bool isEmbedded () const override
 Returns true if the window is a child of a non-Qt window.
 
bool isOpaque () const
 
void propagateSizeHints () override
 Reimplement to propagate the size hints of the QWindow.
 
void setOpacity (qreal level) override
 Reimplement to be able to let Qt set the opacity level of a window.
 
void setMask (const QRegion &region) override
 Reimplement to be able to let Qt set the mask of a window.
 
bool setKeyboardGrabEnabled (bool grab) override
 
bool setMouseGrabEnabled (bool grab) override
 
QMargins frameMargins () const override
 
QSurfaceFormat format () const override
 Returns the actual surface format of the window.
 
bool isForeignWindow () const override
 
void requestUpdate () override
 Requests an QEvent::UpdateRequest event.
 
bool updatesWithDisplayLink () const
 
void deliverUpdateRequest () override
 Delivers an QEvent::UpdateRequest event to the window.
 
void requestActivateWindow () override
 Reimplement to let Qt be able to request activation/focus for a window.
 
WId winId () const override
 Reimplement in subclasses to return a handle to the native window.
 
void setParent (const QPlatformWindow *window) override
 This function is called to enable native child window in QPA.
 
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
 Reimplement to be able to let Qt indicate that the window has been modified.
 
void setFrameStrutEventsEnabled (bool enabled) override
 Reimplement this method to set whether frame strut events should be sent to enabled.
 
bool frameStrutEventsEnabled () const override
 Reimplement this method to return whether frame strut events are enabled.
 
void setMenubar (QCocoaMenuBar *mb)
 
QCocoaMenuBarmenubar () const
 
void setWindowCursor (NSCursor *cursor)
 
void registerTouch (bool enable)
 
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)
 
qreal devicePixelRatio () const override
 Reimplement this function in subclass to return the device pixel ratio for the window.
 
QWindowchildWindowAt (QPoint windowPoint)
 
bool shouldRefuseKeyWindowAndFirstResponder ()
 
bool windowEvent (QEvent *event) override
 Reimplement this method to be able to do any platform specific event handling.
 
QPoint bottomLeftClippedByNSWindowOffset () const override
 
void updateNormalGeometry ()
 
bool isContentView () const
 Checks if the window is the content view of its immediate NSWindow.
 
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)
 Constructs an object with parent object parent.
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects.
 
virtual bool event (QEvent *event)
 This virtual function receives events to an object and should return true if the event e was recognized and processed.
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 Filters events if this object has been installed as an event filter for the watched object.
 
QString objectName () const
 
Q_WEAK_OVERLOAD void setObjectName (const QString &name)
 Sets the object's name to name.
 
void setObjectName (QAnyStringView name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false.
 
bool isWindowType () const
 Returns true if the object is a window; otherwise returns false.
 
bool isQuickItemType () const
 Returns true if the object is a QQuickItem; otherwise returns false.
 
bool signalsBlocked () const noexcept
 Returns true if signals are blocked; otherwise returns false.
 
bool blockSignals (bool b) noexcept
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it).
 
QThreadthread () const
 Returns the thread in which the object lives.
 
bool moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)
 Changes the thread affinity for this object and its children and returns true on success.
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds.
 
int startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 Kills the timer with timer identifier, id.
 
void killTimer (Qt::TimerId id)
 
template<typename T >
findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object.
 
template<typename T >
QList< T > findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
 
template<typename T >
findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
QList< T > findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const QObjectListchildren () const
 Returns a list of child objects.
 
void setParent (QObject *parent)
 Makes the object a child of parent.
 
void installEventFilter (QObject *filterObj)
 Installs an event filter filterObj on this object.
 
void removeEventFilter (QObject *obj)
 Removes an event filter object obj from this object.
 
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
 Dumps a tree of children to the debug output.
 
void dumpObjectInfo () const
 Dumps information about signal connections, etc.
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value.
 
bool setProperty (const char *name, QVariant &&value)
 
QVariant property (const char *name) const
 Returns the value of the object's name property.
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 Returns a pointer to the parent object.
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.
 
- Public Member Functions inherited from QPlatformWindow
 QPlatformWindow (QWindow *window)
 Constructs a platform window with the given top level window.
 
 ~QPlatformWindow () override
 Virtual destructor does not delete its top level window.
 
QWindowwindow () const
 Returns the window which belongs to the QPlatformWindow.
 
QPlatformWindowparent () const
 Returns the parent platform window (or \nullptr if orphan).
 
QPlatformScreenscreen () const override
 Returns the platform screen handle corresponding to this platform window, or null if the window is not associated with a screen.
 
virtual QMargins safeAreaMargins () const
 The safe area margins of a window represent the area that is safe to place content within, without intersecting areas of the screen where system UI is placed, or where a screen bezel may cover the content.
 
virtual bool close ()
 Reimplement to let the platform handle non-spontaneous window close.
 
virtual bool isActive () const
 Returns true if the window should appear active from a style perspective.
 
virtual bool isAncestorOf (const QPlatformWindow *child) const
 Returns true if the window is an ancestor of the given child.
 
virtual QPoint mapToGlobal (const QPoint &pos) const
 Translates the window coordinate pos to global screen coordinates using native methods.
 
QPointF mapToGlobalF (const QPointF &pos) const
 
virtual QPoint mapFromGlobal (const QPoint &pos) const
 Translates the global screen coordinate pos to window coordinates using native methods.
 
QPointF mapFromGlobalF (const QPointF &pos) const
 
virtual void handleContentOrientationChange (Qt::ScreenOrientation orientation)
 Handle changes to the orientation of the platform window's contents.
 
virtual bool startSystemResize (Qt::Edges edges)
 Reimplement this method to start a system resize operation if the system supports it and return true to indicate success.
 
virtual void invalidateSurface ()
 Invalidates the window's surface by releasing its surface buffers.
 
bool hasPendingUpdateRequest () const
 Returns true if the window has a pending update request.
 
QSize windowMinimumSize () const
 Returns the QWindow minimum size.
 
QSize windowMaximumSize () const
 Returns the QWindow maximum size.
 
QSize windowBaseSize () const
 Returns the QWindow base size.
 
QSize windowSizeIncrement () const
 Returns the QWindow size increment.
 
QRect windowGeometry () const
 Returns the QWindow geometry.
 
QRect windowFrameGeometry () const
 Returns the QWindow frame geometry.
 
QRectF windowClosestAcceptableGeometry (const QRectF &nativeRect) const
 
- Public Member Functions inherited from QPlatformSurface
virtual ~QPlatformSurface ()
 
QSurfacesurface () const
 

Static Public Member Functions

static void closeAllPopups ()
 
static void setupPopupMonitor ()
 
static void removePopupMonitor ()
 
- 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)
 \threadsafe
 
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::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 \threadsafe
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 Disconnect a 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)
 Helper function to get initial geometry on windowing systems which do not do smart positioning and also do not provide a means of centering a transient window w.r.t.
 
static QRectF closestAcceptableGeometry (const QWindow *w, const QRectF &nativeRect)
 Returns the closest acceptable geometry for a given geometry before a resize/move event for platforms that support it, for example to implement heightForWidth().
 
- Static Public Member Functions inherited from QPlatformSurface
static bool isRasterSurface (QSurface *surface)
 

Public Attributes

NSView * m_view = nil
 
QCocoaNSWindow * m_nsWindow = nil
 
Qt::WindowStates m_lastReportedWindowState = Qt::WindowNoState
 
Qt::WindowModality m_windowModality = Qt::NonModal
 
bool m_initialized = false
 
bool m_inSetVisible = false
 
bool m_inSetGeometry = false
 
bool m_inSetStyleMask = false
 
QCocoaMenuBarm_menubar = nullptr
 
bool m_frameStrutEventsEnabled = false
 
QRect m_exposedRect
 
QRect m_normalGeometry
 
int m_registerTouchCount = 0
 
bool m_resizableTransientParent = false
 
NSInteger m_alertRequest = NoAlertRequest
 
bool m_drawContentBorderGradient = false
 
QHash< quintptr, BorderRangem_contentBorderAreas
 
QHash< quintptr, bool > m_enabledContentBorderAreas
 

Static Public Attributes

static QPointer< QCocoaWindows_windowUnderMouse
 
static const int NoAlertRequest = -1
 
static id s_globalMouseMonitor = 0
 
static id s_applicationActivationObserver = 0
 

Protected Member Functions

void recreateWindowIfNeeded ()
 Recreates (or removes) the NSWindow for this QWindow, if needed.
 
QCocoaNSWindow * createNSWindow (bool shouldBePanel)
 
Qt::WindowStates windowState () const
 
void applyWindowState (Qt::WindowStates newState)
 
void toggleMaximized ()
 
void toggleFullScreen ()
 
bool isTransitioningToFullScreen () const
 
bool startSystemMove () override
 Reimplement this method to start a system move operation if the system supports it and return true to indicate success.
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr.
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal.
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 This event handler can be reimplemented in a subclass to receive timer events for the object.
 
virtual void childEvent (QChildEvent *event)
 This event handler can be reimplemented in a subclass to receive child events.
 
virtual void customEvent (QEvent *event)
 This event handler can be reimplemented in a subclass to receive custom events.
 
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
 Helper function for finding the new screen for newGeometry in response to a geometry changed event.
 

Friends

class QCocoaBackingStore
 
class QCocoaNativeInterface
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 \threadsafe
 
- Signals inherited from QObject
void destroyed (QObject *=nullptr)
 This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked.
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 This signal is emitted after the object's name has been changed.
 
- Static Protected Member Functions inherited from QPlatformWindow
static QString formatWindowTitle (const QString &title, const QString &separator)
 Call this method to put together a window title composed of title separator the application display name.
 
static QSize constrainWindowSize (const QSize &size)
 Returns a size with both dimensions bounded to [0, QWINDOWSIZE_MAX].
 
- 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
 

Detailed Description

Definition at line 68 of file qcocoawindow.h.

Member Enumeration Documentation

◆ HandleFlags

Enumerator
NoHandleFlags 
HandleUnconditionally 

Definition at line 210 of file qcocoawindow.h.

◆ RecreationReason

Enumerator
RecreationNotNeeded 
ParentChanged 
MissingWindow 
WindowModalityChanged 
ContentViewChanged 
PanelChanged 

Definition at line 178 of file qcocoawindow.h.

Constructor & Destructor Documentation

◆ QCocoaWindow()

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

Definition at line 101 of file qcocoawindow.mm.

References m_view, qCDebug, and QPlatformWindow::window().

+ Here is the call graph for this function:

◆ ~QCocoaWindow()

QCocoaWindow::~QCocoaWindow ( )

Definition at line 146 of file qcocoawindow.mm.

References QCocoaIntegration::instance(), isForeignWindow(), m_nsWindow, m_view, QPlatformWindow::parent(), pool, qCDebug, QCocoaWindowWillReleaseQNSViewNotification, release(), and QPlatformWindow::window().

+ Here is the call graph for this function:

Member Function Documentation

◆ alwaysShowToolWindow()

bool QCocoaWindow::alwaysShowToolWindow ( ) const

Definition at line 1828 of file qcocoawindow.mm.

References QPlatformWindow::window().

Referenced by createNSWindow().

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

◆ applyContentBorderThickness()

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

Definition at line 1918 of file qcocoawindow.mm.

References isContentView(), m_contentBorderAreas, m_drawContentBorderGradient, m_enabledContentBorderAreas, m_view, qMax(), QHash< Key, T >::value(), and QPlatformWindow::window().

Referenced by createNSWindow(), registerContentBorderArea(), setContentBorderAreaEnabled(), and setContentBorderEnabled().

+ 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 706 of file qcocoawindow.mm.

References QWindowPrivate::effectiveState(), HandleUnconditionally, handleWindowStateChanged(), isContentView(), m_view, newState(), qCDebug, qWarning, QObject::sender(), toggleFullScreen(), toggleMaximized(), QPlatformWindow::window(), Qt::WindowFullScreen, Qt::WindowMaximized, Qt::WindowMinimized, Qt::WindowNoState, and windowState().

Referenced by setVisible(), and setWindowState().

+ 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 2058 of file qcocoawindow.mm.

References frame, and m_view.

◆ childWindowAt()

QWindow * QCocoaWindow::childWindowAt ( QPoint windowPoint)

Definition at line 1999 of file qcocoawindow.mm.

References child, QObject::children(), childWindowAt(), and QPlatformWindow::window().

Referenced by childWindowAt().

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

◆ closeAllPopups()

void QCocoaWindow::closeAllPopups ( )
static

Definition at line 1633 of file qcocoawindow.mm.

References QGuiApplicationPrivate::instance(), and removePopupMonitor().

Referenced by setupPopupMonitor().

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

◆ createNSWindow()

QCocoaNSWindow * QCocoaWindow::createNSWindow ( bool shouldBePanel)
protected

Definition at line 1699 of file qcocoawindow.mm.

References alwaysShowToolWindow(), Qt::ApplicationActive, QGuiApplication::applicationState(), applyContentBorderThickness(), QWindow::flags, QPlatformScreen::geometry(), geometry(), QCocoaScreen::get(), QWindowSystemInterface::handleWindowScreenChanged(), init(), m_view, m_windowModality, QCocoaScreen::mapToNative(), QWindow::modality, pool, Qt::Popup, Qt::PortraitOrientation, QGuiApplication::primaryScreen, qCDebug, qCWarning, qnsview_cast(), rect, release(), QPlatformWindow::screen(), QGuiApplication::screens(), selector, setupPopupMonitor(), Qt::Tool, QPlatformWindow::window(), windowLevel(), and windowStyleMask().

Referenced by recreateWindowIfNeeded().

+ 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 1617 of file qcocoawindow.mm.

References QPlatformWindow::deliverUpdateRequest(), qCDebug, and QPlatformWindow::window().

+ Here is the call 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 1988 of file qcocoawindow.mm.

References m_view.

◆ format()

QSurfaceFormat QCocoaWindow::format ( ) const
overridevirtual

Returns the actual surface format of the window.

Reimplemented from QPlatformWindow.

Definition at line 183 of file qcocoawindow.mm.

References QPlatformWindow::window().

Referenced by updatesWithDisplayLink().

+ 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 2069 of file qcocoawindow.mm.

References isContentView(), and m_view.

Referenced by setGeometry().

+ 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 152 of file qcocoawindow.h.

References m_frameStrutEventsEnabled.

◆ geometry()

QRect QCocoaWindow::geometry ( ) const
overridevirtual

Returns the current geometry of a window.

Reimplemented from QPlatformWindow.

Definition at line 213 of file qcocoawindow.mm.

References QPlatformWindow::geometry(), isEmbedded(), m_view, QCocoaScreen::mapFromNative(), position(), and QPlatformWindow::window().

Referenced by createNSWindow(), QCocoaEventDispatcherPrivate::currentModalSession(), handleExposeEvent(), handleGeometryChange(), normalGeometry(), propagateSizeHints(), setGeometry(), setParent(), and updateNormalGeometry().

+ 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 1444 of file qcocoawindow.mm.

References QRegion::boundingRect(), geometry(), QRegion::isEmpty(), isExposed(), m_exposedRect, m_view, qCDebug, and QPlatformWindow::window().

+ Here is the call graph for this function:

◆ handleGeometryChange()

void QCocoaWindow::handleGeometryChange ( )

Definition at line 1407 of file qcocoawindow.mm.

References QEventLoop::ExcludeSocketNotifiers, QEventLoop::ExcludeUserInputEvents, QWindowSystemInterface::flushWindowSystemEvents(), geometry(), QWindowSystemInterface::handleGeometryChange(), isContentView(), isEmbedded(), m_initialized, m_inSetGeometry, m_inSetStyleMask, m_view, QCocoaScreen::mapFromNative(), qCDebug, and QPlatformWindow::window().

Referenced by setVisible().

+ 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 927 of file qcocoawindow.mm.

References HandleUnconditionally, m_lastReportedWindowState, qCDebug, QPlatformWindow::window(), and windowState().

Referenced by applyWindowState().

+ 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 111 of file qcocoawindow.mm.

References QPlatformWindow::d_ptr, defaultWindowHeight, defaultWindowWidth, QPlatformWindow::initialGeometry(), isForeignWindow(), m_initialized, m_view, pool, qCDebug, recreateWindowIfNeeded(), QPlatformWindowPrivate::rect, QPlatformWindow::setGeometry(), setGeometry(), setMask(), QHighDpi::toNativeLocalRegion(), QPlatformWindow::window(), and QPlatformWindow::windowGeometry().

+ 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 1005 of file qcocoawindow.mm.

References m_alertRequest, and NoAlertRequest.

◆ 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 1490 of file qcocoawindow.mm.

References m_view.

Referenced by applyContentBorderThickness(), applyWindowState(), frameMargins(), handleGeometryChange(), lower(), normalGeometry(), propagateSizeHints(), raise(), recreateWindowIfNeeded(), setCocoaGeometry(), setOpacity(), setVisible(), setWindowFilePath(), setWindowFlags(), setWindowIcon(), setWindowModified(), setWindowTitle(), testContentBorderAreaPosition(), updateNormalGeometry(), and updateTitleBarButtons().

+ 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 1052 of file qcocoawindow.mm.

References m_view, QObject::parent(), and QPlatformWindow::window().

Referenced by geometry(), handleGeometryChange(), recreateWindowIfNeeded(), and setCocoaGeometry().

+ 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 1047 of file qcocoawindow.mm.

References QRect::isEmpty(), and m_exposedRect.

Referenced by handleExposeEvent().

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

◆ isFixedSize()

bool QCocoaWindow::isFixedSize ( ) const

Definition at line 582 of file qcocoawindow.mm.

References QSize::isValid(), QPlatformWindow::windowMaximumSize(), and QPlatformWindow::windowMinimumSize().

Referenced by updateTitleBarButtons().

+ 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 208 of file qcocoawindow.mm.

References m_view.

Referenced by ~QCocoaWindow(), initialize(), recreateWindowIfNeeded(), setCocoaGeometry(), and setWindowCursor().

+ Here is the caller graph for this function:

◆ isOpaque()

bool QCocoaWindow::isOpaque ( ) const

Definition at line 1068 of file qcocoawindow.mm.

References QSurfaceFormat::alphaBufferSize(), QWindow::format(), GLint(), QRegion::isEmpty(), QWindow::opacity, QSurface::supportsOpenGL(), QPlatformSurface::surface(), and QPlatformWindow::window().

+ Here is the call graph for this function:

◆ isTransitioningToFullScreen()

bool QCocoaWindow::isTransitioningToFullScreen ( ) const
protected

Definition at line 850 of file qcocoawindow.mm.

References m_view, and QPlatformWindow::window().

Referenced by windowState().

+ 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 1035 of file qcocoawindow.mm.

References isContentView(), m_view, qCDebug, and QPlatformWindow::window().

Referenced by registerContentBorderArea().

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

◆ menubar()

QCocoaMenuBar * QCocoaWindow::menubar ( ) const

Definition at line 1847 of file qcocoawindow.mm.

References m_menubar.

Referenced by QCocoaMenuBar::~QCocoaMenuBar().

+ Here is the caller graph for this function:

◆ nativeWindow()

NSWindow * QCocoaWindow::nativeWindow ( ) const

Definition at line 1174 of file qcocoawindow.mm.

References m_view.

Referenced by QCocoaEventDispatcherPrivate::currentModalSession(), and windowLevel().

+ 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 238 of file qcocoawindow.mm.

References geometry(), isContentView(), m_normalGeometry, Qt::WindowFullScreen, Qt::WindowMaximized, and windowState().

+ 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 1081 of file qcocoawindow.mm.

References geometry(), QSize::height(), isContentView(), QSize::isEmpty(), QSize::isNull(), QSize::isValid(), m_view, pool, qCDebug, rect, updateTitleBarButtons(), QSize::width(), QPlatformWindow::window(), QPlatformWindow::windowBaseSize(), QPlatformWindow::windowMaximumSize(), QPlatformWindow::windowMinimumSize(), and QPlatformWindow::windowSizeIncrement().

+ Here is the call 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 1010 of file qcocoawindow.mm.

References isContentView(), m_view, pool, qCDebug, and QPlatformWindow::window().

+ 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 1501 of file qcocoawindow.mm.

References ContentViewChanged, createNSWindow(), Qt::Dialog, isContentView(), isEmbedded(), isForeignWindow(), m_nsWindow, m_view, m_windowModality, MissingWindow, PanelChanged, QPlatformWindow::parent(), ParentChanged, pool, Qt::Popup, Q_ASSERT, qCDebug, qnsview_cast(), RecreationNotNeeded, Qt::SubWindow, QPlatformWindow::window(), and WindowModalityChanged.

Referenced by initialize(), setParent(), and setVisible().

+ 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 1900 of file qcocoawindow.mm.

References applyContentBorderThickness(), lower(), and m_contentBorderAreas.

+ Here is the call graph for this function:

◆ registerTouch()

void QCocoaWindow::registerTouch ( bool enable)

Definition at line 1891 of file qcocoawindow.mm.

References m_registerTouchCount, and m_view.

◆ removePopupMonitor()

void QCocoaWindow::removePopupMonitor ( )
static

Definition at line 1640 of file qcocoawindow.mm.

References s_applicationActivationObserver, and s_globalMouseMonitor.

Referenced by QCocoaIntegration::~QCocoaIntegration(), closeAllPopups(), and setupPopupMonitor().

+ Here is the caller graph for this function:

◆ 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::handleFocusWindowChanged(QWindow *w) would be sufficient.

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

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

Reimplemented from QPlatformWindow.

Definition at line 1623 of file qcocoawindow.mm.

References m_view, and pool.

◆ 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 an interval that is at most 5 ms. If the window's associated screen reports a \l{QPlatformScreen::refreshRate()}{refresh rate} higher than 60 Hz, the interval is scaled down to a valid smaller than 5. 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 1595 of file qcocoawindow.mm.

References qCDebug, QPlatformWindow::requestUpdate(), QCocoaScreen::requestUpdate(), QPlatformWindow::screen(), updatesWithDisplayLink(), and QPlatformWindow::window().

+ 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 995 of file qcocoawindow.mm.

References m_alertRequest, and NoAlertRequest.

◆ setCocoaGeometry()

void QCocoaWindow::setCocoaGeometry ( const QRect & rect)

Definition at line 264 of file qcocoawindow.mm.

References isContentView(), isEmbedded(), isForeignWindow(), m_view, QCocoaScreen::mapToNative(), pool, qCDebug, rect, QPlatformWindow::setGeometry(), and QPlatformWindow::window().

Referenced by setGeometry(), and setParent().

+ 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 1906 of file qcocoawindow.mm.

References applyContentBorderThickness(), QHash< Key, T >::insert(), and m_enabledContentBorderAreas.

+ Here is the call graph for this function:

◆ setContentBorderEnabled()

void QCocoaWindow::setContentBorderEnabled ( bool enable)
override

Definition at line 1912 of file qcocoawindow.mm.

References applyContentBorderThickness(), and m_drawContentBorderGradient.

+ Here is the call graph for this function:

◆ setEmbeddedInForeignView()

void QCocoaWindow::setEmbeddedInForeignView ( )

Definition at line 1179 of file qcocoawindow.mm.

References m_nsWindow.

◆ 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 2083 of file qcocoawindow.mm.

References enabled, and m_frameStrutEventsEnabled.

◆ 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 188 of file qcocoawindow.mm.

References frameMargins(), geometry(), QMargins::left(), m_inSetGeometry, qCDebug, qt_window_private(), rect, setCocoaGeometry(), QMargins::top(), QPlatformWindow::window(), and QWindowPrivate::WindowFrameInclusive.

Referenced by QCocoaEventDispatcherPrivate::currentModalSession(), initialize(), and setVisible().

+ 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 1144 of file qcocoawindow.mm.

◆ 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 1128 of file qcocoawindow.mm.

References QRegion::isEmpty(), m_view, qCDebug, and QPlatformWindow::window().

Referenced by initialize().

+ 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 1842 of file qcocoawindow.mm.

References m_menubar.

Referenced by QCocoaMenuBar::~QCocoaMenuBar(), and QCocoaMenuBar::handleReparent().

+ Here is the caller graph for this function:

◆ setMouseGrabEnabled()

bool QCocoaWindow::setMouseGrabEnabled ( bool grab)
overridevirtual

Reimplemented from QPlatformWindow.

Definition at line 1149 of file qcocoawindow.mm.

◆ 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 1119 of file qcocoawindow.mm.

References isContentView(), m_view, and qCDebug.

+ Here is the call 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 1159 of file qcocoawindow.mm.

References geometry(), qCDebug, recreateWindowIfNeeded(), setCocoaGeometry(), and QPlatformWindow::window().

+ Here is the call graph for this function:

◆ setupPopupMonitor()

void QCocoaWindow::setupPopupMonitor ( )
static

Definition at line 1652 of file qcocoawindow.mm.

References button, closeAllPopups(), cocoaButton2QtButton(), cocoaEvent2QtMouseEvent(), currentlyPressedMouseButtons(), QWindowSystemInterface::handleMouseEvent(), QGuiApplicationPrivate::instance(), QCocoaScreen::mapFromNative(), QEvent::MouseMove, queue, removePopupMonitor(), s_applicationActivationObserver, s_globalMouseMonitor, s_windowUnderMouse, and QPlatformWindow::window().

Referenced by createNSWindow().

+ Here is the call graph for this function:
+ Here is the caller 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 307 of file qcocoawindow.mm.

References Qt::ApplicationModal, applyWindowState(), QEventLoop::ExcludeUserInputEvents, QWindowSystemInterface::flushWindowSystemEvents(), QObjectPrivate::get(), handleGeometryChange(), isContentView(), m_initialized, m_inSetVisible, m_resizableTransientParent, m_view, pool, Qt::Popup, Q_ASSERT_X, qApp, qCDebug, qCWarning, recreateWindowIfNeeded(), setGeometry(), Qt::Sheet, QPlatformWindow::window(), QPlatformWindow::windowGeometry(), Qt::WindowMinimized, Qt::WindowModal, and windowState().

+ Here is the call graph for this function:

◆ setWindowCursor()

void QCocoaWindow::setWindowCursor ( NSCursor * cursor)

Definition at line 1852 of file qcocoawindow.mm.

References context, cursor, isForeignWindow(), m_view, qCDebug, qCInfo, qnsview_cast(), and view().

+ Here is the call graph for this function:

◆ setWindowFilePath()

void QCocoaWindow::setWindowFilePath ( const QString & title)
overridevirtual

Reimplement to set the window file path to filePath.

Reimplemented from QPlatformWindow.

Definition at line 957 of file qcocoawindow.mm.

References icon, isContentView(), m_view, pool, setWindowIcon(), title, and QPlatformWindow::window().

Referenced by setWindowTitle().

+ 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 635 of file qcocoawindow.mm.

References Qt::CustomizeWindowHint, Qt::Dialog, Qt::FramelessWindowHint, isContentView(), m_inSetStyleMask, m_view, Qt::NoDropShadowWindowHint, pool, Qt::Popup, setWindowTitle(), QWindow::title, updateTitleBarButtons(), QPlatformWindow::window(), Qt::WindowFullscreenButtonHint, windowLevel(), windowStyleMask(), Qt::WindowTransparentForInput, and Qt::WindowType_Mask.

+ Here is the call 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 973 of file qcocoawindow.mm.

References icon, isContentView(), QIcon::isNull(), m_view, pool, and qGuiApp.

Referenced by setWindowFilePath().

+ 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 1833 of file qcocoawindow.mm.

References isContentView(), and m_view.

+ 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 700 of file qcocoawindow.mm.

References applyWindowState(), isVisible(), state, and QPlatformWindow::window().

+ Here is the call 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 943 of file qcocoawindow.mm.

References isContentView(), QString::isEmpty(), m_view, pool, setWindowFilePath(), title, and QPlatformWindow::window().

Referenced by setWindowFlags().

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

◆ shouldRefuseKeyWindowAndFirstResponder()

bool QCocoaWindow::shouldRefuseKeyWindowAndFirstResponder ( )

Definition at line 2011 of file qcocoawindow.mm.

References QGuiApplicationPrivate::instance(), QVariant::isValid(), m_inSetVisible, QWindow::modality, QObject::property(), qCDebug, QVariant::toBool(), QPlatformWindow::window(), Qt::WindowDoesNotAcceptFocus, Qt::WindowModal, and Qt::WindowTransparentForInput.

+ 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 288 of file qcocoawindow.mm.

References m_view.

◆ testContentBorderAreaPosition()

bool QCocoaWindow::testContentBorderAreaPosition ( int position) const

Definition at line 1973 of file qcocoawindow.mm.

References isContentView(), m_drawContentBorderGradient, m_view, and position().

+ Here is the call graph for this function:

◆ toggleFullScreen()

void QCocoaWindow::toggleFullScreen ( )
protected

Definition at line 824 of file qcocoawindow.mm.

References m_view, QObject::sender(), toggleFullScreen(), and QPlatformWindow::window().

Referenced by applyWindowState(), and toggleFullScreen().

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

◆ toggleMaximized()

void QCocoaWindow::toggleMaximized ( )
protected

Definition at line 803 of file qcocoawindow.mm.

References m_view, QObject::sender(), and QPlatformWindow::window().

Referenced by applyWindowState().

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

◆ updateNormalGeometry()

void QCocoaWindow::updateNormalGeometry ( )

Definition at line 253 of file qcocoawindow.mm.

References geometry(), isContentView(), m_normalGeometry, Qt::WindowNoState, and windowState().

Referenced by windowWillZoom().

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

◆ updatesWithDisplayLink()

bool QCocoaWindow::updatesWithDisplayLink ( ) const

Definition at line 1611 of file qcocoawindow.mm.

References format(), and QSurfaceFormat::swapInterval().

Referenced by requestUpdate().

+ 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 588 of file qcocoawindow.mm.

References button, Qt::CustomizeWindowHint, Qt::Dialog, enabled, QWindowPrivate::get(), isContentView(), isFixedSize(), m_view, QPlatformWindow::window(), Qt::WindowCloseButtonHint, Qt::WindowFullscreenButtonHint, Qt::WindowMaximizeButtonHint, and Qt::WindowMinimizeButtonHint.

Referenced by propagateSizeHints(), setWindowFlags(), and windowEvent().

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

◆ view()

NSView * QCocoaWindow::view ( ) const

Definition at line 1169 of file qcocoawindow.mm.

References m_view.

Referenced by setWindowCursor().

+ Here is the caller graph for this function:

◆ windowEvent()

bool QCocoaWindow::windowEvent ( QEvent * event)
overridevirtual

Reimplement this method to be able to do any platform specific event handling.

All non-synthetic events for window() are passed to this function before being sent to QWindow::event().

Return true if the event should not be passed on to the QWindow.

Subclasses should always call the base class implementation.

Reimplemented from QPlatformWindow.

Definition at line 2044 of file qcocoawindow.mm.

References updateTitleBarButtons(), QPlatformWindow::window(), QEvent::WindowBlocked, QPlatformWindow::windowEvent(), and QEvent::WindowUnblocked.

+ Here is the call graph for this function:

◆ windowIsPopupType()

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

Definition at line 1471 of file qcocoawindow.mm.

References Qt::Popup, Qt::Tool, Qt::Widget, and QPlatformWindow::window().

Referenced by windowStyleMask().

+ 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 474 of file qcocoawindow.mm.

References nativeWindow(), Qt::Popup, qMax(), Qt::Tool, Qt::ToolTip, Qt::Window, QPlatformWindow::window(), windowLevel(), Qt::WindowStaysOnTopHint, and Qt::WindowType_Mask.

Referenced by createNSWindow(), setWindowFlags(), and windowLevel().

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

◆ windowShouldClose()

bool QCocoaWindow::windowShouldClose ( )

Definition at line 1386 of file qcocoawindow.mm.

References m_view, qCDebug, and QPlatformWindow::window().

+ Here is the call graph for this function:

◆ windowState()

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

Definition at line 780 of file qcocoawindow.mm.

References isTransitioningToFullScreen(), m_lastReportedWindowState, m_view, QPlatformWindow::window(), Qt::WindowFullScreen, Qt::WindowMaximized, Qt::WindowMinimized, and Qt::WindowNoState.

Referenced by applyWindowState(), handleWindowStateChanged(), normalGeometry(), setVisible(), and updateNormalGeometry().

+ 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 526 of file qcocoawindow.mm.

References Qt::CustomizeWindowHint, Qt::FramelessWindowHint, m_drawContentBorderGradient, m_view, Qt::Popup, Qt::Tool, windowIsPopupType(), Qt::WindowTitleHint, and Qt::WindowType_Mask.

Referenced by createNSWindow(), and setWindowFlags().

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

◆ windowWillZoom()

void QCocoaWindow::windowWillZoom ( )

Definition at line 819 of file qcocoawindow.mm.

References updateNormalGeometry().

+ 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 1154 of file qcocoawindow.mm.

References m_view.

Friends And Related Symbol Documentation

◆ QCocoaBackingStore

friend class QCocoaBackingStore
friend

Definition at line 203 of file qcocoawindow.h.

◆ QCocoaNativeInterface

friend class QCocoaNativeInterface
friend

Definition at line 204 of file qcocoawindow.h.

Member Data Documentation

◆ m_alertRequest

NSInteger QCocoaWindow::m_alertRequest = NoAlertRequest

Definition at line 245 of file qcocoawindow.h.

Referenced by isAlertState(), and setAlertState().

◆ m_contentBorderAreas

QHash<quintptr, BorderRange> QCocoaWindow::m_contentBorderAreas

Definition at line 258 of file qcocoawindow.h.

Referenced by applyContentBorderThickness(), and registerContentBorderArea().

◆ m_drawContentBorderGradient

bool QCocoaWindow::m_drawContentBorderGradient = false

◆ m_enabledContentBorderAreas

QHash<quintptr, bool> QCocoaWindow::m_enabledContentBorderAreas

Definition at line 259 of file qcocoawindow.h.

Referenced by applyContentBorderThickness(), and setContentBorderAreaEnabled().

◆ m_exposedRect

QRect QCocoaWindow::m_exposedRect

Definition at line 239 of file qcocoawindow.h.

Referenced by handleExposeEvent(), and isExposed().

◆ m_frameStrutEventsEnabled

bool QCocoaWindow::m_frameStrutEventsEnabled = false

Definition at line 238 of file qcocoawindow.h.

Referenced by frameStrutEventsEnabled(), and setFrameStrutEventsEnabled().

◆ m_initialized

bool QCocoaWindow::m_initialized = false

Definition at line 231 of file qcocoawindow.h.

Referenced by handleGeometryChange(), initialize(), and setVisible().

◆ m_inSetGeometry

bool QCocoaWindow::m_inSetGeometry = false

Definition at line 233 of file qcocoawindow.h.

Referenced by handleGeometryChange(), and setGeometry().

◆ m_inSetStyleMask

bool QCocoaWindow::m_inSetStyleMask = false

Definition at line 234 of file qcocoawindow.h.

Referenced by handleGeometryChange(), and setWindowFlags().

◆ m_inSetVisible

bool QCocoaWindow::m_inSetVisible = false

Definition at line 232 of file qcocoawindow.h.

Referenced by setVisible(), and shouldRefuseKeyWindowAndFirstResponder().

◆ m_lastReportedWindowState

Qt::WindowStates QCocoaWindow::m_lastReportedWindowState = Qt::WindowNoState

Definition at line 226 of file qcocoawindow.h.

Referenced by handleWindowStateChanged(), and windowState().

◆ m_menubar

QCocoaMenuBar* QCocoaWindow::m_menubar = nullptr

Definition at line 236 of file qcocoawindow.h.

Referenced by menubar(), and setMenubar().

◆ m_normalGeometry

QRect QCocoaWindow::m_normalGeometry

Definition at line 240 of file qcocoawindow.h.

Referenced by normalGeometry(), and updateNormalGeometry().

◆ m_nsWindow

QCocoaNSWindow* QCocoaWindow::m_nsWindow = nil

Definition at line 224 of file qcocoawindow.h.

Referenced by ~QCocoaWindow(), recreateWindowIfNeeded(), and setEmbeddedInForeignView().

◆ m_registerTouchCount

int QCocoaWindow::m_registerTouchCount = 0

Definition at line 241 of file qcocoawindow.h.

Referenced by registerTouch().

◆ m_resizableTransientParent

bool QCocoaWindow::m_resizableTransientParent = false

Definition at line 242 of file qcocoawindow.h.

Referenced by setVisible().

◆ m_view

◆ m_windowModality

Qt::WindowModality QCocoaWindow::m_windowModality = Qt::NonModal

Definition at line 227 of file qcocoawindow.h.

Referenced by createNSWindow(), and recreateWindowIfNeeded().

◆ NoAlertRequest

const int QCocoaWindow::NoAlertRequest = -1
static

Definition at line 244 of file qcocoawindow.h.

Referenced by isAlertState(), and setAlertState().

◆ s_applicationActivationObserver

id QCocoaWindow::s_applicationActivationObserver = 0
inlinestatic

Definition at line 262 of file qcocoawindow.h.

Referenced by removePopupMonitor(), and setupPopupMonitor().

◆ s_globalMouseMonitor

id QCocoaWindow::s_globalMouseMonitor = 0
inlinestatic

Definition at line 261 of file qcocoawindow.h.

Referenced by removePopupMonitor(), and setupPopupMonitor().

◆ s_windowUnderMouse

QPointer< QCocoaWindow > QCocoaWindow::s_windowUnderMouse
static

Definition at line 229 of file qcocoawindow.h.

Referenced by setupPopupMonitor().


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