Qt 4.8
Classes | Functions | Variables
qdesktopwidget_win.cpp File Reference
#include "qdesktopwidget.h"
#include "qt_windows.h"
#include "qapplication_p.h"
#include <private/qsystemlibrary_p.h>
#include <qvector.h>
#include <limits.h>
#include <sipapi.h>
#include "qwidget_p.h"
#include "qdebug.h"

Go to the source code of this file.

Classes

class  QDesktopWidgetPrivate
 
struct  QDesktopWidgetPrivate::MONITORINFO
 

Functions

BOOL QT_WIN_CALLBACK enumCallback (HMONITOR hMonitor, HDC, LPRECT, LPARAM)
 

Variables

static int screen_number = 0
 

Function Documentation

◆ enumCallback()

BOOL QT_WIN_CALLBACK enumCallback ( HMONITOR  hMonitor,
HDC  ,
LPRECT  ,
LPARAM   
)

Definition at line 110 of file qdesktopwidget_win.cpp.

Referenced by QDesktopWidgetPrivate::init().

111 {
115  // Get the MONITORINFO block
117  memset(&info, 0, sizeof(QDesktopWidgetPrivate::MONITORINFO));
119  BOOL res = QDesktopWidgetPrivate::getMonitorInfo(hMonitor, &info);
120  if (!res) {
121  (*QDesktopWidgetPrivate::rects)[screen_number] = QRect();
122  (*QDesktopWidgetPrivate::workrects)[screen_number] = QRect();
123  return true;
124  }
125 
126  // Fill list of rects
127  RECT r = info.rcMonitor;
128  QRect qr(QPoint(r.left, r.top), QPoint(r.right - 1, r.bottom - 1));
129  (*QDesktopWidgetPrivate::rects)[screen_number] = qr;
130 
131  r = info.rcWork;
132  qr = QRect(QPoint(r.left, r.top), QPoint(r.right - 1, r.bottom - 1));
133  (*QDesktopWidgetPrivate::workrects)[screen_number] = qr;
134 
135  if (info.dwFlags & 0x00000001) //MONITORINFOF_PRIMARY
137 
138  ++screen_number;
139  // Stop the enumeration if we have them all
140  return true;
141 }
static int screen_number
static mach_timebase_info_data_t info
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
static InfoFunc getMonitorInfo
static QVector< QRect > * rects
static QVector< QRect > * workrects
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58

Variable Documentation

◆ screen_number

int screen_number = 0
static

Definition at line 93 of file qdesktopwidget_win.cpp.

Referenced by QDesktopWidgetPrivate::cleanup(), and enumCallback().