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

📄 qpalette.3qt

📁 linux下GUI编程工具qt的在线连接帮助手册
💻 3QT
字号:
'\" t.TH QPalette 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 NAMEQPalette \- Color groups for each widget state.PP\fC#include <qpalette.h>\fR.PP.SS "Public Members".in +1c.ti -1c.BI "\fBQPalette\fR ()".br.ti -1c.BI "QPalette ( const QColor & button )  \fI(obsolete)\fR".br.ti -1c.BI "\fBQPalette\fR ( const QColor & button, const QColor & background )".br.ti -1c.BI "\fBQPalette\fR ( const QColorGroup & active, const QColorGroup & disabled, const QColorGroup & inactive )".br.ti -1c.BI "\fBQPalette\fR ( const QPalette & p )".br.ti -1c.BI "\fB~QPalette\fR ()".br.ti -1c.BI "QPalette & \fBoperator=\fR ( const QPalette & p )".br.ti -1c.BI "enum \fBColorGroup\fR { Disabled, Active, Inactive, NColorGroups, Normal = Active }".br.ti -1c.BI "const QColor & \fBcolor\fR ( ColorGroup gr, QColorGroup::ColorRole r ) const".br.ti -1c.BI "const QBrush & \fBbrush\fR ( ColorGroup gr, QColorGroup::ColorRole r ) const".br.ti -1c.BI "void \fBsetColor\fR ( ColorGroup gr, QColorGroup::ColorRole r, const QColor & c )".br.ti -1c.BI "void \fBsetBrush\fR ( ColorGroup gr, QColorGroup::ColorRole r, const QBrush & b )".br.ti -1c.BI "void \fBsetColor\fR ( QColorGroup::ColorRole r, const QColor & c )".br.ti -1c.BI "void \fBsetBrush\fR ( QColorGroup::ColorRole r, const QBrush & b )".br.ti -1c.BI "QPalette \fBcopy\fR () const".br.ti -1c.BI "const QColorGroup & \fBactive\fR () const".br.ti -1c.BI "const QColorGroup & \fBdisabled\fR () const".br.ti -1c.BI "const QColorGroup & \fBinactive\fR () const".br.ti -1c.BI "const QColorGroup & \fBnormal\fR () const".br.ti -1c.BI "void \fBsetActive\fR ( const QColorGroup & g )".br.ti -1c.BI "void \fBsetDisabled\fR ( const QColorGroup & g )".br.ti -1c.BI "void \fBsetInactive\fR ( const QColorGroup & g )".br.ti -1c.BI "void \fBsetNormal\fR ( const QColorGroup & cg )".br.ti -1c.BI "bool \fBoperator==\fR ( const QPalette & p ) const".br.ti -1c.BI "bool \fBoperator!=\fR ( const QPalette & p ) const".br.ti -1c.BI "bool \fBisCopyOf\fR ( const QPalette & p )".br.ti -1c.BI "int \fBserialNumber\fR () const".br.in -1c.SH RELATED FUNCTION DOCUMENTATION.in +1c.ti -1c.BI "QDataStream & \fBoperator<<\fR ( QDataStream & s, const QPalette & p )".br.ti -1c.BI "QDataStream & \fBoperator>>\fR ( QDataStream & s, QPalette & p )".br.in -1c.SH DESCRIPTIONThe QPalette class contains color groups for each widget state..PPA palette consists of three color groups: \fIactive\fR, \fIdisabled\fR, and \fIinactive\fR. All widgets contain a palette, and all widgets in Qt use their palette to draw themselves. This makes the user interface easily configurable and easier to keep consistent..PPIf you create a new widget we strongly recommend that you use the colors in the palette rather than hard-coding specific colors..PPThe color groups:.TPThe active() group is used for the window that has keyboard focus..TPThe inactive() group is used for other windows..TPThe disabled() group is used for widgets (not windows) that are disabled for some reason..PPBoth active and inactive windows can contain disabled widgets. (Disabled widgets are often called \fIinaccessible\fR or \fIgrayed\fR \fIout\fR.).PPIn Motif style, active() and inactive() look precisely the same. In Windows 2000 style and Macintosh Platinum style, the two styles look slightly different..PPThere are setActive(), setInactive(), and setDisabled() functions to modify the palette. (Qt also supports a normal() group; this is an obsolete alias for active(), supported for backwards compatibility.).PPColors and brushes can be set for particular roles in any of a palette's color groups with setColor() and setBrush()..PPYou can copy a palette using the copy constructor and test to see if two palettes are \fIidentical\fR using isCopyOf()..PPSee also QApplication::setPalette(), QWidget::palette, QColorGroup, QColor, Widget Appearance and Style, Graphics Classes, Image Processing Classes and Implicitly and Explicitly Shared Classes..SS "Member Type Documentation".SH "QPalette::ColorGroup".TP\fCQPalette::Disabled\fR.TP\fCQPalette::Active\fR.TP\fCQPalette::Inactive\fR.TP\fCQPalette::NColorGroups\fR.TP\fCQPalette::Normal\fR - synonym for Active.SH MEMBER FUNCTION DOCUMENTATION.SH "QPalette::QPalette ()"Constructs a palette that consists of color groups with only black colors..SH "QPalette::QPalette ( const QColor & button )"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..PPConstructs a palette from the \fIbutton\fR color. The other colors are automatically calculated, based on this color. Background will be the button color as well..SH "QPalette::QPalette ( const QColor & button, const QColor & background )"Constructs a palette from a \fIbutton\fR color and a \fIbackground\fR. The other colors are automatically calculated, based on these colors..SH "QPalette::QPalette ( const QColorGroup & active, const QColorGroup & disabled, const QColorGroup & inactive )"Constructs a palette that consists of the three color groups \fIactive\fR, \fIdisabled\fR and \fIinactive\fR. See QPalette for definitions of the color groups and QColorGroup::ColorRole for definitions of each color role in the three groups..PPSee also QColorGroup and QColorGroup::ColorRole..SH "QPalette::QPalette ( const QPalette & p )"Constructs a copy of \fIp\fR..PPThis constructor is fast (it uses copy-on-write)..SH "QPalette::~QPalette ()"Destroys the palette..SH "const QColorGroup & QPalette::active () const"Returns the active color group of this palette..PPSee also QColorGroup, setActive(), inactive() and disabled()..PPExamples:.)l themes/metal.cpp and themes/wood.cpp..SH "const QBrush & QPalette::brush ( ColorGroup gr, QColorGroup::ColorRole r ) const"Returns the brush in color group \fIgr\fR, used for color role \fIr\fR..PPSee also color(), setBrush() and QColorGroup::ColorRole..SH "const QColor & QPalette::color ( ColorGroup gr, QColorGroup::ColorRole r ) const"Returns the color in color group \fIgr\fR, used for color role \fIr\fR..PPSee also brush(), setColor() and QColorGroup::ColorRole..SH "QPalette QPalette::copy () const"Returns a deep copy of this palette. This is slower than the copy constructor and assignment operator and no longer offers any advantages..SH "const QColorGroup & QPalette::disabled () const"Returns the disabled color group of this palette..PPSee also QColorGroup, setDisabled(), active() and inactive()..PPExamples:.)l themes/metal.cpp and themes/wood.cpp..SH "const QColorGroup & QPalette::inactive () const"Returns the inactive color group of this palette..PPSee also QColorGroup, setInactive(), active() and disabled()..SH "bool QPalette::isCopyOf ( const QPalette & p )"Returns TRUE if this palette and \fIp\fR are copies of each other, ie. one of them was created as a copy of the other and neither was subsequently modified. This is much stricter than equality..PPSee also operator=() and operator==()..SH "const QColorGroup & QPalette::normal () const"Returns the active color group..PPSee also setActive() and active()..SH "bool QPalette::operator!= ( const QPalette & p ) const"Returns TRUE (slowly) if this palette is different from \fIp\fR; otherwise returns FALSE (usually quickly)..SH "QPalette & QPalette::operator= ( const QPalette & p )"Assigns \fIp\fR to this palette and returns a reference to this palette..PPThis is fast (it uses copy-on-write)..PPSee also copy()..SH "bool QPalette::operator== ( const QPalette & p ) const"Returns TRUE (usually quickly) if this palette is equal to \fIp\fR; otherwise returns FALSE (slowly)..SH "int QPalette::serialNumber () const"Returns a number that uniquely identifies this QPalette object. The serial number is intended for caching. Its value may not be used for anything other than equality testing..PPNote that QPalette uses copy-on-write, and the serial number changes during the lazy copy operation (detach()), not during a shallow copy (copy constructor or assignment)..PPSee also QPixmap, QPixmapCache and QCache..SH "void QPalette::setActive ( const QColorGroup & g )"Sets the Active color group to \fIg\fR..PPSee also active(), setDisabled(), setInactive() and QColorGroup..SH "void QPalette::setBrush ( ColorGroup gr, QColorGroup::ColorRole r, const QBrush & b )"Sets the brush in color group \fIgr\fR, used for color role \fIr\fR, to \fIb\fR..PPSee also brush(), setColor() and QColorGroup::ColorRole..SH "void QPalette::setBrush ( QColorGroup::ColorRole r, const QBrush & b )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPSets the brush in for color role \fIr\fR in all three color groups to \fIb\fR..PPSee also brush(), setColor(), QColorGroup::ColorRole, active(), inactive() and disabled()..SH "void QPalette::setColor ( ColorGroup gr, QColorGroup::ColorRole r, const QColor & c )"Sets the brush in color group \fIgr\fR, used for color role \fIr\fR, to the solid color \fIc\fR..PPSee also setBrush(), color() and QColorGroup::ColorRole..PPExample: themes/themes.cpp..SH "void QPalette::setColor ( QColorGroup::ColorRole r, const QColor & c )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPSets the brush color used for color role \fIr\fR to color \fIc\fR in all three color groups..PPSee also color(), setBrush() and QColorGroup::ColorRole..SH "void QPalette::setDisabled ( const QColorGroup & g )"Sets the Disabled color group to \fIg\fR..PPSee also disabled(), setActive() and setInactive()..SH "void QPalette::setInactive ( const QColorGroup & g )"Sets the Inactive color group to \fIg\fR..PPSee also active(), setDisabled(), setActive() and QColorGroup..SH "void QPalette::setNormal ( const QColorGroup & cg )"Sets the active color group to \fIcg\fR..PPSee also setActive() and active()..SH RELATED FUNCTION DOCUMENTATION.SH "QDataStream & operator<< ( QDataStream & s, const QPalette & p )"Writes the palette, \fIp\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, QPalette & p )"Reads a palette from the stream, \fIs\fR into the palette \fIp\fR, and returns a reference to the stream..PPSee also Format of the QDataStream operators..SH "SEE ALSO".BR http://doc.trolltech.com/qpalette.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 (qpalette.3qt) and the Qtversion (3.0.0).

⌨️ 快捷键说明

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