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  · 

<qdrawutil.h> - Drawing Utility Functions

Functions

void qDrawBorderPixmap ( QPainter * painter, const QRect & target, const QMargins & margins, const QPixmap & pixmap )
void qDrawPlainRect ( QPainter * painter, int x, int y, int width, int height, const QColor & lineColor, int lineWidth = 1, const QBrush * fill = 0 )
void qDrawPlainRect ( QPainter * painter, const QRect & rect, const QColor & lineColor, int lineWidth = 1, const QBrush * fill = 0 )
void qDrawShadeLine ( QPainter * painter, int x1, int y1, int x2, int y2, const QPalette & palette, bool sunken = true, int lineWidth = 1, int midLineWidth = 0 )
void qDrawShadeLine ( QPainter * painter, const QPoint & p1, const QPoint & p2, const QPalette & palette, bool sunken = true, int lineWidth = 1, int midLineWidth = 0 )
void qDrawShadePanel ( QPainter * painter, int x, int y, int width, int height, const QPalette & palette, bool sunken = false, int lineWidth = 1, const QBrush * fill = 0 )
void qDrawShadePanel ( QPainter * painter, const QRect & rect, const QPalette & palette, bool sunken = false, int lineWidth = 1, const QBrush * fill = 0 )
void qDrawShadeRect ( QPainter * painter, int x, int y, int width, int height, const QPalette & palette, bool sunken = false, int lineWidth = 1, int midLineWidth = 0, const QBrush * fill = 0 )
void qDrawShadeRect ( QPainter * painter, const QRect & rect, const QPalette & palette, bool sunken = false, int lineWidth = 1, int midLineWidth = 0, const QBrush * fill = 0 )
void qDrawWinButton ( QPainter * painter, int x, int y, int width, int height, const QPalette & palette, bool sunken = false, const QBrush * fill = 0 )
void qDrawWinButton ( QPainter * painter, const QRect & rect, const QPalette & palette, bool sunken = false, const QBrush * fill = 0 )
void qDrawWinPanel ( QPainter * painter, int x, int y, int width, int height, const QPalette & palette, bool sunken = false, const QBrush * fill = 0 )

See also QPainter.


Function Documentation

void qDrawBorderPixmap ( QPainter * painter, const QRect & target, const QMargins & margins, const QPixmap & pixmap )

This is an overloaded function.

The qDrawBorderPixmap function is for drawing a pixmap into the margins of a rectangle.

Draws the given pixmap into the given target rectangle, using the given painter. The pixmap will be split into nine segments and drawn according to the margins structure.

This function was introduced in Qt 4.6.

void qDrawPlainRect ( QPainter * painter, int x, int y, int width, int height, const QColor & lineColor, int lineWidth = 1, const QBrush * fill = 0 )

Draws the plain rectangle beginning at (x, y) with the given width and height, using the specified painter, lineColor and lineWidth. The rectangle's interior is filled with the fill brush unless fill is 0.

Warning: This function does not look at QWidget::style() or QApplication::style(). Use the drawing functions in QStyle to make widgets that follow the current GUI style.

Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a plain rectangle:

 QFrame frame:
 frame.setFrameStyle(QFrame::Box | QFrame::Plain);

See also qDrawShadeRect() and QStyle.

void qDrawPlainRect ( QPainter * painter, const QRect & rect, const QColor & lineColor, int lineWidth = 1, const QBrush * fill = 0 )

This is an overloaded function.

Draws the plain rectangle specified by rect using the given painter, lineColor and lineWidth. The rectangle's interior is filled with the fill brush unless fill is 0.

Warning: This function does not look at QWidget::style() or QApplication::style(). Use the drawing functions in QStyle to make widgets that follow the current GUI style.

Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a plain rectangle:

 QFrame frame:
 frame.setFrameStyle(QFrame::Box | QFrame::Plain);

See also qDrawShadeRect() and QStyle.

void qDrawShadeLine ( QPainter * painter, int x1, int y1, int x2, int y2, const QPalette & palette, bool sunken = true, int lineWidth = 1, int midLineWidth = 0 )

Draws a horizontal (y1 == y2) or vertical (x1 == x2) shaded line using the given painter. Note that nothing is drawn if y1 != y2 and x1 != x2 (i.e. the line is neither horizontal nor vertical).

The provided palette specifies the shading colors (light, dark and middle colors). The given lineWidth specifies the line width for each of the lines; it is not the total line width. The given midLineWidth specifies the width of a middle line drawn in the QPalette::mid() color.

The line appears sunken if sunken is true, otherwise raised.

Warning: This function does not look at QWidget::style() or QApplication::style(). Use the drawing functions in QStyle to make widgets that follow the current GUI style.

Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded line:

 QFrame frame:
 frame.setFrameStyle(QFrame::HLine | QFrame::Sunken);

See also qDrawShadeRect(), qDrawShadePanel(), and QStyle.

void qDrawShadeLine ( QPainter * painter, const QPoint & p1, const QPoint & p2, const QPalette & palette, bool sunken = true, int lineWidth = 1, int midLineWidth = 0 )

This is an overloaded function.

Draws a horizontal or vertical shaded line between p1 and p2 using the given painter. Note that nothing is drawn if the line between the points would be neither horizontal nor vertical.

The provided palette specifies the shading colors (light, dark and middle colors). The given lineWidth specifies the line width for each of the lines; it is not the total line width. The given midLineWidth specifies the width of a middle line drawn in the QPalette::mid() color.

The line appears sunken if sunken is true, otherwise raised.

Warning: This function does not look at QWidget::style() or QApplication::style(). Use the drawing functions in QStyle to make widgets that follow the current GUI style.

Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded line:

 QFrame frame:
 frame.setFrameStyle(QFrame::HLine | QFrame::Sunken);

See also qDrawShadeRect(), qDrawShadePanel(), and QStyle.

void qDrawShadePanel ( QPainter * painter, int x, int y, int width, int height, const QPalette & palette, bool sunken = false, int lineWidth = 1, const QBrush * fill = 0 )

Draws the shaded panel beginning at (x, y) with the given width and height using the provided painter and the given lineWidth.

The given palette specifies the shading colors (light, dark and middle colors). The panel's interior is filled with the fill brush unless fill is 0.

The panel appears sunken if sunken is true, otherwise raised.

Warning: This function does not look at QWidget::style() or QApplication::style(). Use the drawing functions in QStyle to make widgets that follow the current GUI style.

Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded panel:

 QFrame frame:
 frame.setFrameStyle( QFrame::Panel | QFrame::Sunken);

See also qDrawWinPanel(), qDrawShadeLine(), qDrawShadeRect(), and QStyle.

void qDrawShadePanel ( QPainter * painter, const QRect & rect, const QPalette & palette, bool sunken = false, int lineWidth = 1, const QBrush * fill = 0 )

This is an overloaded function.

Draws the shaded panel at the rectangle specified by rect using the given painter and the given lineWidth.

The given palette specifies the shading colors (light, dark and middle colors). The panel's interior is filled with the fill brush unless fill is 0.

The panel appears sunken if sunken is true, otherwise raised.

Warning: This function does not look at QWidget::style() or QApplication::style(). Use the drawing functions in QStyle to make widgets that follow the current GUI style.

Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded panel:

 QFrame frame:
 frame.setFrameStyle( QFrame::Panel | QFrame::Sunken);

See also qDrawWinPanel(), qDrawShadeLine(), qDrawShadeRect(), and QStyle.

void qDrawShadeRect ( QPainter * painter, int x, int y, int width, int height, const QPalette & palette, bool sunken = false, int lineWidth = 1, int midLineWidth = 0, const QBrush * fill = 0 )

Draws the shaded rectangle beginning at (x, y) with the given width and height using the provided painter.

The provide palette specifies the shading colors (light, dark and middle colors. The given lineWidth specifies the line width for each of the lines; it is not the total line width. The midLineWidth specifies the width of a middle line drawn in the QPalette::mid() color. The rectangle's interior is filled with the fill brush unless fill is 0.

The rectangle appears sunken if sunken is true, otherwise raised.

Warning: This function does not look at QWidget::style() or QApplication::style(). Use the drawing functions in QStyle to make widgets that follow the current GUI style.

Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded rectangle:

 QFrame frame:
 frame.setFrameStyle(QFrame::Box | QFrame::Raised);

See also qDrawShadeLine(), qDrawShadePanel(), qDrawPlainRect(), and QStyle.

void qDrawShadeRect ( QPainter * painter, const QRect & rect, const QPalette & palette, bool sunken = false, int lineWidth = 1, int midLineWidth = 0, const QBrush * fill = 0 )

This is an overloaded function.

Draws the shaded rectangle specified by rect using the given painter.

The provide palette specifies the shading colors (light, dark and middle colors. The given lineWidth specifies the line width for each of the lines; it is not the total line width. The midLineWidth specifies the width of a middle line drawn in the QPalette::mid() color. The rectangle's interior is filled with the fill brush unless fill is 0.

The rectangle appears sunken if sunken is true, otherwise raised.

Warning: This function does not look at QWidget::style() or QApplication::style(). Use the drawing functions in QStyle to make widgets that follow the current GUI style.

Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded rectangle:

 QFrame frame:
 frame.setFrameStyle(QFrame::Box | QFrame::Raised);

See also qDrawShadeLine(), qDrawShadePanel(), qDrawPlainRect(), and QStyle.

void qDrawWinButton ( QPainter * painter, int x, int y, int width, int height, const QPalette & palette, bool sunken = false, const QBrush * fill = 0 )

Draws the Windows-style button specified by the given point (x, y}, width and height using the provided painter with a line width of 2 pixels. The button's interior is filled with the fill brush unless fill is 0.

The given palette specifies the shading colors (light, dark and middle colors).

The button appears sunken if sunken is true, otherwise raised.

Warning: This function does not look at QWidget::style() or QApplication::style()-> Use the drawing functions in QStyle to make widgets that follow the current GUI style.

See also qDrawWinPanel() and QStyle.

void qDrawWinButton ( QPainter * painter, const QRect & rect, const QPalette & palette, bool sunken = false, const QBrush * fill = 0 )

This is an overloaded function.

Draws the Windows-style button at the rectangle specified by rect using the given painter with a line width of 2 pixels. The button's interior is filled with the fill brush unless fill is 0.

The given palette specifies the shading colors (light, dark and middle colors).

The button appears sunken if sunken is true, otherwise raised.

Warning: This function does not look at QWidget::style() or QApplication::style()-> Use the drawing functions in QStyle to make widgets that follow the current GUI style.

See also qDrawWinPanel() and QStyle.

void qDrawWinPanel ( QPainter * painter, int x, int y, int width, int height, const QPalette & palette, bool sunken = false, const QBrush * fill = 0 )

Draws the Windows-style panel specified by the given point(x, y), width and height using the provided painter with a line width of 2 pixels. The button's interior is filled with the fill brush unless fill is 0.

The given palette specifies the shading colors. The panel appears sunken if sunken is true, otherwise raised.

Warning: This function does not look at QWidget::style() or QApplication::style(). Use the drawing functions in QStyle to make widgets that follow the current GUI style.

Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded panel:

 QFrame frame:
 frame.setFrameStyle(QFrame::WinPanel | QFrame::Raised);

See also qDrawShadePanel(), qDrawWinButton(), and QStyle.

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 ? 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é 16
  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 Quarterly au hasard

Logo

La reconnaissance des gestes de souris

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 4.6
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