⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qbrush.3qt

📁 linux下GUI编程工具qt的在线连接帮助手册
💻 3QT
字号:
'\" t.TH QBrush 3qt "11 October 2001" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQBrush \- Defines the fill pattern of shapes drawn by a QPainter.PP\fC#include <qbrush.h>\fR.PPInherits Qt..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQBrush\fR ()".br.ti -1c.BI "\fBQBrush\fR ( BrushStyle style )".br.ti -1c.BI "\fBQBrush\fR ( const QColor & color, BrushStyle style = SolidPattern )".br.ti -1c.BI "\fBQBrush\fR ( const QColor & color, const QPixmap & pixmap )".br.ti -1c.BI "\fBQBrush\fR ( const QBrush & b )".br.ti -1c.BI "\fB~QBrush\fR ()".br.ti -1c.BI "QBrush & \fBoperator=\fR ( const QBrush & b )".br.ti -1c.BI "BrushStyle \fBstyle\fR () const".br.ti -1c.BI "void \fBsetStyle\fR ( BrushStyle s )".br.ti -1c.BI "const QColor & \fBcolor\fR () const".br.ti -1c.BI "void \fBsetColor\fR ( const QColor & c )".br.ti -1c.BI "QPixmap * \fBpixmap\fR () const".br.ti -1c.BI "void \fBsetPixmap\fR ( const QPixmap & pixmap )".br.ti -1c.BI "bool \fBoperator==\fR ( const QBrush & b ) const".br.ti -1c.BI "bool \fBoperator!=\fR ( const QBrush & b ) const".br.in -1c.SH RELATED FUNCTION DOCUMENTATION.in +1c.ti -1c.BI "QDataStream & \fBoperator<<\fR ( QDataStream & s, const QBrush & b )".br.ti -1c.BI "QDataStream & \fBoperator>>\fR ( QDataStream & s, QBrush & b )".br.in -1c.SH DESCRIPTIONThe QBrush class defines the fill pattern of shapes drawn by a QPainter..PPA brush has a style and a color. One of the brush styles is a custom pattern, which is defined by a QPixmap..PPThe brush style defines the fill pattern. The default brush style is NoBrush (depends on how you construct a brush). This style tells the painter to not fill shapes. The standard style for filling is called SolidPattern..PPThe brush color defines the color of the fill pattern. The QColor documentation lists the predefined colors..PPUse the QPen class for specifying line/outline styles..PPExample:.PP.nf.br    QPainter painter;.br    QBrush   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.PPSee the setStyle() function for a complete list of brush styles..PPSee also QPainter, QPainter::setBrush(), QPainter::setBrushOrigin(), Graphics Classes, Image Processing Classes and Implicitly and Explicitly Shared Classes..SH MEMBER FUNCTION DOCUMENTATION.SH "QBrush::QBrush ()"Constructs a default black brush with the style NoBrush (will not fill shapes)..SH "QBrush::QBrush ( BrushStyle style )"Constructs a black brush with the style \fIstyle\fR..PPSee also setStyle()..SH "QBrush::QBrush ( const QColor & color, BrushStyle style = SolidPattern )"Constructs a brush with the color \fIcolor\fR and the style \fIstyle\fR..PPSee also setColor() and setStyle()..SH "QBrush::QBrush ( const QColor & color, const QPixmap & pixmap )"Constructs a brush with the color \fIcolor\fR and a custom pattern stored in \fIpixmap\fR..PPThe color will only have an effect for monochrome pixmaps, i.e., QPixmap::depth() == 1..PPSee also setColor() and setPixmap()..SH "QBrush::QBrush ( const QBrush & b )"Constructs a brush that is a shallow copy of \fIb\fR..SH "QBrush::~QBrush ()"Destroys the brush..SH "const QColor & QBrush::color () const"Returns the brush color..PPSee also setColor()..SH "bool QBrush::operator!= ( const QBrush & b ) const"Returns TRUE if the brush is different from \fIb\fR or FALSE if the brushes are equal..PPTwo brushes are different if they have different styles, colors or pixmaps..PPSee also operator==()..SH "QBrush & QBrush::operator= ( const QBrush & b )"Assigns \fIb\fR to this brush and returns a reference to this brush..SH "bool QBrush::operator== ( const QBrush & b ) const"Returns TRUE if the brush is equal to \fIb\fR, or FALSE if the brushes are different..PPTwo brushes are equal if they have equal styles, colors and pixmaps..PPSee also operator!=()..SH "QPixmap * QBrush::pixmap () const"Returns a pointer to the custom brush pattern..PPA null pointer is returned if no custom brush pattern has been set..PPSee also setPixmap()..SH "void QBrush::setColor ( const QColor & c )"Sets the brush color to \fIc\fR..PPSee also color() and setStyle()..PPExample: picture/picture.cpp..SH "void QBrush::setPixmap ( const QPixmap & pixmap )"Sets the brush pixmap to \fIpixmap\fR. The style is set to CustomPattern..PPThe current brush color will only have an effect for monochrome pixmaps, i.e. QPixmap::depth() == 1..PPSee also pixmap() and color()..PPExample: richtext/richtext.cpp..SH "void QBrush::setStyle ( BrushStyle s )"Sets the brush style to \fIs\fR..PPThe brush styles are:.TPNoBrush will not fill shapes (default)..TPSolidPattern solid (100%) fill pattern..TPDense1Pattern 94% fill pattern..TPDense2Pattern 88% fill pattern..TPDense3Pattern 63% fill pattern..TPDense4Pattern 50% fill pattern..TPDense5Pattern 37% fill pattern..TPDense6Pattern 12% fill pattern..TPDense7Pattern 6% fill pattern..TPHorPattern horizontal lines pattern..TPVerPattern vertical lines pattern..TPCrossPattern crossing lines pattern..TPBDiagPattern diagonal lines (directed / ) pattern..TPFDiagPattern diagonal lines (directed &#92; ) pattern..TPDiagCrossPattern diagonal crossing lines pattern..TPCustomPattern set when a pixmap pattern is being used..PPSee also style()..SH "BrushStyle QBrush::style () const"Returns the brush style..PPSee also setStyle()..SH RELATED FUNCTION DOCUMENTATION.SH "QDataStream & operator<< ( QDataStream & s, const QBrush & b )"Writes the brush \fIb\fR to the stream \fIs\fR and returns a reference to the stream..PPSee also Format of the QDataStream operators..SH "QDataStream & operator>> ( QDataStream & s, QBrush & b )"Reads the brush \fIb\fR from the stream \fIs\fR and returns a reference to the stream..PPSee also Format of the QDataStream operators..SH "SEE ALSO".BR http://doc.trolltech.com/qbrush.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf 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..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qbrush.3qt) and the Qtversion (3.0.0).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -