45 #include <private/qsystemlibrary_p.h> 98 static inline void qt_get_sip_info(
QRect &rect)
101 memset(&sip, 0,
sizeof(SIPINFO));
102 sip.cbSize =
sizeof(SIPINFO);
103 if (SipGetInfo(&sip))
104 rect =
QRect(
QPoint(sip.rcVisibleDesktop.left, sip.rcVisibleDesktop.top),
105 QPoint(sip.rcVisibleDesktop.right - 1, sip.rcVisibleDesktop.bottom - 1));
163 screenCount = GetSystemMetrics(80);
180 screenCount = GetSystemMetrics(SM_CMONITORS);
193 #if defined(Q_WS_WINCE_WM) 197 workrects->
resize(screenCount);
199 (*workrects)[j] = qr;
262 return d_func()->primaryScreen;
267 return d_func()->screenCount;
282 # pragma warning(push) 283 # pragma warning(disable : 4189) 289 for(
int i=0; i <
d->workrects->size(); ++i)
290 qt_get_sip_info((*
d->workrects)[i]);
292 if (screen < 0 || screen >=
d->screenCount)
293 screen =
d->primaryScreen;
295 return d->workrects->at(screen);
311 return d->primaryScreen;
320 for (
int i = 0; i <
d->screenCount; ++i) {
321 QRect sect =
d->rects->at(i).intersected(frame);
323 if (size > maxSize && sect.
width() > 0 && sect.
height() > 0) {
336 int closestScreen = -1;
337 int shortestDistance =
INT_MAX;
339 for (
int i = 0; i <
d->screenCount; ++i) {
340 int thisDistance =
d->pointToRect(point,
d->rects->at(i));
341 if (thisDistance < shortestDistance) {
342 shortestDistance = thisDistance;
347 return closestScreen;
355 int oldscreencount =
d->screenCount;
360 for(
int i=0; i <
d->workrects->size(); ++i)
361 qt_get_sip_info((*
d->workrects)[i]);
364 for (
int i = 0; i <
qMin(oldscreencount,
d->screenCount); ++i) {
365 const QRect oldrect = oldrects[i];
366 const QRect newrect =
d->rects->at(i);
367 if (oldrect != newrect)
371 for (
int j = 0; j <
qMin(oldscreencount,
d->screenCount); ++j) {
372 const QRect oldrect = oldworkrects[j];
373 const QRect newrect =
d->workrects->at(j);
374 if (oldrect != newrect)
375 emit workAreaResized(j);
378 if (oldscreencount !=
d->screenCount) {
379 emit screenCountChanged(
d->screenCount);
384 # pragma warning(pop)
static mach_timebase_info_data_t info
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
void replace(int i, const T &t)
Replaces the item at index position i with value.
int width() const
Returns the width of the rectangle.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int height() const
Returns the height of the rectangle.
void resize(int size)
Sets the size of the vector to size.
#define QT_BEGIN_NAMESPACE
This macro expands to.
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.
void * resolve(const char *symbol)
The QPoint class defines a point in the plane using integer precision.
The QRect class defines a rectangle in the plane using integer precision.