Qt 4.8
Functions
qegl_qpa.cpp File Reference
#include <QtGui/qpaintdevice.h>
#include <QtGui/qpixmap.h>
#include <QtGui/qwidget.h>
#include "qeglcontext_p.h"
#include <QtGui/private/qgraphicssystem_p.h>
#include <QtGui/private/qapplication_p.h>
#include <QtGui/qdesktopwidget.h>

Go to the source code of this file.

Functions

static QPlatformScreenscreenForDevice (QPaintDevice *device)
 

Function Documentation

◆ screenForDevice()

static QPlatformScreen* screenForDevice ( QPaintDevice device)
static

Definition at line 76 of file qegl_qpa.cpp.

Referenced by QEglProperties::setPaintDeviceFormat().

77 {
78  QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
79 
80  QList<QPlatformScreen *> screens = pi->screens();
81 
82  int screenNumber;
83  if (device && device->devType() == QInternal::Widget)
84  screenNumber = qApp->desktop()->screenNumber(static_cast<QWidget *>(device));
85  else
86  screenNumber = 0;
87  if (screenNumber < 0 || screenNumber >= screens.size())
88  return 0;
89  return screens[screenNumber];
90 }
virtual int devType() const
Definition: qpaintdevice.h:167
#define qApp
virtual QList< QPlatformScreen * > screens() const =0
Accessor function to a list of all the screens on the current system.
The QPlatformIntegration class is the entry for WindowSystem specific functionality.
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
The QList class is a template class that provides lists.
Definition: qdatastream.h:62