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

📄 qstyle.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
📖 第 1 页 / 共 4 页
字号:
'\" t.TH QStyle 3qt "9 December 2002" "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 NAMEQStyle \- The look and feel of a GUI.SH SYNOPSIS\fC#include <qstyle.h>\fR.PPInherits QObject..PPInherited by QCommonStyle..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQStyle\fR ()".br.ti -1c.BI "virtual \fB~QStyle\fR ()".br.ti -1c.BI "virtual void \fBpolish\fR ( QWidget * )".br.ti -1c.BI "virtual void \fBunPolish\fR ( QWidget * )".br.ti -1c.BI "virtual void \fBpolish\fR ( QApplication * )".br.ti -1c.BI "virtual void \fBunPolish\fR ( QApplication * )".br.ti -1c.BI "virtual void \fBpolish\fR ( QPalette & )".br.ti -1c.BI "virtual void \fBpolishPopupMenu\fR ( QPopupMenu * ) = 0".br.ti -1c.BI "virtual QRect \fBitemRect\fR ( QPainter * p, const QRect & r, int flags, bool enabled, const QPixmap * pixmap, const QString & text, int len = -1 ) const".br.ti -1c.BI "virtual void \fBdrawItem\fR ( 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".br.ti -1c.BI "enum \fBPrimitiveElement\fR { PE_ButtonCommand, PE_ButtonDefault, PE_ButtonBevel, PE_ButtonTool, PE_ButtonDropDown, PE_FocusRect, PE_ArrowUp, PE_ArrowDown, PE_ArrowRight, PE_ArrowLeft, PE_SpinWidgetUp, PE_SpinWidgetDown, PE_SpinWidgetPlus, PE_SpinWidgetMinus, PE_Indicator, PE_IndicatorMask, PE_ExclusiveIndicator, PE_ExclusiveIndicatorMask, PE_DockWindowHandle, PE_DockWindowSeparator, PE_DockWindowResizeHandle, PE_Splitter, PE_Panel, PE_PanelPopup, PE_PanelMenuBar, PE_PanelDockWindow, PE_TabBarBase, PE_HeaderSection, PE_HeaderArrow, PE_StatusBarSection, PE_GroupBoxFrame, PE_Separator, PE_SizeGrip, PE_CheckMark, PE_ScrollBarAddLine, PE_ScrollBarSubLine, PE_ScrollBarAddPage, PE_ScrollBarSubPage, PE_ScrollBarSlider, PE_ScrollBarFirst, PE_ScrollBarLast, PE_ProgressBarChunk, PE_PanelLineEdit, PE_PanelTabWidget, PE_WindowFrame, PE_CheckListController, PE_CheckListIndicator, PE_CheckListExclusiveIndicator, PE_PanelGroupBox, PE_CustomBase = 0xf000000 }".br.ti -1c.BI "enum \fBStyleFlags\fR { Style_Default = 0x00000000, Style_Enabled = 0x00000001, Style_Raised = 0x00000002, Style_Sunken = 0x00000004, Style_Off = 0x00000008, Style_NoChange = 0x00000010, Style_On = 0x00000020, Style_Down = 0x00000040, Style_Horizontal = 0x00000080, Style_HasFocus = 0x00000100, Style_Top = 0x00000200, Style_Bottom = 0x00000400, Style_FocusAtBorder = 0x00000800, Style_AutoRaise = 0x00001000, Style_MouseOver = 0x00002000, Style_Up = 0x00004000, Style_Selected = 0x00008000, Style_Active = 0x00010000, Style_ButtonDefault = 0x00020000 }".br.ti -1c.BI "virtual void \fBdrawPrimitive\fR ( PrimitiveElement pe, QPainter * p, const QRect & r, const QColorGroup & cg, SFlags flags = Style_Default, const QStyleOption & opt = QStyleOption::Default ) const = 0".br.ti -1c.BI "enum \fBControlElement\fR { CE_PushButton, CE_PushButtonLabel, CE_CheckBox, CE_CheckBoxLabel, CE_RadioButton, CE_RadioButtonLabel, CE_TabBarTab, CE_TabBarLabel, CE_ProgressBarGroove, CE_ProgressBarContents, CE_ProgressBarLabel, CE_PopupMenuItem, CE_MenuBarItem, CE_ToolButtonLabel, CE_MenuBarEmptyArea, CE_PopupMenuScroller, CE_DockWindowEmptyArea, CE_CustomBase = 0xf0000000 }".br.ti -1c.BI "virtual void \fBdrawControl\fR ( ControlElement element, QPainter * p, const QWidget * widget, const QRect & r, const QColorGroup & cg, SFlags how = Style_Default, const QStyleOption & opt = QStyleOption::Default ) const = 0".br.ti -1c.BI "virtual void \fBdrawControlMask\fR ( ControlElement element, QPainter * p, const QWidget * widget, const QRect & r, const QStyleOption & opt = QStyleOption::Default ) const = 0".br.ti -1c.BI "enum \fBSubRect\fR { SR_PushButtonContents, SR_PushButtonFocusRect, SR_CheckBoxIndicator, SR_CheckBoxContents, SR_CheckBoxFocusRect, SR_RadioButtonIndicator, SR_RadioButtonContents, SR_RadioButtonFocusRect, SR_ComboBoxFocusRect, SR_SliderFocusRect, SR_DockWindowHandleRect, SR_ProgressBarGroove, SR_ProgressBarContents, SR_ProgressBarLabel, SR_ToolButtonContents, SR_CustomBase = 0xf0000000 }".br.ti -1c.BI "virtual QRect \fBsubRect\fR ( SubRect subrect, const QWidget * widget ) const = 0".br.ti -1c.BI "enum \fBComplexControl\fR { CC_SpinWidget, CC_ComboBox, CC_ScrollBar, CC_Slider, CC_ToolButton, CC_TitleBar, CC_ListView, CC_CustomBase = 0xf0000000 }".br.ti -1c.BI "enum \fBSubControl\fR { SC_None = 0x00000000, SC_ScrollBarAddLine = 0x00000001, SC_ScrollBarSubLine = 0x00000002, SC_ScrollBarAddPage = 0x00000004, SC_ScrollBarSubPage = 0x00000008, SC_ScrollBarFirst = 0x00000010, SC_ScrollBarLast = 0x00000020, SC_ScrollBarSlider = 0x00000040, SC_ScrollBarGroove = 0x00000080, SC_SpinWidgetUp = 0x00000001, SC_SpinWidgetDown = 0x00000002, SC_SpinWidgetFrame = 0x00000004, SC_SpinWidgetEditField = 0x00000008, SC_SpinWidgetButtonField = 0x00000010, SC_ComboBoxFrame = 0x00000001, SC_ComboBoxEditField = 0x00000002, SC_ComboBoxArrow = 0x00000004, SC_ComboBoxListBoxPopup = 0x00000008, SC_SliderGroove = 0x00000001, SC_SliderHandle = 0x00000002, SC_SliderTickmarks = 0x00000004, SC_ToolButton = 0x00000001, SC_ToolButtonMenu = 0x00000002, SC_TitleBarLabel = 0x00000001, SC_TitleBarSysMenu = 0x00000002, SC_TitleBarMinButton = 0x00000004, SC_TitleBarMaxButton = 0x00000008, SC_TitleBarCloseButton = 0x00000010, SC_TitleBarNormalButton = 0x00000020, SC_TitleBarShadeButton = 0x00000040, SC_TitleBarUnshadeButton = 0x00000080, SC_ListView = 0x00000001, SC_ListViewBranch = 0x00000002, SC_ListViewExpand = 0x00000004, SC_All = 0xffffffff }".br.ti -1c.BI "virtual void \fBdrawComplexControl\fR ( ComplexControl control, QPainter * p, const QWidget * widget, const QRect & r, const QColorGroup & cg, SFlags how = Style_Default, SCFlags sub = SC_All, SCFlags subActive = SC_None, const QStyleOption & opt = QStyleOption::Default ) const = 0".br.ti -1c.BI "virtual void \fBdrawComplexControlMask\fR ( ComplexControl control, QPainter * p, const QWidget * widget, const QRect & r, const QStyleOption & opt = QStyleOption::Default ) const = 0".br.ti -1c.BI "virtual QRect \fBquerySubControlMetrics\fR ( ComplexControl control, const QWidget * widget, SubControl subcontrol, const QStyleOption & opt = QStyleOption::Default ) const = 0".br.ti -1c.BI "virtual SubControl \fBquerySubControl\fR ( ComplexControl control, const QWidget * widget, const QPoint & pos, const QStyleOption & opt = QStyleOption::Default ) const = 0".br.ti -1c.BI "enum \fBPixelMetric\fR { PM_ButtonMargin, PM_ButtonDefaultIndicator, PM_MenuButtonIndicator, PM_ButtonShiftHorizontal, PM_ButtonShiftVertical, PM_DefaultFrameWidth, PM_SpinBoxFrameWidth, PM_MaximumDragDistance, PM_ScrollBarExtent, PM_ScrollBarSliderMin, PM_SliderThickness, PM_SliderControlThickness, PM_SliderLength, PM_SliderTickmarkOffset, PM_SliderSpaceAvailable, PM_DockWindowSeparatorExtent, PM_DockWindowHandleExtent, PM_DockWindowFrameWidth, PM_MenuBarFrameWidth, PM_TabBarTabOverlap, PM_TabBarTabHSpace, PM_TabBarTabVSpace, PM_TabBarBaseHeight, PM_TabBarBaseOverlap, PM_ProgressBarChunkWidth, PM_SplitterWidth, PM_TitleBarHeight, PM_IndicatorWidth, PM_IndicatorHeight, PM_ExclusiveIndicatorWidth, PM_ExclusiveIndicatorHeight, PM_PopupMenuScrollerHeight, PM_CheckListButtonSize, PM_CustomBase = 0xf0000000 }".br.ti -1c.BI "virtual int \fBpixelMetric\fR ( PixelMetric metric, const QWidget * widget = 0 ) const = 0".br.ti -1c.BI "enum \fBContentsType\fR { CT_PushButton, CT_CheckBox, CT_RadioButton, CT_ToolButton, CT_ComboBox, CT_Splitter, CT_DockWindow, CT_ProgressBar, CT_PopupMenuItem, CT_TabBarTab, CT_Slider, CT_Header, CT_LineEdit, CT_MenuBar, CT_SpinBox, CT_CustomBase = 0xf0000000 }".br.ti -1c.BI "virtual QSize \fBsizeFromContents\fR ( ContentsType contents, const QWidget * widget, const QSize & contentsSize, const QStyleOption & opt = QStyleOption::Default ) const = 0".br.ti -1c.BI "enum \fBStyleHint\fR { SH_EtchDisabledText, SH_GUIStyle, SH_ScrollBar_BackgroundMode, SH_ScrollBar_MiddleClickAbsolutePosition, SH_ScrollBar_ScrollWhenPointerLeavesControl, SH_TabBar_SelectMouseType, SH_TabBar_Alignment, SH_Header_ArrowAlignment, SH_Slider_SnapToValue, SH_Slider_SloppyKeyEvents, SH_ProgressDialog_CenterCancelButton, SH_ProgressDialog_TextLabelAlignment, SH_PrintDialog_RightAlignButtons, SH_MainWindow_SpaceBelowMenuBar, SH_FontDialog_SelectAssociatedText, SH_PopupMenu_AllowActiveAndDisabled, SH_PopupMenu_SpaceActivatesItem, SH_PopupMenu_SubMenuPopupDelay, SH_ScrollView_FrameOnlyAroundContents, SH_MenuBar_AltKeyNavigation, SH_ComboBox_ListMouseTracking, SH_PopupMenu_MouseTracking, SH_MenuBar_MouseTracking, SH_ItemView_ChangeHighlightOnFocus, SH_Widget_ShareActivation, SH_Workspace_FillSpaceOnMaximize, SH_ComboBox_Popup, SH_TitleBar_NoBorder, SH_ScrollBar_StopMouseOverSlider, SH_BlinkCursorWhenTextSelected, SH_RichText_FullWidthSelection, SH_PopupMenu_Scrollable, SH_GroupBox_TextLabelVerticalAlignment, SH_GroupBox_TextLabelColor, SH_PopupMenu_SloppySubMenus, SH_CustomBase = 0xf0000000 }".br.ti -1c.BI "virtual int \fBstyleHint\fR ( StyleHint stylehint, const QWidget * widget = 0, const QStyleOption & opt = QStyleOption::Default, QStyleHintReturn * returnData = 0 ) const = 0".br.ti -1c.BI "enum \fBStylePixmap\fR { SP_TitleBarMinButton, SP_TitleBarMaxButton, SP_TitleBarCloseButton, SP_TitleBarNormalButton, SP_TitleBarShadeButton, SP_TitleBarUnshadeButton, SP_DockWindowCloseButton, SP_MessageBoxInformation, SP_MessageBoxWarning, SP_MessageBoxCritical, SP_CustomBase = 0xf0000000 }".br.ti -1c.BI "virtual QPixmap \fBstylePixmap\fR ( StylePixmap stylepixmap, const QWidget * widget = 0, const QStyleOption & opt = QStyleOption::Default ) const = 0".br.ti -1c.BI "int defaultFrameWidth () const  \fI(obsolete)\fR".br.ti -1c.BI "void tabbarMetrics ( const QWidget * t, int & hf, int & vf, int & ov ) const  \fI(obsolete)\fR".br.ti -1c.BI "QSize scrollBarExtent () const  \fI(obsolete)\fR".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "QRect \fBvisualRect\fR ( const QRect & logical, const QWidget * w )".br.ti -1c.BI "QRect \fBvisualRect\fR ( const QRect & logical, const QRect & bounding )".br.in -1c.SH DESCRIPTIONThe QStyle class specifies the look and feel of a GUI..PPA large number of GUI elements are common to many widgets. The QStyle class allows the look of these elements to be modified across all widgets that use the QStyle functions. It also provides two feel options: Motif and Windows..PPAlthough it is not possible to fully enumerate the look of graphical elements and the feel of widgets in a GUI, QStyle provides a considerable amount of control and customisability..PPIn Qt 1.x the look and feel option for widgets was specified by a single value: the GUIStyle. Starting with Qt 2.0, this notion was expanded to allow the look to be specified by virtual drawing functions..PPDerived classes may reimplement some or all of the drawing functions to modify the look of all widgets that use those functions..PPLanguages written from right to left (such as Arabic and Hebrew) usually also mirror the whole layout of widgets. If you design a style, you should take special care when drawing asymmetric elements to make sure that they also look correct in a mirrored layout. You can start your application with \fC-reverse\fR to check the mirrored layout. Also notice, that for a reversed layout, the light usually comes from top right instead of top left..PPThe actual reverse layout is performed automatically when possible. However, for the sake of flexibility, the translation cannot be performed everywhere. The documentation for each function in the QStyle API states whether the function expects/returns logical or screen coordinates. Using logical coordinates (in ComplexControls, for example) provides great flexibility in controlling the look of a widget. Use visualRect() when necessary to translate logical coordinates into screen coordinates for drawing..PPIn Qt versions prior to 3.0, if you wanted a low level route into changing the appearance of a widget, you would reimplement polish(). With the new 3.0 style engine the recommended approach is to reimplement the draw functions, for example drawItem(), drawPrimitive(), drawControl(), drawControlMask(), drawComplexControl() and drawComplexControlMask(). Each of these functions is called with a range of parameters that provide information that you can use to determine how to draw them, e.g. style flags, rectangle, color group, etc..PPFor information on changing elements of an existing style or creating your own style see the Style overview..PPStyles can also be created as plugins..PPSee also Widget Appearance and Style..SS "Member Type Documentation".SH "QStyle::ComplexControl"This enum represents a ComplexControl. ComplexControls have different behaviour depending upon where the user clicks on them or which keys are pressed..TP\fCQStyle::CC_SpinWidget\fR.TP\fCQStyle::CC_ComboBox\fR.TP\fCQStyle::CC_ScrollBar\fR.TP\fCQStyle::CC_Slider\fR.TP\fCQStyle::CC_ToolButton\fR.TP\fCQStyle::CC_TitleBar\fR.TP\fCQStyle::CC_ListView\fR.TP\fCQStyle::CC_CustomBase\fR - base value for custom ControlElements. All values above this are reserved for custom use. Therefore, custom values must be greater than this value..PPSee also SubControl and drawComplexControl()..SH "QStyle::ContentsType"This enum represents a ContentsType. It is used to calculate sizes for the contents of various widgets..TP\fCQStyle::CT_PushButton\fR.TP\fCQStyle::CT_CheckBox\fR.TP\fCQStyle::CT_RadioButton\fR.TP\fCQStyle::CT_ToolButton\fR.TP\fCQStyle::CT_ComboBox\fR.TP\fCQStyle::CT_Splitter\fR.TP\fCQStyle::CT_DockWindow\fR.TP\fCQStyle::CT_ProgressBar\fR.TP\fCQStyle::CT_PopupMenuItem\fR.TP\fCQStyle::CT_TabBarTab\fR.TP\fCQStyle::CT_Slider\fR.TP\fCQStyle::CT_Header\fR.TP\fCQStyle::CT_LineEdit\fR.TP\fCQStyle::CT_MenuBar\fR.TP\fCQStyle::CT_SpinBox\fR.TP\fCQStyle::CT_CustomBase\fR - base value for custom ControlElements. All values above this are reserved for custom use. Therefore, custom values must be greater than this value..PPSee also sizeFromContents()..SH "QStyle::ControlElement"This enum represents a ControlElement. A ControlElement is part of a widget that performs some action or displays information to the user..TP\fCQStyle::CE_PushButton\fR - the bevel and default indicator of a QPushButton..TP\fCQStyle::CE_PushButtonLabel\fR - the label (iconset with text or pixmap) of a QPushButton..TP\fCQStyle::CE_CheckBox\fR - the indicator of a QCheckBox..TP\fCQStyle::CE_CheckBoxLabel\fR - the label (text or pixmap) of a QCheckBox..TP\fCQStyle::CE_RadioButton\fR - the indicator of a QRadioButton..TP\fCQStyle::CE_RadioButtonLabel\fR - the label (text or pixmap) of a QRadioButton..TP\fCQStyle::CE_TabBarTab\fR - the tab within a QTabBar (a QTab)..TP\fCQStyle::CE_TabBarLabel\fR - the label within a QTab..TP\fCQStyle::CE_ProgressBarGroove\fR - the groove where the progress indicator is drawn in a QProgressBar..TP\fCQStyle::CE_ProgressBarContents\fR - the progress indicator of a QProgressBar..TP\fCQStyle::CE_ProgressBarLabel\fR - the text label of a QProgressBar..TP\fCQStyle::CE_PopupMenuItem\fR - a menu item in a QPopupMenu..TP\fCQStyle::CE_PopupMenuScroller\fR - scrolling areas in a popumenu when the style supports scrolling..TP\fCQStyle::CE_MenuBarItem\fR - a menu item in a QMenuBar..TP\fCQStyle::CE_ToolButtonLabel\fR - a tool button's label..TP\fCQStyle::CE_MenuBarEmptyArea\fR - the empty area of a QMenuBar..TP\fCQStyle::CE_DockWindowEmptyArea\fR - the empty area of a QDockWindow..TP\fCQStyle::CE_CustomBase\fR - base value for custom ControlElements. All values above this are reserved for custom use. Therefore, custom values must be greater than this value..PP

⌨️ 快捷键说明

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