📄 qpen.3qt
字号:
.TH QPen 3qt "6 July 1999" "Troll Tech AS" \" -*- nroff -*-.\" Copyright 1992-1999 Troll Tech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQPen \- Defines how a QPainter should draw lines and outlines of shapes.SH SYNOPSIS.br.PP\fC#include <qpen.h>\fR.PPInherits Qt..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQPen\fR ()".br.ti -1c.BI "\fBQPen\fR ( PenStyle )".br.ti -1c.BI "\fBQPen\fR ( const QColor & " "color" ", uint " "width" "=0, PenStyle " "style" "=SolidLine )".br.ti -1c.BI "\fBQPen\fR ( const QPen & )".br.ti -1c.BI "\fB~QPen\fR ()".br.ti -1c.BI "QPen& \fBoperator=\fR ( const QPen & )".br.ti -1c.BI "PenStyle \fBstyle\fR () const".br.ti -1c.BI "void \fBsetStyle\fR ( PenStyle )".br.ti -1c.BI "uint \fBwidth\fR () const".br.ti -1c.BI "void \fBsetWidth\fR ( uint )".br.ti -1c.BI "const QColor& \fBcolor\fR () const".br.ti -1c.BI "void \fBsetColor\fR ( const QColor & )".br.ti -1c.BI "bool \fBoperator==\fR ( const QPen & p ) const".br.ti -1c.BI "bool \fBoperator!=\fR ( const QPen & p ) const".br.in -1c.SH RELATED FUNCTION DOCUMENTATION(Note that these are not member functions.).in +1c.ti -1c.BI "QDataStream & \fBoperator<<\fR (QDataStream & " "s" ", const QPen & " "p" ")".br.ti -1c.BI "QDataStream & \fBoperator>>\fR (QDataStream & " "s" ", QPen & " "p" ")".br.in -1c.SH DESCRIPTIONThe QPen class defines how a QPainter should draw lines and outlines of shapes..PPA pen has a style, a width and a color..PPThe pen style defines the line type. The default pen style is \fCQt::SolidLine.\fR Setting the style to \fCNoPen\fR tells the painter to not draw lines or outlines..PPThe pen width defines the line width. The default line width is 0, which draws a 1-pixel line very fast, but with lower precision than with a line width of 1. Setting the line width to 1 or more draws lines that are precise, but drawing is slower..PPThe pen color defines the color of lines and text. The default line color is black. The QColor documentation lists predefined colors..PPUse the QBrush class for specifying fill styles..PPExample:.PP.nf.br QPainter painter;.br QPen pen( red, 2 ); // red solid line, 2 pixel width.br painter.begin( &anyPaintDevice ); // paint something.br painter.setPen( pen ); // set the red, fat pen.br painter.drawRect( 40,30, 200,100 ); // draw rectangle.br painter.setPen( blue ); // set blue pen, 0 pixel width.br painter.drawLine( 40,30, 240,130 ); // draw diagonal in rectangle.br painter.end(); // painting done.fi.PPSee the setStyle() function for a complete list of pen styles..PPSee also: QPainter and QPainter::setPen()..PPExamples:.(lprogress/progress.cpp desktop/desktop.cpp.)l.SH MEMBER FUNCTION DOCUMENTATION.SH "QPen::QPen ()"Constructs a default black solid line pen with 0 width..SH "QPen::QPen ( PenStyle style )"Constructs a pen black with 0 width and a specified style..PPSee also: setStyle()..SH "QPen::QPen ( const QColor & color, uint width=0, PenStyle style=SolidLine )"Constructs a pen with a specified color, width and style..PPSee also: setWidth(), setStyle() and setColor()..SH "QPen::QPen ( const QPen & p )"Constructs a pen which is a copy of \fIp.\fR.SH "QPen::~QPen ()"Destroys the pen..SH "const QColor & QPen::color () const"Returns the pen color..PPSee also: setColor()..SH "bool QPen::operator!= ( const QPen & p ) const"Returns TRUE if the pen is different from \fIp,\fR or FALSE if the pens are equal..PPTwo pens are different if they have different styles, widths or colors..PPSee also: operator==()..SH "QPen & QPen::operator= ( const QPen & p )"Assigns \fIc\fR to this pen and returns a reference to this pen..SH "bool QPen::operator== ( const QPen & p ) const"Returns TRUE if the pen is equal to \fIp,\fR or FALSE if the pens are different..PPTwo pens are equal if they have equal styles, widths and colors..PPSee also: operator!=()..SH "void QPen::setColor ( const QColor & c )"Sets the pen color to \fIc.\fR.PPSee also: color()..PPExamples:.(lprogress/progress.cpp.)l.SH "void QPen::setWidth ( uint w )"Sets the pen width to \fIw.\fR.PPSee also: width()..PPExamples:.(lprogress/progress.cpp.)l.SH "PenStyle QPen::style () const"Returns the pen style..PPSee also: setStyle()..SH "uint QPen::width () const"Returns the pen width..PPSee also: setWidth()..SH RELATED FUNCTION DOCUMENTATION.SH "QDataStream & operator<< (QDataStream & s, const QPen & p)"Writes a pen to the stream and returns a reference to the stream..PPThe serialization format is:.IP 1The pen style (UINT8).IP 2The pen width (UINT8).IP 3The pen color (QColor).SH "QDataStream & operator>> (QDataStream & s, QPen & p)"Reads a pen from the stream and returns a reference to the stream..SH "SEE ALSO".BR http://www.troll.no/qt/qpen.html.SH COPYRIGHTCopyright 1992-1999 Troll Tech AS. See the license file included inthe distribution for a complete license statement..SH AUTHORGenerated automatically from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -