QtBase
v6.3.1
|
#include <qcocoawindow.h>
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 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 |
QCocoaMenuBar * | m_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, BorderRange > | m_contentBorderAreas |
QHash< quintptr, bool > | m_enabledContentBorderAreas |
Static Public Attributes | |
static QPointer< QCocoaWindow > | s_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 | |
QObject * | sender () 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 | |
QPlatformScreen * | screenForGeometry (const QRect &newGeometry) const |
Friends | |
class | QCocoaBackingStore |
class | QCocoaNativeInterface |
Definition at line 104 of file qcocoawindow.h.
Enumerator | |
---|---|
NoHandleFlags | |
HandleUnconditionally |
Definition at line 245 of file qcocoawindow.h.
Enumerator | |
---|---|
RecreationNotNeeded | |
ParentChanged | |
MissingWindow | |
WindowModalityChanged | |
ContentViewChanged | |
PanelChanged |
Definition at line 213 of file qcocoawindow.h.
QCocoaWindow::QCocoaWindow | ( | QWindow * | tlw, |
WId | nativeHandle = 0 |
||
) |
QCocoaWindow::~QCocoaWindow | ( | ) |
bool QCocoaWindow::alwaysShowToolWindow | ( | ) | const |
Definition at line 1824 of file qcocoawindow.mm.
|
protected |
Definition at line 692 of file qcocoawindow.mm.
|
override |
Definition at line 1949 of file qcocoawindow.mm.
|
protected |
Definition at line 1612 of file qcocoawindow.mm.
|
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.
|
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.
Reimplemented from QPlatformWindow.
Definition at line 1909 of file qcocoawindow.mm.
|
overridevirtual |
Returns the actual surface format of the window.
Reimplemented from QPlatformWindow.
Definition at line 226 of file qcocoawindow.mm.
|
overridevirtual |
Reimplemented from QPlatformWindow.
Definition at line 1960 of file qcocoawindow.mm.
|
inlineoverridevirtual |
Reimplement this method to return whether frame strut events are enabled.
Reimplemented from QPlatformWindow.
Definition at line 188 of file qcocoawindow.h.
|
overridevirtual |
Returns the current geometry of a window
Reimplemented from QPlatformWindow.
Definition at line 256 of file qcocoawindow.mm.
void QCocoaWindow::handleGeometryChange | ( | ) |
Definition at line 1385 of file qcocoawindow.mm.
void QCocoaWindow::handleWindowStateChanged | ( | HandleFlags | flags = NoHandleFlags | ) |
Definition at line 900 of file qcocoawindow.mm.
|
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.
|
overridevirtual |
Reimplement this method return whether the window is in an alert state.
Reimplemented from QPlatformWindow.
Definition at line 978 of file qcocoawindow.mm.
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.
|
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.
|
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.
bool QCocoaWindow::isFixedSize | ( | ) | const |
Definition at line 584 of file qcocoawindow.mm.
|
overridevirtual |
Reimplemented from QPlatformWindow.
Definition at line 251 of file qcocoawindow.mm.
bool QCocoaWindow::isOpaque | ( | ) | const |
|
protected |
Definition at line 831 of file qcocoawindow.mm.
|
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.
QCocoaMenuBar * QCocoaWindow::menubar | ( | ) | const |
NSWindow * QCocoaWindow::nativeWindow | ( | ) | 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.
Reimplemented from QPlatformWindow.
Definition at line 281 of file qcocoawindow.mm.
|
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.
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSViewFrameDidChangeNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSViewGlobalFrameDidChangeNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowDidBecomeKeyNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowDidChangeOcclusionStateNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowDidChangeScreenNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowDidDeminiaturizeNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowDidEndLiveResizeNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowDidEnterFullScreenNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowDidExitFullScreenNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowDidMiniaturizeNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowDidMoveNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowDidOrderOffScreenNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowDidOrderOnScreenAndFinishAnimatingNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowDidResignKeyNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowDidResizeNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowWillEnterFullScreenNotification | ) |
QCocoaWindow::Q_NOTIFICATION_HANDLER | ( | NSWindowWillExitFullScreenNotification | ) |
|
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.
|
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.
void QCocoaWindow::registerTouch | ( | bool | enable | ) |
Definition at line 1787 of file qcocoawindow.mm.
|
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.
|
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.
|
overridevirtual |
Reimplement this method to set whether the window demands attention (for example, by flashing the taskbar icon) depending on enabled.
Reimplemented from QPlatformWindow.
Definition at line 968 of file qcocoawindow.mm.
Definition at line 307 of file qcocoawindow.mm.
|
override |
void QCocoaWindow::setContentBorderThickness | ( | int | topThickness, |
int | bottomThickness | ||
) |
void QCocoaWindow::setEmbeddedInForeignView | ( | ) |
Definition at line 1166 of file qcocoawindow.mm.
|
overridevirtual |
Reimplement this method to set whether frame strut events should be sent to enabled.
Reimplemented from QPlatformWindow.
Definition at line 1974 of file qcocoawindow.mm.
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.
|
overridevirtual |
Reimplemented from QPlatformWindow.
Definition at line 1117 of file qcocoawindow.mm.
Reimplement to be able to let Qt set the mask of a window
Reimplemented from QPlatformWindow.
Definition at line 1101 of file qcocoawindow.mm.
void QCocoaWindow::setMenubar | ( | QCocoaMenuBar * | mb | ) |
|
overridevirtual |
Reimplemented from QPlatformWindow.
Definition at line 1129 of file qcocoawindow.mm.
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.
|
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.
|
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.
void QCocoaWindow::setWindowCursor | ( | NSCursor * | cursor | ) |
Reimplement to set the window file path to filePath
Reimplemented from QPlatformWindow.
Definition at line 930 of file qcocoawindow.mm.
|
overridevirtual |
Requests setting the window flags of this surface to flags.
Reimplemented from QPlatformWindow.
Definition at line 621 of file qcocoawindow.mm.
Reimplement to set the window icon to icon
Reimplemented from QPlatformWindow.
Definition at line 946 of file qcocoawindow.mm.
|
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.
|
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.
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.
Reimplemented from QPlatformWindow.
Definition at line 916 of file qcocoawindow.mm.
bool QCocoaWindow::shouldRefuseKeyWindowAndFirstResponder | ( | ) |
|
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.
Reimplemented from QPlatformWindow.
Definition at line 331 of file qcocoawindow.mm.
bool QCocoaWindow::testContentBorderAreaPosition | ( | int | position | ) | const |
|
protected |
Definition at line 805 of file qcocoawindow.mm.
|
protected |
Definition at line 784 of file qcocoawindow.mm.
void QCocoaWindow::updateNormalGeometry | ( | ) |
Definition at line 296 of file qcocoawindow.mm.
void QCocoaWindow::updateNSToolbar | ( | ) |
Definition at line 1879 of file qcocoawindow.mm.
bool QCocoaWindow::updatesWithDisplayLink | ( | ) | const |
Definition at line 1593 of file qcocoawindow.mm.
void QCocoaWindow::updateTitleBarButtons | ( | Qt::WindowFlags | flags | ) |
Definition at line 590 of file qcocoawindow.mm.
NSView * QCocoaWindow::view | ( | ) | const |
bool QCocoaWindow::windowIsPopupType | ( | Qt::WindowType | type = Qt::Widget | ) | const |
Definition at line 1449 of file qcocoawindow.mm.
NSInteger QCocoaWindow::windowLevel | ( | Qt::WindowFlags | flags | ) |
Definition at line 478 of file qcocoawindow.mm.
bool QCocoaWindow::windowShouldClose | ( | ) |
|
protected |
Definition at line 765 of file qcocoawindow.mm.
NSUInteger QCocoaWindow::windowStyleMask | ( | Qt::WindowFlags | flags | ) |
Definition at line 530 of file qcocoawindow.mm.
void QCocoaWindow::windowWillZoom | ( | ) |
|
overridevirtual |
Reimplement in subclasses to return a handle to the native window
Reimplemented from QPlatformWindow.
Definition at line 1141 of file qcocoawindow.mm.
|
friend |
Definition at line 238 of file qcocoawindow.h.
|
friend |
Definition at line 239 of file qcocoawindow.h.
NSInteger QCocoaWindow::m_alertRequest |
Definition at line 275 of file qcocoawindow.h.
int QCocoaWindow::m_bottomContentBorderThickness |
Definition at line 279 of file qcocoawindow.h.
QHash<quintptr, BorderRange> QCocoaWindow::m_contentBorderAreas |
Definition at line 290 of file qcocoawindow.h.
bool QCocoaWindow::m_drawContentBorderGradient |
Definition at line 277 of file qcocoawindow.h.
Definition at line 291 of file qcocoawindow.h.
QRect QCocoaWindow::m_exposedRect |
Definition at line 269 of file qcocoawindow.h.
bool QCocoaWindow::m_frameStrutEventsEnabled |
Definition at line 268 of file qcocoawindow.h.
bool QCocoaWindow::m_initialized |
Definition at line 262 of file qcocoawindow.h.
bool QCocoaWindow::m_inSetGeometry |
Definition at line 264 of file qcocoawindow.h.
bool QCocoaWindow::m_inSetStyleMask |
Definition at line 265 of file qcocoawindow.h.
bool QCocoaWindow::m_inSetVisible |
Definition at line 263 of file qcocoawindow.h.
Qt::WindowStates QCocoaWindow::m_lastReportedWindowState |
Definition at line 257 of file qcocoawindow.h.
QCocoaMenuBar* QCocoaWindow::m_menubar |
Definition at line 266 of file qcocoawindow.h.
QRect QCocoaWindow::m_normalGeometry |
Definition at line 270 of file qcocoawindow.h.
QCocoaNSWindow* QCocoaWindow::m_nsWindow |
Definition at line 255 of file qcocoawindow.h.
int QCocoaWindow::m_registerTouchCount |
Definition at line 271 of file qcocoawindow.h.
bool QCocoaWindow::m_resizableTransientParent |
Definition at line 272 of file qcocoawindow.h.
int QCocoaWindow::m_topContentBorderThickness |
Definition at line 278 of file qcocoawindow.h.
NSView* QCocoaWindow::m_view |
Definition at line 254 of file qcocoawindow.h.
Qt::WindowModality QCocoaWindow::m_windowModality |
Definition at line 258 of file qcocoawindow.h.
|
static |
Definition at line 274 of file qcocoawindow.h.
|
static |
Definition at line 260 of file qcocoawindow.h.