Qt 4.8
Functions
qegl_qws.cpp File Reference
#include <QtGui/qpaintdevice.h>
#include <QtGui/qpixmap.h>
#include <QtGui/qwidget.h>
#include "qegl_p.h"
#include "qeglcontext_p.h"
#include <qscreen_qws.h>
#include <qscreenproxy_qws.h>
#include <qapplication.h>
#include <qdesktopwidget.h>

Go to the source code of this file.

Functions

static QScreenscreenForDevice (QPaintDevice *device)
 

Function Documentation

◆ screenForDevice()

static QScreen* screenForDevice ( QPaintDevice device)
static

Definition at line 58 of file qegl_qws.cpp.

59 {
60  QScreen *screen = qt_screen;
61  if (!screen)
62  return 0;
63  if (screen->classId() == QScreen::MultiClass) {
64  int screenNumber;
65  if (device && device->devType() == QInternal::Widget)
66  screenNumber = qApp->desktop()->screenNumber(static_cast<QWidget *>(device));
67  else
68  screenNumber = 0;
69  screen = screen->subScreens()[screenNumber];
70  }
71  while (screen->classId() == QScreen::ProxyClass ||
72  screen->classId() == QScreen::TransformedClass) {
73  screen = static_cast<QProxyScreen *>(screen)->screen();
74  }
75  return screen;
76 }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
The QProxyScreen class provides a generic interface to QScreen implementations.
virtual int devType() const
Definition: qpaintdevice.h:167
#define qApp
virtual QList< QScreen * > subScreens() const
Definition: qscreen_qws.h:283
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
ClassId classId() const
Returns the class identifier for the screen object.