Qt 4.8
Classes | Public Types | Public Functions | Static Public Functions | Public Variables | Static Public Variables | List of all members
QDesktopWidgetPrivate Class Reference

#include <qdesktopwidget_qpa_p.h>

Inheritance diagram for QDesktopWidgetPrivate:
QWidgetPrivate QWidgetPrivate QWidgetPrivate QObjectPrivate QObjectPrivate QObjectPrivate QObjectData QObjectData QObjectData

Classes

struct  MONITORINFO
 

Public Types

typedef BOOL(WINAPI * EnumFunc) (HDC, LPCRECT, EnumProc, LPARAM)
 
typedef BOOL(QT_WIN_CALLBACKEnumProc) (HMONITOR, HDC, LPRECT, LPARAM)
 
typedef BOOL(WINAPI * InfoFunc) (HMONITOR, MONITORINFO *)
 
- Public Types inherited from QWidgetPrivate
enum  CloseMode { CloseNoEvent, CloseWithEvent, CloseWithSpontaneousEvent }
 
enum  Direction { DirectionNorth = 0x01, DirectionEast = 0x10, DirectionSouth = 0x02, DirectionWest = 0x20 }
 
enum  DrawWidgetFlags {
  DrawAsRoot = 0x01, DrawPaintOnScreen = 0x02, DrawRecursive = 0x04, DrawInvisible = 0x08,
  DontSubtractOpaqueChildren = 0x10, DontSetCompositionMode = 0x20, DontDrawOpaqueChildren = 0x40, DontDrawNativeChildren = 0x80
}
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 

Public Functions

void init ()
 
 QDesktopWidgetPrivate ()
 
 QDesktopWidgetPrivate ()
 
void updateScreenList ()
 
 ~QDesktopWidgetPrivate ()
 
 ~QDesktopWidgetPrivate ()
 
 ~QDesktopWidgetPrivate ()
 
- Public Functions inherited from QWidgetPrivate
void _q_showIfNotHidden ()
 
virtual void aboutToDestroy ()
 
void activateChildLayoutsRecursively ()
 
QSize adjustedSize () const
 
void adjustQuitOnCloseAttribute ()
 
QInputContextassignedInputContext () const
 
QPainterbeginSharedPainter ()
 
QWidgetchildAt_helper (const QPoint &, bool) const
 
QWidgetchildAtRecursiveHelper (const QPoint &p, bool, bool includeFrame=false) const
 
QRect clipRect () const
 
QRegion clipRegion () const
 
void clipToEffectiveMask (QRegion &region) const
 
bool close_helper (CloseMode mode)
 
void create_sys (WId window, bool initializeWindow, bool destroyOldWindow)
 
QWindowSurfacecreateDefaultWindowSurface ()
 
QWindowSurfacecreateDefaultWindowSurface_sys ()
 
void createExtra ()
 Creates the widget extra data. More...
 
void createRecursively ()
 
void createSysExtra ()
 
void createTLExtra ()
 
void createTLSysExtra ()
 
void createWinId (WId id=0)
 
void deactivateWidgetCleanup ()
 
void deleteExtra ()
 Deletes the widget extra data. More...
 
void deleteSysExtra ()
 
void deleteTLSysExtra ()
 
void drawWidget (QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter=0, QWidgetBackingStore *backingStore=0)
 
QWidgeteffectiveFocusWidget ()
 
QRect effectiveRectFor (const QRect &rect) const
 
bool endSharedPainter ()
 
void enforceNativeChildren ()
 
QWExtraextraData () const
 
QRect frameStrut () const
 
void getLayoutItemMargins (int *left, int *top, int *right, int *bottom) const
 
const QRegiongetOpaqueChildren () const
 
void handleSoftwareInputPanel (Qt::MouseButton button, bool clickCausedFocus)
 
virtual bool hasHeightForWidth () const
 
void hide_helper ()
 
void hide_sys ()
 Platform-specific part of QWidget::hide(). More...
 
void hideChildren (bool spontaneous)
 
void inheritStyle ()
 
void init (QWidget *desktopWidget, Qt::WindowFlags f)
 
QInputContextinputContext () const
 
void invalidateBuffer (const QRegion &)
 Invalidates the rgn (in widget's coordinates) of the backing store, i.e. More...
 
void invalidateBuffer (const QRect &)
 This function is equivalent to calling invalidateBuffer(QRegion(rect), ...), but is more efficient as it eliminates QRegion operations/allocations and can use the rect more precisely for additional cut-offs. More...
 
void invalidateBuffer_resizeHelper (const QPoint &oldPos, const QSize &oldSize)
 Invalidates the buffer when the widget is resized. More...
 
void invalidateGraphicsEffectsRecursively ()
 
bool isAboutToShow () const
 
bool isBackgroundInherited () const
 
bool isOverlapped (const QRect &) const
 
void lower_sys ()
 
QPoint mapFromGlobal (const QPoint &pos) const
 
QPoint mapToGlobal (const QPoint &pos) const
 
QWidgetBackingStoremaybeBackingStore () const
 
QTLWExtramaybeTopData () const
 
void moveRect (const QRect &, int dx, int dy)
 
bool nativeChildrenForced () const
 
QFont naturalWidgetFont (uint inheritedMask) const
 
QPalette naturalWidgetPalette (uint inheritedMask) const
 Returns the palette that the widget w inherits from its ancestors and QApplication::palette. More...
 
void paintBackground (QPainter *, const QRegion &, int flags=DrawAsRoot) const
 
bool paintOnScreen () const
 
void paintSiblingsRecursive (QPaintDevice *pdev, const QObjectList &children, int index, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter, QWidgetBackingStore *backingStore)
 
bool pointInsideRectAndMask (const QPoint &) const
 
QRegion prepareToRender (const QRegion &region, QWidget::RenderFlags renderFlags)
 
void propagatePaletteChange ()
 Propagate this widget's palette to all children, except style sheet widgets, and windows that don't enable window propagation (palettes don't normally propagate to windows). More...
 
 QWidgetPrivate (int version=QObjectPrivateVersion)
 
void raise_sys ()
 
QPaintDeviceredirected (QPoint *offset) const
 
void registerDropSite (bool)
 
void render (QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags, bool readyToRender)
 
void render_helper (QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags)
 
void repaint_sys (const QRegion &rgn)
 
void reparentFocusWidgets (QWidget *oldtlw)
 
void resolveFont ()
 Determine which font is implicitly imposed on this widget by its ancestors and QApplication::font, resolve this against its own font (attributes from the implicit font are copied over). More...
 
void resolveLayoutDirection ()
 
void resolveLocale ()
 
void resolvePalette ()
 Determine which palette is inherited from this widget's ancestors and QApplication::palette, resolve this against this widget's palette (attributes from the inherited palette are copied over this widget's palette). More...
 
void restoreRedirected ()
 
void scroll_sys (int dx, int dy)
 
void scroll_sys (int dx, int dy, const QRect &r)
 
void scrollChildren (int dx, int dy)
 
void scrollRect (const QRect &, int dx, int dy)
 
void sendPendingMoveAndResizeEvents (bool recursive=false, bool disableUpdates=false)
 
void sendStartupMessage (const char *message) const
 Platform-specific part of QWidget::show(). More...
 
void setConstraints_sys ()
 
void setCursor_sys (const QCursor &cursor)
 
void setDirtyOpaqueRegion ()
 
void setEnabled_helper (bool)
 
void setFocus_sys ()
 
void setFont_helper (const QFont &font)
 
void setGeometry_sys (int, int, int, int, bool)
 
void setLayoutDirection_helper (Qt::LayoutDirection)
 
void setLayoutItemMargins (int left, int top, int right, int bottom)
 
void setLayoutItemMargins (QStyle::SubElement element, const QStyleOption *opt=0)
 
void setLocale_helper (const QLocale &l, bool forceUpdate=false)
 
void setMask_sys (const QRegion &)
 
bool setMaximumSize_helper (int &maxw, int &maxh)
 
bool setMinimumSize_helper (int &minw, int &minh)
 
void setModal_sys ()
 
void setNetWmWindowTypes ()
 
void setOpaque (bool opaque)
 
void setPalette_helper (const QPalette &)
 
void setParent_sys (QWidget *parent, Qt::WindowFlags)
 
void setRedirected (QPaintDevice *replacement, const QPoint &offset)
 
void setSharedPainter (QPainter *painter)
 
void setStyle_helper (QStyle *newStyle, bool propagate, bool metalHack=false)
 
void setUpdatesEnabled_helper (bool)
 
void setWindowFilePath_helper (const QString &filePath)
 
void setWindowIcon_helper ()
 
void setWindowIcon_sys (bool forceReset=false)
 
void setWindowIconText_helper (const QString &cap)
 
void setWindowIconText_sys (const QString &cap)
 
void setWindowOpacity_sys (qreal opacity)
 
void setWindowRole ()
 
void setWindowTitle_helper (const QString &cap)
 
void setWindowTitle_sys (const QString &cap)
 
void setWinId (WId)
 
QPaintersharedPainter () const
 
void show_helper ()
 
void show_recursive ()
 Makes the widget visible in the isVisible() meaning of the word. More...
 
void show_sys ()
 Platform-specific part of QWidget::show(). More...
 
void showChildren (bool spontaneous)
 
void stackUnder_sys (QWidget *)
 
void subtractOpaqueChildren (QRegion &rgn, const QRect &clipRect) const
 
void subtractOpaqueSiblings (QRegion &source, bool *hasDirtySiblingsAbove=0, bool alsoNonOpaque=false) const
 
void syncBackingStore ()
 
void syncBackingStore (const QRegion &region)
 
QTLWExtratopData () const
 
void unsetCursor_sys ()
 
void updateFont (const QFont &)
 Assign font to this widget, and propagate it to all children, except style sheet widgets (handled differently) and windows that don't enable window propagation. More...
 
void updateFrameStrut ()
 Computes the frame rectangle when needed. More...
 
void updateGeometry_helper (bool forceUpdate)
 
void updateIsOpaque ()
 
void updateIsTranslucent ()
 
void updateSystemBackground ()
 
void updateX11AcceptFocus ()
 
void x11UpdateIsOpaque ()
 
 ~QWidgetPrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Static Public Functions

static void cleanup ()
 
static void init (QDesktopWidget *that)
 
- Static Public Functions inherited from QWidgetPrivate
static void adjustFlags (Qt::WindowFlags &flags, QWidget *w=0)
 
static QGraphicsProxyWidgetnearestGraphicsProxyWidget (const QWidget *origin)
 Finds the nearest widget embedded in a graphics proxy widget along the chain formed by this widget and its ancestors. More...
 
static int pointToRect (const QPoint &p, const QRect &r)
 
static QRect screenGeometry (const QWidget *widget)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Public Variables

int defaultScreen
 
QRectrects
 
int screenCount
 
QList< QDesktopScreenWidget * > screens
 
QWidget ** screens
 
bool use_xinerama
 
QRectworkareas
 
- Public Variables inherited from QWidgetPrivate
QString accessibleDescription
 
QString accessibleName
 
QList< QAction * > actions
 
QPalette::ColorRole bg_role: 8
 
signed char bottomLayoutItemMargin
 
short bottommargin
 
QWidgetData data
 
QRegion dirty
 
uint dirtyOpaqueChildren: 1
 
QWExtraextra
 
QPaintEngineextraPaintEngine
 
QPalette::ColorRole fg_role: 8
 
QWidgetfocus_child
 
QWidgetfocus_next
 
QWidgetfocus_prev
 
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
 
QGraphicsEffectgraphicsEffect
 
Qt::HANDLE hd
 
uint high_attributes [4]
 
QPointer< QInputContextic
 
Qt::InputMethodHints imHints
 
uint inDirtyList: 1
 
uint inheritedFontResolveMask
 
uint inheritedPaletteResolveMask
 
uint inheritsInputMethodHints: 1
 
uint inSetParent: 1
 
uint isGLWidget: 1
 
uint isMoved: 1
 
uint isOpaque: 1
 
uint isScrolled: 1
 
QLayoutlayout
 
signed char leftLayoutItemMargin
 
short leftmargin
 
QLocale locale
 
QRegionneedsFlush
 
QRegion opaqueChildren
 
Qt::HANDLE picture
 
const QMetaObjectpolished
 
QPaintDeviceredirectDev
 
QPoint redirectOffset
 
signed char rightLayoutItemMargin
 
short rightmargin
 
QSizePolicy size_policy
 
QString statusTip
 
QString toolTip
 
signed char topLayoutItemMargin
 
short topmargin
 
uint usesDoubleBufferedGLContext: 1
 
QString whatsThis
 
QWidgetItemV2widgetItem
 
QX11Info xinfo
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Static Public Variables

static EnumFunc enumDisplayMonitors = 0
 
static InfoFunc getMonitorInfo = 0
 
static int primaryScreen = 0
 
static QVector< QRect > * rects = 0
 
static int refcount = 0
 
static int screenCount = 1
 
static QVector< QRect > * workrects = 0
 
- Static Public Variables inherited from QWidgetPrivate
static QWidgetSetallWidgets = 0
 
static int instanceCounter = 0
 
static QWidgetkeyboardGrabber = 0
 
static QWidgetMappermapper = 0
 
static int maxInstances = 0
 
static QWidgetmouseGrabber = 0
 

Detailed Description

Definition at line 71 of file qdesktopwidget_qpa_p.h.

Typedefs

◆ EnumFunc

typedef BOOL(WINAPI * QDesktopWidgetPrivate::EnumFunc) (HDC, LPCRECT, EnumProc, LPARAM)

Definition at line 80 of file qdesktopwidget_win.cpp.

◆ EnumProc

typedef BOOL(QT_WIN_CALLBACK * QDesktopWidgetPrivate::EnumProc) (HMONITOR, HDC, LPRECT, LPARAM)

Definition at line 79 of file qdesktopwidget_win.cpp.

◆ InfoFunc

typedef BOOL(WINAPI * QDesktopWidgetPrivate::InfoFunc) (HMONITOR, MONITORINFO *)

Definition at line 78 of file qdesktopwidget_win.cpp.

Constructors and Destructors

◆ ~QDesktopWidgetPrivate() [1/3]

QDesktopWidgetPrivate::~QDesktopWidgetPrivate ( )
inline

Definition at line 75 of file qdesktopwidget_qpa_p.h.

Referenced by init().

75 {foreach(QDesktopScreenWidget *s, screens) delete s; }
QList< QDesktopScreenWidget * > screens

◆ QDesktopWidgetPrivate() [1/2]

QDesktopWidgetPrivate::QDesktopWidgetPrivate ( )

Definition at line 143 of file qdesktopwidget_win.cpp.

144 {
145  ++refcount;
146 }

◆ ~QDesktopWidgetPrivate() [2/3]

QDesktopWidgetPrivate::~QDesktopWidgetPrivate ( )

◆ QDesktopWidgetPrivate() [2/2]

QDesktopWidgetPrivate::QDesktopWidgetPrivate ( )

◆ ~QDesktopWidgetPrivate() [3/3]

QDesktopWidgetPrivate::~QDesktopWidgetPrivate ( )

Functions

◆ cleanup()

void QDesktopWidgetPrivate::cleanup ( )
static

Definition at line 216 of file qdesktopwidget_win.cpp.

Referenced by init().

217 {
218  screen_number = 0;
219  screenCount = 1;
220  primaryScreen = 0;
222  getMonitorInfo = 0;
223  delete rects;
224  rects = 0;
225  delete workrects;
226  workrects = 0;
227 }
static int screen_number
static EnumFunc enumDisplayMonitors
static InfoFunc getMonitorInfo
static QVector< QRect > * rects
static QVector< QRect > * workrects

◆ init() [1/2]

void QDesktopWidgetPrivate::init ( QDesktopWidget that)
static

Definition at line 148 of file qdesktopwidget_win.cpp.

149 {
150  if (rects)
151  return;
152 
153  rects = new QVector<QRect>();
154  workrects = new QVector<QRect>();
155  screenCount = 0;
156 
157 #ifndef Q_OS_WINCE
158  QSystemLibrary user32Lib(QLatin1String("user32"));
159  enumDisplayMonitors = (EnumFunc)user32Lib.resolve("EnumDisplayMonitors");
160  getMonitorInfo = (InfoFunc)user32Lib.resolve("GetMonitorInfoW");
161 
163  screenCount = GetSystemMetrics(80); // SM_CMONITORS
164  rects->resize(screenCount);
165  for (int i = 0; i < screenCount; ++i)
166  rects->replace(i, that->rect());
167  return;
168  }
169  // Calls enumCallback
172  getMonitorInfo = 0;
173 #else
174  QSystemLibrary coreLib(QLatin1String("coredll"));
175  // CE >= 4.0 case
176  enumDisplayMonitors = (EnumFunc)coreLib.resolve("EnumDisplayMonitors");
177  getMonitorInfo = (InfoFunc)coreLib.resolve("GetMonitorInfo");
178 
179  if ((!enumDisplayMonitors || !getMonitorInfo)) {
180  screenCount = GetSystemMetrics(SM_CMONITORS);
181  return;
182  }
183 
184  if (!coreLib.isLoaded() || !enumDisplayMonitors || !getMonitorInfo) {
185  rects->resize(screenCount);
186  for (int i = 0; i < screenCount; ++i)
187  (*rects)[i] = that->rect();
188 
189  RECT r;
190  SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0);
191  QRect qr = QRect(QPoint(r.left, r.top), QPoint(r.right - 1, r.bottom - 1));
192 
193 #if defined(Q_WS_WINCE_WM)
194  qt_get_sip_info(qr);
195 #endif
196 
197  workrects->resize(screenCount);
198  for (int j = 0; j < screenCount; ++j)
199  (*workrects)[j] = qr;
200  return;
201  }
202 
203  // Calls enumCallback
206  getMonitorInfo = 0;
207 #endif // Q_WS_WINCE
208 }
void replace(int i, const T &t)
Replaces the item at index position i with value.
Definition: qvector.h:382
#define SPI_GETWORKAREA
BOOL QT_WIN_CALLBACK enumCallback(HMONITOR hMonitor, HDC, LPRECT, LPARAM)
static EnumFunc enumDisplayMonitors
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
static InfoFunc getMonitorInfo
BOOL(WINAPI * InfoFunc)(HMONITOR, MONITORINFO *)
static QVector< QRect > * rects
static QVector< QRect > * workrects
QRect rect() const
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
BOOL(WINAPI * EnumFunc)(HDC, LPCRECT, EnumProc, LPARAM)

◆ init() [2/2]

void QDesktopWidgetPrivate::init ( )

Definition at line 126 of file qdesktopwidget_x11.cpp.

Referenced by cleanup().

127 {
128  // get the screen count
129  int newScreenCount = ScreenCount(X11->display);
130 #ifndef QT_NO_XINERAMA
131 
132  XineramaScreenInfo *xinerama_screeninfo = 0;
133 
134  // we ignore the Xinerama extension when using the display is
135  // using traditional multi-screen (with multiple root windows)
136  if (newScreenCount == 1
137  && X11->ptrXineramaQueryExtension
138  && X11->ptrXineramaIsActive
139  && X11->ptrXineramaQueryScreens) {
140  int unused;
141  use_xinerama = (X11->ptrXineramaQueryExtension(X11->display, &unused, &unused)
142  && X11->ptrXineramaIsActive(X11->display));
143  }
144 
145  if (use_xinerama) {
146  xinerama_screeninfo =
147  X11->ptrXineramaQueryScreens(X11->display, &newScreenCount);
148  }
149 
150  if (xinerama_screeninfo) {
151  defaultScreen = 0;
152  } else
153 #endif // QT_NO_XINERAMA
154  {
155  defaultScreen = DefaultScreen(X11->display);
156  newScreenCount = ScreenCount(X11->display);
157  use_xinerama = false;
158  }
159 
160  delete [] rects;
161  rects = new QRect[newScreenCount];
162  delete [] workareas;
163  workareas = new QRect[newScreenCount];
164 
165  // get the geometry of each screen
166  int i, j, x, y, w, h;
167  for (i = 0, j = 0; i < newScreenCount; i++, j++) {
168 
169 #ifndef QT_NO_XINERAMA
170  if (use_xinerama) {
171  x = xinerama_screeninfo[i].x_org;
172  y = xinerama_screeninfo[i].y_org;
173  w = xinerama_screeninfo[i].width;
174  h = xinerama_screeninfo[i].height;
175  } else
176 #endif // QT_NO_XINERAMA
177  {
178  x = 0;
179  y = 0;
180  w = WidthOfScreen(ScreenOfDisplay(X11->display, i));
181  h = HeightOfScreen(ScreenOfDisplay(X11->display, i));
182  }
183 
184  rects[j].setRect(x, y, w, h);
185 
186  if (use_xinerama && j > 0 && rects[j-1].intersects(rects[j])) {
187  // merge a "cloned" screen with the previous, hiding all crtcs
188  // that are currently showing a sub-rect of the previous screen
189  if ((rects[j].width()*rects[j].height()) >
190  (rects[j-1].width()*rects[j-1].height()))
191  rects[j-1] = rects[j];
192  j--;
193  }
194 
195  workareas[i] = QRect();
196  }
197 
198  if (screens) {
199  // leaks QWidget* pointers on purpose, can't delete them as pointer escapes
200  screens = q_check_ptr((QWidget**) realloc(screens, j * sizeof(QWidget*)));
201  if (j > screenCount)
202  memset(&screens[screenCount], 0, (j-screenCount) * sizeof(QWidget*));
203  }
204 
205  screenCount = j;
206 
207 #ifndef QT_NO_XINERAMA
208  if (use_xinerama && screenCount == 1)
209  use_xinerama = false;
210 
211  if (xinerama_screeninfo)
212  XFree(xinerama_screeninfo);
213 #endif // QT_NO_XINERAMA
214 
215 }
T * q_check_ptr(T *p)
Definition: qglobal.h:1857
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
#define X11
Definition: qt_x11_p.h:724
void * unused
Definition: qobject_p.h:208
static QVector< QRect > * rects
QList< QDesktopScreenWidget * > screens
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58

◆ updateScreenList()

void QDesktopWidgetPrivate::updateScreenList ( )

Definition at line 52 of file qdesktopwidget_qpa.cpp.

53 {
55 
56  QList<QPlatformScreen *> screenList = QApplicationPrivate::platformIntegration()->screens();
57  int targetLength = screenList.length();
58  int currentLength = screens.length();
59 
60  // Add or remove screen widgets as necessary
61  if(currentLength > targetLength) {
62  QDesktopScreenWidget *screen;
63  while (currentLength-- > targetLength) {
64  screen = screens.takeLast();
65  delete screen;
66  }
67  }
68  else if (currentLength < targetLength) {
69  QDesktopScreenWidget *screen;
70  while (currentLength < targetLength) {
71  screen = new QDesktopScreenWidget(currentLength++);
72  screens.append(screen);
73  }
74  }
75 
76  QRegion virtualGeometry;
77 
78  // update the geometry of each screen widget
79  for (int i = 0; i < screens.length(); i++) {
80  QRect screenGeometry = screenList.at(i)->geometry();
81  screens.at(i)->setGeometry(screenGeometry);
82  virtualGeometry += screenGeometry;
83  }
84 
85  q->setGeometry(virtualGeometry.boundingRect());
86 }
QRect boundingRect() const
Returns the bounding rectangle of this region.
Definition: qregion.cpp:4363
void setGeometry(int x, int y, int w, int h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qwidget.h:1017
#define Q_Q(Class)
Definition: qglobal.h:2483
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
virtual QRect geometry() const =0
Reimplement in subclass to return the pixel geometry of the screen.
QList< QDesktopScreenWidget * > screens
int length() const
This function is identical to count().
Definition: qlist.h:281
static QRect screenGeometry(const QWidget *widget)
Definition: qwidget_p.h:600
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
T takeLast()
Removes the last item in the list and returns it.
Definition: qlist.h:492
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

Properties

◆ defaultScreen

int QDesktopWidgetPrivate::defaultScreen

Definition at line 96 of file qdesktopwidget_x11.cpp.

Referenced by init().

◆ enumDisplayMonitors

QDesktopWidgetPrivate::EnumFunc QDesktopWidgetPrivate::enumDisplayMonitors = 0
static

Definition at line 82 of file qdesktopwidget_win.cpp.

Referenced by cleanup(), and init().

◆ getMonitorInfo

QDesktopWidgetPrivate::InfoFunc QDesktopWidgetPrivate::getMonitorInfo = 0
static

Definition at line 83 of file qdesktopwidget_win.cpp.

Referenced by cleanup(), enumCallback(), and init().

◆ primaryScreen

int QDesktopWidgetPrivate::primaryScreen = 0
static

Definition at line 65 of file qdesktopwidget_win.cpp.

Referenced by cleanup(), enumCallback(), and updateScreenList().

◆ rects [1/2]

QVector< QRect > * QDesktopWidgetPrivate::rects = 0
static

Definition at line 67 of file qdesktopwidget_win.cpp.

Referenced by cleanup(), and init().

◆ rects [2/2]

QRect* QDesktopWidgetPrivate::rects

Definition at line 100 of file qdesktopwidget_x11.cpp.

◆ refcount

int QDesktopWidgetPrivate::refcount = 0
static

Definition at line 84 of file qdesktopwidget_win.cpp.

Referenced by init(), and QDesktopWidgetPrivate().

◆ screenCount [1/2]

int QDesktopWidgetPrivate::screenCount = 1
static

Definition at line 64 of file qdesktopwidget_win.cpp.

Referenced by cleanup(), enumCallback(), and init().

◆ screenCount [2/2]

int QDesktopWidgetPrivate::screenCount

Definition at line 97 of file qdesktopwidget_x11.cpp.

◆ screens [1/2]

QList<QDesktopScreenWidget *> QDesktopWidgetPrivate::screens

Definition at line 78 of file qdesktopwidget_qpa_p.h.

Referenced by init(), and updateScreenList().

◆ screens [2/2]

QWidget** QDesktopWidgetPrivate::screens

Definition at line 99 of file qdesktopwidget_x11.cpp.

◆ use_xinerama

bool QDesktopWidgetPrivate::use_xinerama

Definition at line 95 of file qdesktopwidget_x11.cpp.

Referenced by init().

◆ workareas

QRect* QDesktopWidgetPrivate::workareas

Definition at line 101 of file qdesktopwidget_x11.cpp.

Referenced by init().

◆ workrects

QVector< QRect > * QDesktopWidgetPrivate::workrects = 0
static

Definition at line 68 of file qdesktopwidget_win.cpp.

Referenced by cleanup(), and init().


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