You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/man/man3/tqbrush.3qt

235 lines
7.7 KiB

'\" t
.TH TQBrush 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
TQBrush \- Defines the fill pattern of shapes drawn by a TQPainter
.SH SYNOPSIS
\fC#include <tqbrush.h>\fR
.PP
Inherits Qt.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBTQBrush\fR ()"
.br
.ti -1c
.BI "\fBTQBrush\fR ( BrushStyle style )"
.br
.ti -1c
.BI "\fBTQBrush\fR ( const TQColor & color, BrushStyle style = SolidPattern )"
.br
.ti -1c
.BI "\fBTQBrush\fR ( const TQColor & color, const TQPixmap & pixmap )"
.br
.ti -1c
.BI "\fBTQBrush\fR ( const TQBrush & b )"
.br
.ti -1c
.BI "\fB~TQBrush\fR ()"
.br
.ti -1c
.BI "TQBrush & \fBoperator=\fR ( const TQBrush & b )"
.br
.ti -1c
.BI "BrushStyle \fBstyle\fR () const"
.br
.ti -1c
.BI "void \fBsetStyle\fR ( BrushStyle s )"
.br
.ti -1c
.BI "const TQColor & \fBcolor\fR () const"
.br
.ti -1c
.BI "void \fBsetColor\fR ( const TQColor & c )"
.br
.ti -1c
.BI "TQPixmap * \fBpixmap\fR () const"
.br
.ti -1c
.BI "void \fBsetPixmap\fR ( const TQPixmap & pixmap )"
.br
.ti -1c
.BI "bool \fBoperator==\fR ( const TQBrush & b ) const"
.br
.ti -1c
.BI "bool \fBoperator!=\fR ( const TQBrush & b ) const"
.br
.in -1c
.SH RELATED FUNCTION DOCUMENTATION
.in +1c
.ti -1c
.BI "TQDataStream & \fBoperator<<\fR ( TQDataStream & s, const TQBrush & b )"
.br
.ti -1c
.BI "TQDataStream & \fBoperator>>\fR ( TQDataStream & s, TQBrush & b )"
.br
.in -1c
.SH DESCRIPTION
The TQBrush class defines the fill pattern of shapes drawn by a TQPainter.
.PP
A brush has a style and a color. One of the brush styles is a custom pattern, which is defined by a TQPixmap.
.PP
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.
.PP
The brush color defines the color of the fill pattern. The TQColor documentation lists the predefined colors.
.PP
Use the TQPen class for specifying line/outline styles.
.PP
Example:
.PP
.nf
.br
TQPainter painter;
.br
TQBrush brush( yellow ); // yellow solid pattern
.br
painter.begin( &anyPaintDevice ); // paint something
.br
painter.setBrush( brush ); // set the yellow brush
.br
painter.setPen( NoPen ); // do not draw outline
.br
painter.drawRect( 40,30, 200,100 ); // draw filled rectangle
.br
painter.setBrush( NoBrush ); // do not fill
.br
painter.setPen( black ); // set black pen, 0 pixel width
.br
painter.drawRect( 10,10, 30,20 ); // draw rectangle outline
.br
painter.end(); // painting done
.br
.fi
.PP
See the setStyle() function for a complete list of brush styles.
.PP
<center>
.ce 1
.B "[Image Omitted]"
.PP
</center>
.PP
See also TQPainter, TQPainter::setBrush(), TQPainter::setBrushOrigin(), Graphics Classes, Image Processing Classes, and Implicitly and Explicitly Shared Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQBrush::TQBrush ()"
Constructs a default black brush with the style NoBrush (will not fill shapes).
.SH "TQBrush::TQBrush ( BrushStyle style )"
Constructs a black brush with the style \fIstyle\fR.
.PP
See also setStyle().
.SH "TQBrush::TQBrush ( const TQColor & color, BrushStyle style = SolidPattern )"
Constructs a brush with the color \fIcolor\fR and the style \fIstyle\fR.
.PP
See also setColor() and setStyle().
.SH "TQBrush::TQBrush ( const TQColor & color, const TQPixmap & pixmap )"
Constructs a brush with the color \fIcolor\fR and a custom pattern stored in \fIpixmap\fR.
.PP
The color will only have an effect for monochrome pixmaps, i.e. for TQPixmap::depth() == 1.
.PP
Pixmap brushes are currently not supported when printing on X11.
.PP
See also setColor() and setPixmap().
.SH "TQBrush::TQBrush ( const TQBrush & b )"
Constructs a brush that is a shallow copy of \fIb\fR.
.SH "TQBrush::~TQBrush ()"
Destroys the brush.
.SH "const TQColor & TQBrush::color () const"
Returns the brush color.
.PP
See also setColor().
.SH "bool TQBrush::operator!= ( const TQBrush & b ) const"
Returns TRUE if the brush is different from \fIb\fR; otherwise returns FALSE.
.PP
Two brushes are different if they have different styles, colors or pixmaps.
.PP
See also operator==().
.SH "TQBrush & TQBrush::operator= ( const TQBrush & b )"
Assigns \fIb\fR to this brush and returns a reference to this brush.
.SH "bool TQBrush::operator== ( const TQBrush & b ) const"
Returns TRUE if the brush is equal to \fIb\fR; otherwise returns FALSE.
.PP
Two brushes are equal if they have equal styles, colors and pixmaps.
.PP
See also operator!=().
.SH "TQPixmap * TQBrush::pixmap () const"
Returns a pointer to the custom brush pattern, or 0 if no custom brush pattern has been set.
.PP
See also setPixmap().
.PP
Example: richtext/richtext.cpp.
.SH "void TQBrush::setColor ( const TQColor & c )"
Sets the brush color to \fIc\fR.
.PP
See also color() and setStyle().
.PP
Example: picture/picture.cpp.
.SH "void TQBrush::setPixmap ( const TQPixmap & pixmap )"
Sets the brush pixmap to \fIpixmap\fR. The style is set to CustomPattern.
.PP
The current brush color will only have an effect for monochrome pixmaps, i.e. for TQPixmap::depth() == 1.
.PP
Pixmap brushes are currently not supported when printing on X11.
.PP
See also pixmap() and color().
.PP
Example: richtext/richtext.cpp.
.SH "void TQBrush::setStyle ( BrushStyle s )"
Sets the brush style to \fIs\fR.
.PP
The brush styles are: <center>.nf
.TS
l - l. Pattern Meaning NoBrush will not fill shapes (default). SolidPattern solid (100%) fill pattern. Dense1Pattern 94% fill pattern. Dense2Pattern 88% fill pattern. Dense3Pattern 63% fill pattern. Dense4Pattern 50% fill pattern. Dense5Pattern 37% fill pattern. Dense6Pattern 12% fill pattern. Dense7Pattern 6% fill pattern. HorPattern horizontal lines pattern. VerPattern vertical lines pattern. CrossPattern crossing lines pattern. BDiagPattern diagonal lines (directed /) pattern. FDiagPattern diagonal lines (directed &#92;) pattern. DiagCrossPattern diagonal crossing lines pattern. CustomPattern
.TE
.fi
</center>
.PP
On Windows, dense and custom patterns cannot be transparent.
.PP
See the Detailed Description for a picture of all the styles.
.PP
See also style().
.SH "BrushStyle TQBrush::style () const"
Returns the brush style.
.PP
See also setStyle().
.SH RELATED FUNCTION DOCUMENTATION
.SH "TQDataStream & operator<< ( TQDataStream & s, const TQBrush & b )"
Writes the brush \fIb\fR to the stream \fIs\fR and returns a reference to the stream.
.PP
See also Format of the TQDataStream operators.
.SH "TQDataStream & operator>> ( TQDataStream & s, TQBrush & b )"
Reads the brush \fIb\fR from the stream \fIs\fR and returns a reference to the stream.
.PP
See also Format of the TQDataStream operators.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqbrush.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt 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.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqbrush.3qt) and the Qt
version (3.3.8).