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

📄 qstyle.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
📖 第 1 页 / 共 4 页
字号:
.TPopt.tab() \fIt\fR is the QTab being drawn. Style_Selected Set if the tab is the current tab. CE_ProgressBarGroove(const QProgressBar *).PPand.PPCE_ProgressBarContents(const QProgressBar *).PPand.PPCE_ProgressBarLabel(const QProgressBar *).PP	Style_Enabled	Set if the progressbar is enabled.	Unused.Style_HasFocus Set if the progressbar has input focus. CE_PopupMenuItem(const QPopupMenu *) Style_Enabled Set if the menuitem is enabled. QStyleOption ( QMenuItem *mi, int tabwidth, int maxpmwidth ).TPopt.menuItem().TPopt.tabWidth().TPopt.maxIconWidth() \fImi\fR is the menu item being drawn. QMenuItem is currently an internal class. Style_Active Set if the menuitem is the current item. \fItabwidth\fR is the width of the tab column where key accelerators are drawn. Style_Down Set if the menuitem is down (i.e., the mouse button or space bar is pressed). \fImaxpmwidth\fR is the maximum width of the check column where checkmarks and iconsets are drawn. CE_MenuBarItem(const QMenuBar *) Style_Enabled Set if the menuitem is enabled QStyleOption ( QMenuItem *mi ).TPopt.menuItem() \fImi\fR is the menu item being drawn. Style_Active Set if the menuitem is the current item. Style_Down Set if the menuitem is down (i.e., a mouse button or the space bar is pressed). Style_HasFocus Set if the menubar has input focus. CE_ToolButtonLabel(const QToolButton *) Style_Enabled Set if the toolbutton is enabled. QStyleOption ( ArrowType t ).TPopt.arrowType() When the tool button only contains an arrow, \fIt\fR is the arrow's type. Style_HasFocus Set if the toolbutton has input focus. Style_Down Set if the toolbutton is down (i.e., a mouse button or the space is pressed). Style_On Set if the toolbutton is a toggle button and is toggled on. Style_AutoRaise Set if the toolbutton has auto-raise enabled. Style_MouseOver Set if the mouse pointer is over the toolbutton. Style_Raised.TE.fi</center>.PPSee also ControlElement and StyleFlags..SH "void QStyle::drawControlMask ( ControlElement element, QPainter * p, const QWidget * widget, const QRect & r, const QStyleOption & opt = QStyleOption::Default ) const\fC [pure virtual]\fR"Draw a bitmask for the ControlElement \fIelement\fR using the painter \fIp\fR in the area \fIr\fR. See drawControl() for an explanation of the use of the \fIwidget\fR and \fIopt\fR arguments..PPThe rect \fIr\fR should be in screen coordinates..PPSee also drawControl() and ControlElement..SH "void QStyle::drawItem ( QPainter * p, const QRect & r, int flags, const QColorGroup & g, bool enabled, const QPixmap * pixmap, const QString & text, int len = -1, const QColor * penColor = 0 ) const\fC [virtual]\fR"Draws the \fItext\fR or \fIpixmap\fR in rectangle \fIr\fR using painter \fIp\fR and color group \fIg\fR. The pen color is specified with \fIpenColor\fR. The \fIenabled\fR bool indicates whether or not the item is enabled; when reimplementing this bool should influence how the item is drawn. If \fIlen\fR is -1 (the default) all the \fItext\fR is drawn; otherwise only the first \fIlen\fR characters of \fItext\fR are drawn. The text is aligned and wrapped according to the alignment \fIflags\fR (see Qt::AlignmentFlags)..PPBy default, if both the text and the pixmap are not null, the pixmap is drawn and the text is ignored..SH "void QStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect & r, const QColorGroup & cg, SFlags flags = Style_Default, const QStyleOption & opt = QStyleOption::Default ) const\fC [pure virtual]\fR"Draws the style PrimitiveElement \fIpe\fR using the painter \fIp\fR in the area \fIr\fR. Colors are used from the color group \fIcg\fR..PPThe rect \fIr\fR should be in screen coordinates..PPThe \fIflags\fR argument is used to control how the PrimitiveElement is drawn. Multiple flags can be OR'ed together..PPFor example, a pressed button would be drawn with the flags Style_Enabled and Style_Down..PPThe \fIopt\fR argument can be used to control how various PrimitiveElements are drawn. Note that \fIopt\fR may be the default value even for PrimitiveElements that make use of extra options. When \fIopt\fR is non-default, it is used as follows:.PP<center>.nf.TSl - l. PrimitiveElement Options Notes PE_FocusRect QStyleOption ( const QColor & bg ).TPopt.color() \fIbg\fR is the background color on which the focus rect is being drawn. PE_Panel QStyleOption ( int linewidth, int midlinewidth ).TPopt.lineWidth().TPopt.midLineWidth() \fIlinewidth\fR is the line width for drawing the panel. \fImidlinewidth\fR is the mid-line width for drawing the panel. PE_PanelPopup QStyleOption ( int linewidth, int midlinewidth ).TPopt.lineWidth().TPopt.midLineWidth() \fIlinewidth\fR is the line width for drawing the panel. \fImidlinewidth\fR is the mid-line width for drawing the panel. PE_PanelMenuBar QStyleOption ( int linewidth, int midlinewidth ).TPopt.lineWidth().TPopt.midLineWidth() \fIlinewidth\fR is the line width for drawing the panel. \fImidlinewidth\fR is the mid-line width for drawing the panel. PE_PanelDockWindow QStyleOption ( int linewidth, int midlinewidth ).TPopt.lineWidth().TPopt.midLineWidth() \fIlinewidth\fR is the line width for drawing the panel. \fImidlinewidth\fR is the mid-line width for drawing the panel. PE_GroupBoxFrame QStyleOption ( int linewidth, int midlinewidth, int shape, int shadow ).TPopt.lineWidth().TPopt.midLineWidth().TPopt.frameShape().TPopt.frameShadow() \fIlinewidth\fR is the line width for the group box. \fImidlinewidth\fR is the mid-line width for the group box. \fIshape\fR is the frame shape for the group box..TE.fi</center>.PPFor all other PrimitiveElements, \fIopt\fR is unused..PPSee also StyleFlags..PPExample: themes/wood.cpp..SH "QRect QStyle::itemRect ( QPainter * p, const QRect & r, int flags, bool enabled, const QPixmap * pixmap, const QString & text, int len = -1 ) const\fC [virtual]\fR"Returns the appropriate area (see below) within rectangle \fIr\fR in which to draw the \fItext\fR or \fIpixmap\fR using painter \fIp\fR. If \fIlen\fR is -1 (the default) all the \fItext\fR is drawn; otherwise only the first \fIlen\fR characters of \fItext\fR are drawn. The text is aligned in accordance with the alignment \fIflags\fR (see Qt::AlignmentFlags). The \fIenabled\fR bool indicates whether or not the item is enabled..PPIf \fIr\fR is larger than the area needed to render the \fItext\fR the rectangle that is returned will be offset within \fIr\fR in accordance with the alignment \fIflags\fR. For example if \fIflags\fR is AlignCenter the returned rectangle will be centered within \fIr\fR. If \fIr\fR is smaller than the area needed the rectangle that is returned will be \fIlarger\fR than \fIr\fR (the smallest rectangle large enough to render the \fItext\fR or \fIpixmap\fR)..PPBy default, if both the text and the pixmap are not null, the pixmap is drawn and the text is ignored..SH "int QStyle::pixelMetric ( PixelMetric metric, const QWidget * widget = 0 ) const\fC [pure virtual]\fR"Returns the pixel metric for \fImetric\fR. The \fIwidget\fR argument is a pointer to a QWidget or one of its subclasses. The widget can be cast to the appropriate type based on the value of \fImetric\fR. Note that \fIwidget\fR may be zero even for PixelMetrics that can make use of \fIwidget\fR. See the table below for the appropriate \fIwidget\fR casts:.PP<center>.nf.TSl - l. PixelMetric Widget Cast PM_SliderControlThickness (const QSlider *) PM_SliderLength (const QSlider *) PM_SliderTickmarkOffset (const QSlider *) PM_SliderSpaceAvailable (const QSlider *) PM_TabBarTabOverlap (const QTabBar *) PM_TabBarTabHSpace (const QTabBar *) PM_TabBarTabVSpace (const QTabBar *) PM_TabBarBaseHeight (const QTabBar *) PM_TabBarBaseOverlap.TE.fi</center>.SH "void QStyle::polish ( QWidget * )\fC [virtual]\fR"Initializes the appearance of a widget..PPThis function is called for every widget at some point after it has been fully created but just \fIbefore\fR it is shown the very first time..PPReasonable actions in this function might be to call QWidget::setBackgroundMode() for the widget. An example of highly unreasonable use would be setting the geometry! Reimplementing this function gives you a back-door through which you can change the appearance of a widget. With Qt 3.0's style engine you will rarely need to write your own polish(); instead reimplement drawItem(), drawPrimitive(), etc..PPThe QWidget::inherits() function may provide enough information to allow class-specific customizations. But be careful not to hard-code things too much because new QStyle subclasses are expected to work reasonably with all current and \fIfuture\fR widgets..PPSee also unPolish()..PPExamples:.)l themes/metal.cpp and themes/wood.cpp..SH "void QStyle::polish ( QApplication * )\fC [virtual]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPLate initialization of the QApplication object..PPSee also unPolish()..SH "void QStyle::polish ( QPalette & )\fC [virtual]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPThe style may have certain requirements for color palettes. In this function it has the chance to change the palette according to these requirements..PPSee also QPalette and QApplication::setPalette()..SH "void QStyle::polishPopupMenu ( QPopupMenu * )\fC [pure virtual]\fR"Polishes the popup menu according to the GUI style. This usually means setting the mouse tracking (QPopupMenu::setMouseTracking()) and whether the menu is checkable by default (QPopupMenu::setCheckable())..SH "SubControl QStyle::querySubControl ( ComplexControl control, const QWidget * widget, const QPoint & pos, const QStyleOption & opt = QStyleOption::Default ) const\fC [pure virtual]\fR"Returns the SubControl for \fIwidget\fR at the point \fIpos\fR. The \fIwidget\fR argument is a pointer to a QWidget or one of its subclasses. The widget can be cast to the appropriate type based on the value of \fIcontrol\fR. The \fIopt\fR argument can be used to pass extra information required when drawing the ComplexControl. Note that \fIopt\fR may be the default value even for ComplexControls that can make use of the extra options. See drawComplexControl() for an explanation of the \fIwidget\fR and \fIopt\fR arguments..PPNote that \fIpos\fR is passed in screen coordinates. When using querySubControlMetrics() to check for hits and misses, use visualRect() to change the logical coordinates into screen coordinates..PPSee also drawComplexControl(), ComplexControl, SubControl, and querySubControlMetrics()..SH "QRect QStyle::querySubControlMetrics ( ComplexControl control, const QWidget * widget, SubControl subcontrol, const QStyleOption & opt = QStyleOption::Default ) const\fC [pure virtual]\fR"Returns the rect for the SubControl \fIsubcontrol\fR for \fIwidget\fR in logical coordinates..PPThe \fIwidget\fR argument is a pointer to a QWidget or one of its subclasses. The widget can be cast to the appropriate type based on the value of \fIcontrol\fR. The \fIopt\fR argument can be used to pass extra information required when drawing the ComplexControl. Note that \fIopt\fR may be the default value even for ComplexControls that can make use of the extra options. See drawComplexControl() for an explanation of the \fIwidget\fR and \fIopt\fR arguments..PPSee also drawComplexControl(), ComplexControl, and SubControl..SH "QSize QStyle::scrollBarExtent () const"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..SH "QSize QStyle::sizeFromContents ( ContentsType contents, const QWidget * widget, const QSize & contentsSize, const QStyleOption & opt = QStyleOption::Default ) const\fC [pure virtual]\fR"Returns the size of \fIwidget\fR based on the contents size \fIcontentsSize\fR..PPThe \fIwidget\fR argument is a pointer to a QWidget or one of its subclasses. The widget can be cast to the appropriate type based on the value of \fIcontents\fR. The \fIopt\fR argument can be used to pass extra information required when calculating the size. Note that \fIopt\fR may be the default value even for ContentsTypes that can make use of the extra options. See the table below for the appropriate \fIwidget\fR and \fIopt\fR usage:.PP<center>.nf.TSl - l. ContentsType Widget Cast Options Notes CT_PushButton (const QPushButton *) Unused. CT_CheckBox (const QCheckBox *) Unused. CT_RadioButton (const QRadioButton *) Unused. CT_ToolButton (const QToolButton *) Unused. CT_ComboBox (const QComboBox *) Unused. CT_Splitter (const QSplitter *) Unused. CT_DockWindow (const QDockWindow *) Unused. CT_ProgressBar (const QProgressBar *) Unused. CT_PopupMenuItem (const QPopupMenu *) QStyleOption ( QMenuItem *mi ).TPopt.menuItem().TE.fi</center>.SH "int QStyle::styleHint ( StyleHint stylehint, const QWidget * widget = 0, const QStyleOption & opt = QStyleOption::Default, QStyleHintReturn * returnData = 0 ) const\fC [pure virtual]\fR"Returns the style hint \fIstylehint\fR for \fIwidget\fR. Currently, \fIwidget\fR, \fIopt\fR, and \fIreturnData\fR are unused; they're included to allow for future enhancements..PPFor an explanation of the return value see StyleHint..SH "QPixmap QStyle::stylePixmap ( StylePixmap stylepixmap, const QWidget * widget = 0, const QStyleOption & opt = QStyleOption::Default ) const\fC [pure virtual]\fR"Returns a pixmap for \fIstylepixmap\fR..PPThe \fIopt\fR argument can be used to pass extra information required when drawing the ControlElement. Note that \fIopt\fR may be the default value even for StylePixmaps that can make use of the extra options. Currently, the \fIopt\fR argument is unused..PPThe \fIwidget\fR argument is a pointer to a QWidget or one of its subclasses. The widget can be cast to the appropriate type based on the value of \fIstylepixmap\fR. See the table below for the appropriate \fIwidget\fR casts:.PP<center>.nf.TSl - l. StylePixmap Widget Cast SP_TitleBarMinButton (const QWidget *) SP_TitleBarMaxButton (const QWidget *) SP_TitleBarCloseButton (const QWidget *) SP_TitleBarNormalButton (const QWidget *) SP_TitleBarShadeButton (const QWidget *) SP_TitleBarUnshadeButton (const QWidget *) SP_DockWindowCloseButton.TE.fi</center>.PPSee also StylePixmap..SH "QRect QStyle::subRect ( SubRect subrect, const QWidget * widget ) const\fC [pure virtual]\fR"Returns the sub-area \fIsubrect\fR for the \fIwidget\fR in logical coordinates..PPThe \fIwidget\fR argument is a pointer to a QWidget or one of its subclasses. The widget can be cast to the appropriate type based on the value of \fIsubrect\fR. See the table below for the appropriate \fIwidget\fR casts:.PP<center>.nf.TSl - l. SubRect Widget Cast SR_PushButtonContents (const QPushButton *) SR_PushButtonFocusRect (const QPushButton *) SR_CheckBoxIndicator (const QCheckBox *) SR_CheckBoxContents (const QCheckBox *) SR_CheckBoxFocusRect (const QCheckBox *) SR_RadioButtonIndicator (const QRadioButton *) SR_RadioButtonContents (const QRadioButton *) SR_RadioButtonFocusRect (const QRadioButton *) SR_ComboBoxFocusRect (const QComboBox *) SR_DockWindowHandleRect (const QWidget *) SR_ProgressBarGroove (const QProgressBar *) SR_ProgressBarContents (const QProgressBar *) SR_ProgressBarLabel.TE.fi</center>.PPThe tear-off handle (SR_DockWindowHandleRect) for QDockWindow is a private class. Use QWidget::parentWidget() to access the QDockWindow:.PP.nf.br        if ( !widget->parentWidget() ).br            return;.br        const QDockWindow *dw = (const QDockWindow *) widget->parentWidget();.br.fi.PPSee also SubRect..SH "void QStyle::tabbarMetrics ( const QWidget * t, int & hf, int & vf, int & ov ) const"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..SH "void QStyle::unPolish ( QWidget * )\fC [virtual]\fR"Undoes the initialization of a widget's appearance..PPThis function is the counterpart to polish. It is called for every polished widget when the style is dynamically changed. The former style has to unpolish its settings before the new style can polish them again..PPSee also polish()..PPExamples:.)l themes/metal.cpp and themes/wood.cpp..SH "void QStyle::unPolish ( QApplication * )\fC [virtual]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPUndoes the application polish..PPSee also polish()..SH "QRect QStyle::visualRect ( const QRect & logical, const QWidget * w )\fC [static]\fR"Returns the rect \fIlogical\fR in screen coordinates. The bounding rect for widget \fIw\fR is used to perform the translation. This function is provided to aid style implementors in supporting right-to-left mode..PPSee also QApplication::reverseLayout()..SH "QRect QStyle::visualRect ( const QRect & logical, const QRect & bounding )\fC [static]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns the rect \fIlogical\fR in screen coordinates. The rect \fIbounding\fR is used to perform the translation. This function is provided to aid style implementors in supporting right-to-left mode..PPSee also QApplication::reverseLayout()..SH "SEE ALSO".BR http://doc.trolltech.com/qstyle.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 (qstyle.3qt) and the Qtversion (3.1.1).

⌨️ 快捷键说明

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