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  ·  Fonctions  · 

QStyleOption Class Reference

The QStyleOption class specifies optional parameters for QStyle functions. More...

#include <qstyle.h>

List of all member functions.

Public Members


Detailed Description

The QStyleOption class specifies optional parameters for QStyle functions.

Some QStyle functions take an optional argument specifying extra information that is required for a paritical primitive or control. So that the QStyle class can be extended, QStyleOption is used to provide a variable-argument for these options.

The QStyleOption class has constructors for each type of optional argument, and this set of constructors may be extended in future Qt releases. There are also corresponding access functions that return the optional arguments: these too may be extended.

For each constructor, you should refer to the documentation of the QStyle functions to see the meaning of the arguments.

When calling QStyle functions from your own widgets, you must only pass the default QStyleOption or the argument that QStyle is documented to accept. For example, if the function expects QStyleOption(QMenuItem *, int), passing QStyleOption(QMenuItem *) leaves the optional integer argument uninitialized.

When subclassing QStyle, you must similarly only expect the default or documented arguments. The other arguments will have uninitialized values.

If you make your own QStyle subclasses and your own widgets, you can make a subclass of QStyleOption to pass additional arguments to your QStyle subclass. You will need to cast the "const QStyleOption&" argument to your subclass, so be sure your style has been called from your widget.

See also Widget Appearance and Style.


Member Type Documentation

QStyleOption::StyleOptionDefault

This enum value can be passed as the optional argument to any QStyle function.

  • QStyleOption::Default

Member Function Documentation

QStyleOption::QStyleOption ( StyleOptionDefault = Default )

The default option. This can always be passed as the optional argument to QStyle functions.

QStyleOption::QStyleOption ( int in1 )

Pass one integer, in1. For example, headerSection.

QStyleOption::QStyleOption ( int in1, int in2 )

Pass two integers, in1 and in2. For example, linewidth and midlinewidth.

QStyleOption::QStyleOption ( int in1, int in2, int in3, int in4 )

Pass four integers, in1, in2, in3 and in4.

QStyleOption::QStyleOption ( QMenuItem * m )

Pass a menu item, m.

QStyleOption::QStyleOption ( QMenuItem * m, int in1 )

Pass a menu item and an integer, m and in1.

QStyleOption::QStyleOption ( QMenuItem * m, int in1, int in2 )

Pass a menu item and two integers, m, in1 and in2.

QStyleOption::QStyleOption ( const QColor & c )

Pass a color, c.

QStyleOption::QStyleOption ( QTab * t )

Pass a QTab, t.

QStyleOption::QStyleOption ( QListViewItem * i )

Pass a QListViewItem, i.

QStyleOption::QStyleOption ( QCheckListItem * i )

Pass a QCheckListItem, i.

QStyleOption::QStyleOption ( Qt::ArrowType a )

Pass an Qt::ArrowType, a.

QStyleOption::QStyleOption ( const QRect & r )

Pass a QRect, r.

QStyleOption::QStyleOption ( QWidget * w )

Pass a QWidget, w.

Qt::ArrowType QStyleOption::arrowType () const

Returns an arrow type if the appropriate constructor was called; otherwise the return value is undefined.

QCheckListItem * QStyleOption::checkListItem () const

Returns a check list item if the appropriate constructor was called; otherwise the return value is undefined.

const QColor & QStyleOption::color () const

Returns a color if the appropriate constructor was called; otherwise the return value is undefined.

int QStyleOption::day () const

Returns the index of the day in the month if the appropriate constructor was called; otherwise the return value is undefined.

int QStyleOption::frameShadow () const

Returns a QFrame::Shadow value if the appropriate constructor was called; otherwise the return value is undefined.

int QStyleOption::frameShape () const

Returns a QFrame::Shape value if the appropriate constructor was called; otherwise the return value is undefined.

int QStyleOption::headerSection () const

Returns the header section if the appropriate constructor was called; otherwise the return value is undefined.

bool QStyleOption::isDefault () const

Returns TRUE if the option was constructed with the default constructor; otherwise returns FALSE.

int QStyleOption::lineWidth () const

Returns the line width if the appropriate constructor was called; otherwise the return value is undefined.

QListViewItem * QStyleOption::listViewItem () const

Returns a QListView item if the appropriate constructor was called; otherwise the return value is undefined.

int QStyleOption::maxIconWidth () const

Returns the maximum width of the menu item check area if the appropriate constructor was called; otherwise the return value is undefined.

QMenuItem * QStyleOption::menuItem () const

Returns a menu item if the appropriate constructor was called; otherwise the return value is undefined.

int QStyleOption::midLineWidth () const

Returns the mid-line width if the appropriate constructor was called; otherwise the return value is undefined.

QRect QStyleOption::rect () const

Returns a rectangle if the appropriate constructor was called; otherwise the return value is undefined.

QTab * QStyleOption::tab () const

Returns a QTabBar tab if the appropriate constructor was called; otherwise the return value is undefined.

int QStyleOption::tabWidth () const

Returns the tab indent width if the appropriate constructor was called; otherwise the return value is undefined.

QWidget * QStyleOption::widget () const

Returns a pointer to a widget if the appropriate constructor was called; otherwise the return value is undefined.


This file is part of the Qt toolkit. Copyright © 1995-2005 Trolltech. All Rights Reserved.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 23
  2. Une nouvelle ère d'IHM 3D pour les automobiles, un concept proposé par Digia et implémenté avec Qt 3
  3. PySide devient un add-on Qt et rejoint le Qt Project et le modèle d'open gouvernance 1
  4. Qt Creator 2.5 est sorti en beta, l'EDI supporte maintenant plus de fonctionnalités de C++11 2
  5. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 18
  6. Vingt sociétés montrent leurs décodeurs basés sur Qt au IPTV World Forum, en en exploitant diverses facettes (déclaratif, Web, widgets) 0
  7. Thread travailleur avec Qt en utilisant les signaux et les slots, un article de Christophe Dumez traduit par Thibaut Cuvelier 1
  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 ? 49
  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é 22
  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 blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. 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 3.3
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