76 #import <Cocoa/Cocoa.h> 80 #include <private/qt_mac_p.h> 82 #include <private/qt_cocoa_helpers_mac_p.h> 83 #include <private/qdesktopwidget_mac_p.h> 111 return qdesktopWidgetImplementation();
133 NSArray *displays = [NSScreen screens];
138 NSRect primaryRect = [[displays objectAtIndex:0] frame];
140 NSRect r = [[displays objectAtIndex:i] frame];
141 int flippedY = - r.origin.y +
142 primaryRect.size.height - r.size.height;
144 r.size.width, r.size.height));
146 r = [[displays objectAtIndex:i] visibleFrame];
147 flippedY = - r.origin.y +
148 primaryRect.size.height - r.size.height;
150 r.size.width, r.size.height));
174 return qdesktopWidgetImplementation()->appScreen;
179 return qdesktopWidgetImplementation()->screenCount;
189 return qdesktopWidgetImplementation()->availableRect(screen);
194 return qdesktopWidgetImplementation()->screenRect(screen);
205 int maxSize = -1, maxScreen = -1;
210 if (size > maxSize && sect.
width() > 0 && sect.
height() > 0) {
221 int closestScreen = -1;
222 int shortestDistance =
INT_MAX;
226 if (thisDistance < shortestDistance) {
227 shortestDistance = thisDistance;
231 return closestScreen;
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
int width() const
Returns the width of the rectangle.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QRect intersected(const QRect &other) const
Returns the intersection of this rectangle and the given rectangle.
int height() const
Returns the height of the rectangle.
void setObjectName(const QString &name)
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
void clear()
Removes all the elements from the vector and releases the memory used by the vector.
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
void append(const T &t)
Inserts value at the end of the vector.
The QResizeEvent class contains event parameters for resize events.
void moveTopLeft(const QPoint &p)
Moves the rectangle, leaving the top-left corner at the given position.
const T & at(int i) const
Returns the item at index position i in the vector.
The QPoint class defines a point in the plane using integer precision.
The QRect class defines a rectangle in the plane using integer precision.
#define QT_USE_NAMESPACE
This macro expands to using QT_NAMESPACE if QT_NAMESPACE is defined and nothing otherwise.