Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QScreen Class Reference
[QtGui module]

The QScreen class and its descendants manage the framebuffer and palette. More...

#include <QScreen>

Public Types

Public Functions


Detailed Description

The QScreen class and its descendants manage the framebuffer and palette.

QScreens act as factories for the screen cursor and QPaintEngine. QLinuxFbScreen manages a Linux framebuffer; accelerated drivers subclass QLinuxFbScreen. There can only be one screen in a Qt/Embedded application.


Member Type Documentation

enum QScreen::PixelType

ConstantValue
QScreen::NormalPixel0
QScreen::BGRPixel1

Member Function Documentation

QScreen::QScreen ( int display_id )

Create a screen; the display_id is the number of the Qt/Embedded server to connect to.

QScreen::~QScreen ()   [virtual]

Destroys a QScreen

int QScreen::alloc ( unsigned int r, unsigned int g, unsigned int b )   [virtual]

Given an RGB value r g b, return an index which is the closest match to it in the screen's palette. Used in paletted modes only.

uchar * QScreen::base () const

Returns a pointer to the start of the framebuffer.

void QScreen::blank ( bool on )   [virtual]

If on is true, blank the screen. Otherwise unblank it.

QRgb * QScreen::clut ()

Returns the screen's color lookup table (color palette). This is only valid in paletted modes (8bpp and lower).

bool QScreen::connect ( const QString & displaySpec )   [pure virtual]

This function is called by every Qt/Embedded application on startup. It maps in the framebuffer and in the accelerated drivers the graphics card control registers. displaySpec has the following syntax: <p> <tt>[screen driver][:driver specific options][:display number]</tt> <p> for example if you want to use the mach64 driver on fb1 as display 2: <p> <tt>Mach64:/dev/fb1:2</tt> <p> displaySpec is passed in via the QWS_DISPLAY environment variable or the -display command line parameter.

QPaintEngine * QScreen::createPaintEngine ( unsigned char * addr, int w, int h, int d, int linestep )   [virtual]

QPaintEngine * QScreen::createScreenEngine ()

int QScreen::depth () const

Gives the depth in bits per pixel of the framebuffer. This is the number of bits each pixel takes up rather than the number of significant bits, so 24bpp and 32bpp express the same range of colors (8 bits of red, green and blue)

int QScreen::deviceHeight () const

Gives the full height of the framebuffer device, as opposed to the height which Qt/Embedded will actually use. These can differ if the display is centered within the framebuffer.

int QScreen::deviceWidth () const

Gives the full width of the framebuffer device, as opposed to the width which Qt/Embedded will actually use. These can differ if the display is centered within the framebuffer.

void QScreen::disconnect ()   [pure virtual]

This function is called by every Qt/Embedded application just before exitting; it's normally used to unmap the framebuffer.

int QScreen::height () const

Gives the height in pixels of the framebuffer.

int QScreen::initCursor ( void * end_of_location, bool init = false )   [virtual]

This is used to initialize the software cursor - end_of_location points to the address after the area where the cursor image can be stored. init is true for the first application this method is called from (the Qt/Embedded server), false otherwise.

bool QScreen::initDevice ()   [pure virtual]

This function is called by the Qt/Embedded server when initializing the framebuffer. Accelerated drivers use it to set up the graphics card.

bool QScreen::isInterlaced () const   [virtual]

Returns true if the display is interlaced (for instance a television screen); otherwise returns false. If true, drawing is altered to look better on such displays.

bool QScreen::isTransformed () const   [virtual]

Returns true if the screen is transformed (for instance, rotated 90 degrees); otherwise returns false. QScreen's version always returns false.

int * QScreen::lastOp ()

Returns the screens last operation.

int QScreen::linestep () const

Returns the length in bytes of each scanline of the framebuffer.

QSize QScreen::mapFromDevice ( const QSize & s ) const   [virtual]

Map a framebuffer coordinate to the coordinate space used by the application. Used by the rotated driver; the QScreen implementation simply returns s.

QPoint QScreen::mapFromDevice ( const QPoint & point, const QSize & size ) const   [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Map a framebuffer coordinate to the coordinate space used by the application. Used by the rotated driver; the QScreen implementation simply returns the given point and ignores the size argument.

QRect QScreen::mapFromDevice ( const QRect & rect, const QSize & size ) const   [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Map a framebuffer coordinate to the coordinate space used by the application. Used by the rotated driver; the QScreen implementation simply returns the given rect and ignores the size argument.

QImage QScreen::mapFromDevice ( const QImage & i ) const   [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Transforms an image so that it matches the application coordinate space (e.g. rotating it 90 degrees counter-clockwise). The QScreen implementation simply returns i.

QRegion QScreen::mapFromDevice ( const QRegion & region, const QSize & size ) const   [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Transforms a region so that it matches the application coordinate space (e.g. rotating it 90 degrees counter-clockwise). The QScreen implementation simply returns the given region and ignores the size argument.

QSize QScreen::mapToDevice ( const QSize & s ) const   [virtual]

Map a user coordinate to the one to actually draw. Used by the rotated driver; the QScreen implementation simply returns s.

QPoint QScreen::mapToDevice ( const QPoint & point, const QSize & size ) const   [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Map a user coordinate to the one to actually draw. Used by the rotated driver; the QScreen implementation simply returns the given point and ignores the size argument.

QRect QScreen::mapToDevice ( const QRect & rect, const QSize & size ) const   [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Map a user coordinate to the one to actually draw. Used by the rotated driver; the QScreen implementation simply returns the given rect and ignores the size argument.

QImage QScreen::mapToDevice ( const QImage & i ) const   [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Transforms an image so that it fits the device coordinate space (e.g. rotating it 90 degrees clockwise). The QScreen implementation simply returns i.

QRegion QScreen::mapToDevice ( const QRegion & region, const QSize & size ) const   [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Transforms a region so that it fits the device coordinate space (e.g. rotating it 90 degrees clockwise). The QScreen implementation simply returns the given region and ignores the size argument.

int QScreen::numCols ()

Returns the number of entries in the color table returned by clut().

bool QScreen::onCard ( const unsigned char * p ) const   [virtual]

Returns true if the buffer pointed to by p is within graphics card memory, false if it's in main RAM.

bool QScreen::onCard ( const unsigned char * p, ulong & offset ) const   [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

This checks whether the buffer specified by p is on the card (as per the other version of onCard) and returns an offset in bytes from the start of graphics card memory in offset if it is.

int * QScreen::opType ()

Returns the screen's operation type.

PixelType QScreen::pixelType () const

Returns the pixel storage format of the screen.

int QScreen::pixmapDepth () const   [virtual]

Gives the preferred depth for pixmaps. By default this is the same as the screen depth, but for the VGA16 driver it's 8bpp.

int QScreen::pixmapLinestepAlignment ()   [virtual]

Returns the value in bits to which individual scanlines of pixmaps held in graphics card memory should be aligned. This is only useful for accelerated drivers. By default the value returned is 64 but it can be overridden by individual accelerated drivers.

int QScreen::pixmapOffsetAlignment ()   [virtual]

Returns the value in bits to which the start address of pixmaps held in graphics card memory should be aligned. This is only useful for accelerated drivers. By default the value returned is 64 but it can be overridden by individual accelerated drivers.

void QScreen::restore ()   [virtual]

Restores the state of the graphics card from a previous save()

void QScreen::save ()   [virtual]

Saves the state of the graphics card - used so that, for instance, the palette can be restored when switching between linux virtual consoles. Hardware QScreen descendants should save register state here if necessary if switching between virtual consoles (for example to/from X) is to be permitted.

int QScreen::screenSize () const

Returns the size in bytes of the screen. This is always located at the beginning of framebuffer memory (i.e. at base()).

void QScreen::setDirty ( const QRect & rect )   [virtual]

Indicates the rectangle, rect, of the screen that has been altered. Used by the VNC and VFB displays; the QScreen version does nothing.

void QScreen::setMode ( int width, int height, int depth )   [pure virtual]

This function can be used to set the framebuffer width, height, and depth. It's currently unused.

void QScreen::shutdownDevice ()   [virtual]

Called by the Qt/Embedded server on shutdown; never called by a Qt/Embedded client. This is intended to support graphics card specific shutdown; the unaccelerated implementation simply hides the mouse cursor.

bool QScreen::supportsDepth ( int d ) const   [virtual]

Returns true if the screen supports a particular color depth d. Possible values are 1,4,8,16 and 32.

int QScreen::totalSize () const

Returns the size in bytes of available graphics card memory, including the screen. Offscreen memory is only used by the accelerated drivers.

int QScreen::transformOrientation () const   [virtual]

Used by the rotated server. The QScreeen implementation returns 0.

int QScreen::width () const

Gives the width in pixels of the framebuffer.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 45
  4. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  5. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 6
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
Page suivante

Le Qt Developer Network au hasard

Logo

Génération de bindings PySide avec Shiboken

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.0
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web