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  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QScreenInformation Class Reference
[QtBaseModule]

The QScreenInformation class provides additional information about screens beyond that from QDesktopWidget. More...

    #include <QScreenInformation>

Inherits QObject.

Public Types

  • enum Type { Normal, Television, Overlay }

Public Functions

  • 29 public functions inherited from QObject

Signals

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public type inherited from QObject
  • 4 static public members inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QScreenInformation class provides additional information about screens beyond that from QDesktopWidget.

Some devices have multiple output screens. For example, a device might have a primary LCD screen plus a TV composite video output socket. The TV output can display what is on the LCD screen (known as "cloning"), or it can provide a separate framebuffer for displaying a second image that is different from that on the LCD.

The following code finds the first screen of type Television and then directs that it be a clone of the primary screen:

    QScreenInformation tv(QScreenInformation::Television);
    tv.setClonedScreen(QApplication::desktop()->primaryScreen());

The television screen can be separated from the LCD for separate display as follows:

    tv.setClonedScreen(-1);

When the tv object is deleted, or the application exits, the clone state will revert to its default setting.

Some devices have multiple screens that can be visible at the same time, overlaid on each other. Transparency colors are used to "poke holes" in one layer to allow lower layers to be partially or completely revealed.

Overlay screens are marked with the type QScreenInformation::Overlay. Such screens will typically return a list of layers from supportedLayers() that indicates the layer numbers that can be set for the overlay.

Layer numbers are always relative to zero, which indicates the main GUI layer. Layer numbers less than zero indicate a layer that is below the main GUI layer and numbers greater than zero indicate a layer that is above the main GUI layer.

When a client application calls setLayer(), a request is sent to the screen's QScreenInformationProvider object to change the layer number and make the screen visible. When the QScreenInformation object is deleted, or the application exits, the overlay is made invisible and reverted to its default layer ordering.

See also QScreenInformationProvider.


Member Type Documentation

enum QScreenInformation::Type

This enum defines the type of a screen.

ConstantValueDescription
QScreenInformation::Normal0The screen is a normal display; e.g. an LCD or CRT.
QScreenInformation::Television1The screen outputs a television signal.
QScreenInformation::Overlay2The screen is a normal display overlaid over one of the other screens.


Member Function Documentation

QScreenInformation::QScreenInformation ( int screenNumber = -1, QObject * parent = 0 )

Constructs a screen information object for screenNumber and attaches it to parent. If screenNumber is -1, then the primary screen number will be used. Otherwise, if the screenNumber is invalid, then screenNumber() on the constructed object will be -1.

See also screenNumber().

QScreenInformation::QScreenInformation ( QScreenInformation::Type type, QObject * parent = 0 )

Constructs a screen information object for the first screen with the specified type and attaches it to parent. If there is no such screen, then screenNumber() on the constructed object will return -1.

See also screenNumber().

QScreenInformation::~QScreenInformation ()

Destroys this screen information object. If the clone state was changed with setClonedScreen(), then the system will revert the screen to its previous clone mode.

See also setClonedScreen().

void QScreenInformation::changed ()   [signal]

Signal that is emitted when one of isVisible(), type(), clonedScreen(), layer(), supportedLayers(), or transparencyColor() changes.

See also isVisible(), type(), clonedScreen(), layer(), supportedLayers(), and transparencyColor().

int QScreenInformation::clonedScreen () const

Returns the number of the screen that this screen is cloning. The output on the other screen will also be sent to this screen. If the value is -1, then this screen is separated from all the others.

See also setClonedScreen() and changed().

bool QScreenInformation::isVisible () const

Returns true if the screen is expected to be visible to the user at the present time. In the case of Television screens, this may be false if the video cable is not connected.

See also changed().

int QScreenInformation::layer () const

Returns the overlay layer that this screen currently occupies. A value of zero indicates the normal GUI layer. A value less than zero indicates that the overlay is currently below the normal GUI layer. A value greater than zero indicates that the overlay is currently above the normal GUI layer. The default value is zero.

See also setLayer(), supportedLayers(), and transparencyColor().

int QScreenInformation::screenNumber () const

Returns the screen number that this object pertains to. Returns -1 if this object was constructed using an invalid screen number, or it was constructed using a QScreenInformation::Type and there was no screen with that type.

void QScreenInformation::setClonedScreen ( int value )

Sets the number of the screen that this screen is cloning to value. The output on screen value will also be sent to this screen. If value is -1, then this screen should be separated from all others.

When this QScreenInformation object is deleted, the requested clone operation will be reverted. This permits the system to revert the clone state to the default when an application crashes.

The value of clonedScreen() will remain at its previous value until the changed() signal is emitted. The system is free to ignore the request if the requested clone operation is not supported.

See also clonedScreen() and changed().

void QScreenInformation::setLayer ( int value )

Sets the overlay layer for this screen to value. A value of zero indicates the normal GUI layer. A value less than zero indicates that the overlay is currently below the normal GUI layer. A value greater than zero indicates that the overlay is currently above the normal GUI layer.

The layer can only be set to one of the values in the list returned by supportedLayers(). Requests to change the layer to something else will be ignored.

Setting the layer value for an overlay screen will also make it visible. The layer will be made invisible again once the QScreenInformation object is deleted, or the application exits. The isVisible() function can be used to determine if the layer is currently visible.

See also layer(), supportedLayers(), and isVisible().

QList<int> QScreenInformation::supportedLayers () const

Returns the list of overlay layer numbers that are supported for this screen. This can be used by the client application to locate an overlay layer that can be placed above or below the normal GUI layer.

As an example, if the list contains -1, 1, and 2, then the layer can be placed one step below the main GUI layer, or either one or two steps above the main GUI layer.

If the returned list is empty, then the overlay position is fixed at the value returned by layer().

See also layer() and setLayer().

QColor QScreenInformation::transparencyColor () const

Returns the color to fill an area of this screen with to cause layers below this one to be visible through the transparency gaps.

See also layer().

QScreenInformation::Type QScreenInformation::type () const

Returns the type of screen.

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. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 42
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 7
Page suivante

Le Qt Quarterly au hasard

Logo

Un plugin pour QImage

Qt Quarterly est la revue trimestrielle proposée par Nokia et à destination des développeurs Qt. Ces articles d'une grande qualité technique sont rédigés par des experts Qt. 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 qtextended4.4
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