Homepage > Man Pages > Category > Subroutines
Homepage > Man Pages > Name > Q

qbrush

man page of qbrush

qbrush: Defines the fill pattern of shapes drawn by a QPainter

NAME

QBrush - Defines the fill pattern of shapes drawn by a QPainter

SYNOPSIS

#include <qbrush.h> Inherits Qt. Public Members QBrush () QBrush ( BrushStyle style ) QBrush ( const QColor & color, BrushStyle style = SolidPattern ) QBrush ( const QColor & color, const QPixmap & pixmap ) QBrush ( const QBrush & b ) ~QBrush () QBrush & operator= ( const QBrush & b ) BrushStyle style () const void setStyle ( BrushStyle s ) const QColor & color () const void setColor ( const QColor & c ) QPixmap * pixmap () const void setPixmap ( const QPixmap & pixmap ) bool operator== ( const QBrush & b ) const bool operator!= ( const QBrush & b ) const
RELATED FUNCTION DOCUMENTATION
QDataStream & operator<< ( QDataStream & s, const QBrush & b ) QDataStream & operator>> ( QDataStream & s, QBrush & b )
DESCRIPTION
The QBrush class defines the fill pattern of shapes drawn by a QPainter. A brush has a style and a color. One of the brush styles is a custom pattern, which is defined by a QPixmap. The brush style defines the fill pattern. The default brush style is NoBrush (depending on how you construct a brush). This style tells the painter to not fill shapes. The standard style for filling is SolidPattern. The brush color defines the color of the fill pattern. The QColor documentation lists the predefined colors. Use the QPen class for specifying line/outline styles. Example: QPainter painter; QBrush brush( yellow ); // yellow solid pattern painter.begin( &anyPaintDevice ); // paint something painter.setBrush( brush ); // set the yellow brush painter.setPen( NoPen ); // do not draw outline painter.drawRect( 40,30, 200,100 ); // draw filled rectangle painter.setBrush( NoBrush ); // do not fill painter.setPen( black ); // set black pen, 0 pixel width painter.drawRect( 10,10, 30,20 ); // draw rectangle outline painter.end(); // painting done See the setStyle() function for a complete list of brush styles. <center> [Image Omitted] </center> See also QPainter, QPainter::setBrush(), QPainter::setBrushOrigin(), Graphics Classes, Image Processing Classes, and Implicitly and Explicitly Shared Classes.

MEMBER FUNCTION DOCUMENTATION

QBRUSH::QBRUSH ()

Constructs a default black brush with the style NoBrush (will not fill shapes).

QBRUSH::QBRUSH ( BRUSHSTYLE STYLE )

Constructs a black brush with the style style. See also setStyle().

QBRUSH::QBRUSH ( CONST QCOLOR & COLOR, BRUSHSTYLE STYLE = SOLIDPATTERN )

Constructs a brush with the color color and the style style. See also setColor() and setStyle().
QBRUSH::QBRUSH ( CONST QCOLOR & COLOR, CONST QPIXMAP & PIXMAP )
Constructs a brush with the color color and a custom pattern stored in pixmap. The color will only have an effect for monochrome pixmaps, i.e. for QPixmap::depth() == 1. Pixmap brushes are currently not supported when printing on X11. See also setColor() and setPixmap().
QBRUSH::QBRUSH ( CONST QBRUSH & B )
Constructs a brush that is a shallow copy of b.

QBRUSH::~QBRUSH ()

Destroys the brush.

CONST QCOLOR & QBRUSH::COLOR () CONST

Returns the brush color. See also setColor().

BOOL QBRUSH::OPERATOR!= ( CONST QBRUSH & B ) CONST

Returns TRUE if the brush is different from b; otherwise returns FALSE. Two brushes are different if they have different styles, colors or pixmaps. See also operator==().

QBRUSH & QBRUSH::OPERATOR= ( CONST QBRUSH & B )

Assigns b to this brush and returns a reference to this brush.
BOOL QBRUSH::OPERATOR== ( CONST QBRUSH & B ) CONST
Returns TRUE if the brush is equal to b; otherwise returns FALSE. Two brushes are equal if they have equal styles, colors and pixmaps. See also operator!=().
QPIXMAP * QBRUSH::PIXMAP () CONST
Returns a pointer to the custom brush pattern, or 0 if no custom brush pattern has been set. See also setPixmap(). Example: richtext/richtext.cpp.

VOID QBRUSH::SETCOLOR ( CONST QCOLOR & C )

Sets the brush color to c. See also color() and setStyle(). Example: picture/picture.cpp.

VOID QBRUSH::SETPIXMAP ( CONST QPIXMAP & PIXMAP )

Sets the brush pixmap to pixmap. The style is set to CustomPattern. The current brush color will only have an effect for monochrome pixmaps, i.e. for QPixmap::depth() == 1. Pixmap brushes are currently not supported when printing on X11. See also pixmap() and color(). Example: richtext/richtext.cpp.

VOID QBRUSH::SETSTYLE ( BRUSHSTYLE S )

Sets the brush style to s. The brush styles are: <center>.nf </center> On Windows, dense and custom patterns cannot be transparent. See the Detailed Description for a picture of all the styles. See also style().

BRUSHSTYLE QBRUSH::STYLE () CONST

Returns the brush style. See also setStyle().
RELATED FUNCTION DOCUMENTATION
QDATASTREAM & OPERATOR<< ( QDATASTREAM & S, CONST QBRUSH & B )
Writes the brush b to the stream s and returns a reference to the stream. See also Format of the QDataStream operators.

QDATASTREAM & OPERATOR>> ( QDATASTREAM & S, QBRUSH & B )

Reads the brush b from the stream s and returns a reference to the stream. See also Format of the QDataStream operators.

SEE ALSO

//doc.trolltech.com/qbrush.html //www.trolltech.com/faq/tech.html

COPYRIGHT

Copyright 1992-2007 Trolltech ASA, //www.trolltech.com. See the license file included in the distribution for a complete license statement.

AUTHOR

Generated automatically from the source code.
BUGS
If you find a bug in Qt, please report it as described in //doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt- bugs@trolltech.com. Please include the name of the manual page (qbrush.3qt) and the Qt version (3.3.8). QBRUSH(3)
 
 
 

Copyright © 2011–2018 by topics-of-interest.com . All rights reserved. Hosted by all-inkl.
Contact · Imprint · Privacy

Page generated in 15.74ms.

get-ip.de | generiere.de | information-information.de