QStyle Class Reference
The API for this class is under development and is subject to change.
We do not recommend the use of this class for production work at this time.
The QStyle class specifies the look and feel of a GUI.
More...
#include <qstyle.h>
Inherits QObject.
Inherited by QCommonStyle.
List of all member functions.
Public Members
operator GUIStyle () const
bool operator== ( GUIStyle s ) const
bool operator!= ( GUIStyle s ) const
virtual void
polish ( QWidget * )
virtual void
polish ( QApplication * )
virtual void
unPolish ( QApplication * )
virtual void
polish ( QPalette & )
virtual QRect
itemRect ( QPainter * p, int x, int y, int w, int h, int flags, bool enabled, const QPixmap * pixmap, const QString & text, int len = -1 ) const
virtual void
drawItem ( QPainter * p, int x, int y, int w, int h, int flags, const QColorGroup & g, bool enabled, const QPixmap * pixmap, const QString & text, int len = -1, const QColor * penColor = 0 )
virtual void
drawSeparator ( QPainter * p, int x1, int y1, int x2, int y2, const QColorGroup & g, bool sunken = TRUE, int lineWidth = 1, int midLineWidth = 0 )
virtual void
drawRect ( QPainter * p, int x, int y, int w, int h, const QColor & c, int lineWidth = 1, const QBrush * fill = 0 )
virtual void
drawRectStrong ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool sunken = FALSE, int lineWidth = 1, int midLineWidth = 0, const QBrush * fill = 0 )
virtual void
drawButton ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool sunken = FALSE, const QBrush * fill = 0 )
virtual QRect
buttonRect ( int x, int y, int w, int h ) const
virtual void
drawButtonMask ( QPainter * p, int x, int y, int w, int h )
virtual void
drawBevelButton ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool sunken = FALSE, const QBrush * fill = 0 )
virtual void
drawPanel ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool sunken = FALSE, int lineWidth = 1, const QBrush * fill = 0 )
virtual void
drawPopupPanel ( QPainter * p, int x, int y, int w, int h, const QColorGroup & cg, int lineWidth = 2, const QBrush * fill = 0 )
virtual void
drawArrow ( QPainter * p, Qt::ArrowType type, bool down, int x, int y, int w, int h, const QColorGroup & g, bool enabled, const QBrush * fill = 0 )
virtual void
drawToolButton ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool sunken, const QBrush * fill = 0 )
virtual void
drawToolButton ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool on, bool down, bool enabled, bool autoRaised = FALSE, const QBrush * fill = 0 )
virtual void
drawDropDownButton ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool down, bool enabled, bool autoRaised = FALSE, const QBrush * fill = 0 )
virtual void
drawExclusiveIndicator ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool on, bool down = FALSE, bool enabled = TRUE )
virtual void
drawIndicator ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, int state, bool down = FALSE, bool enabled = TRUE )
virtual void
drawIndicatorMask ( QPainter * p, int x, int y, int w, int h, int state )
virtual void
drawFocusRect ( QPainter * p, const QRect & r, const QColorGroup & g, const QColor * bg = 0, bool atBorder = FALSE )
virtual void
drawComboButton ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool sunken = FALSE, bool editable = FALSE, bool enabled = TRUE, const QBrush * fill = 0 )
virtual void tabbarMetrics ( const QTabBar *, int &, int &, int & ) const
virtual void drawTab ( QPainter *, const QTabBar *, QTab *, bool selected )
virtual void
drawTabBarExtension ( QPainter * p, int x, int y, int w, int h, const QColorGroup & cg, const QTabWidget * tw )
enum
ScrollControl { AddLine = 0x1, SubLine = 0x2, AddPage = 0x4, SubPage = 0x8, First = 0x10, Last = 0x20, Slider = 0x40, NoScroll = 0x80 }
virtual void
scrollBarMetrics ( const QScrollBar *, int &, int &, int &, int & ) const
virtual void
drawScrollBarControls ( QPainter *, const QScrollBar *, int sliderStart, uint controls, uint activeControl )
virtual ScrollControl
scrollBarPointOver ( const QScrollBar * sb, int sliderStart, const QPoint & p )
virtual void
drawSlider ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, Orientation, bool tickAbove, bool tickBelow )
virtual void
drawSliderGroove ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, QCOORD c, Orientation )
virtual void
drawSplitter ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, Orientation orient )
virtual void
drawCheckMark ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool act, bool dis )
virtual int
popupMenuItemHeight ( bool checkable, QMenuItem * mi, const QFontMetrics & fm ) const
virtual void
drawPopupMenuItem ( QPainter * p, bool checkable, int maxpmw, int tab, QMenuItem * mi, const QPalette & pal, bool act, bool enabled, int x, int y, int w, int h )
virtual void
drawMenuBarItem ( QPainter * p, int x, int y, int w, int h, QMenuItem * mi, QColorGroup & g, bool active, bool down, bool hasFocus = FALSE )
virtual void
drawMenuBarPanel ( QPainter * p, int x, int y, int w, int h, const QColorGroup & cg, const QBrush * fill = 0 )
virtual void
drawToolBarHandle ( QPainter * p, const QRect & r, Qt::Orientation orientation, bool highlight, const QColorGroup & cg, bool drawBorder = FALSE )
virtual void
drawToolBarPanel ( QPainter * p, int x, int y, int w, int h, const QColorGroup & cg, const QBrush * fill = 0 )
virtual void
drawToolBarSeparator ( QPainter * p, int x, int y, int w, int h, const QColorGroup & cg, Orientation orientation )
enum TitleControl { TitleNone = 0x00, TitleSysMenu = 0x1, TitleMinButton = 0x2, TitleMaxButton = 0x4, TitleCloseButton = 0x8, TitleLabel = 0x10, TitleNormalButton = 0x20, TitleShadeButton = 0x40, TitleUnshadeButton = 0x80 }
virtual QPixmap
titleBarPixmap ( const QTitleBar * tb, TitleControl ctrl )
virtual void
titleBarMetrics ( const QTitleBar * tb, int & ctrlW, int & ctrlH, int & titleW, int & titleH ) const
virtual void
drawTitleBarControls ( QPainter * p, const QTitleBar * tb, uint controls, uint activeControl )
enum ListViewItemControl { ListViewNone = 0x00, ListViewCheckBox = 0x1, ListViewController = 0x2, ListViewRadio = 0x4, ListViewBranches = 0x8, ListViewExpand = 0x10 }
virtual void
drawListViewItemBranch ( QPainter * p, int y, int w, int h, const QColorGroup & cg, QListViewItem * i )
virtual void
drawHeaderSection ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool down )
virtual void
drawSpinWidgetButton ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, QSpinWidget * sw, bool downbtn, bool enabled, bool down )
virtual void
drawSpinWidgetSymbol ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, QSpinWidget * sw, bool downbtn, bool enabled, bool down )
virtual void
drawGroupBoxTitle ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, const QString & text, bool enabled )
virtual void
drawGroupBoxFrame ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, const QGroupBox * gb )
virtual void
drawStatusBarSection ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool permanent )
virtual void
drawSizeGrip ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g )
virtual void
drawProgressBar ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g )
virtual void
drawProgressChunk ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g )
Static Protected Members
Detailed Description
The QStyle class specifies the look and feel of a GUI.
Although it is not possible to fully enumerate the look of graphic elements
and the feel of widgets in a GUI, a large number of 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.
In 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 has
been expanded to allow the look to be specified by virtual drawing
functions.
Derived classes may reimplement some or all of the drawing functions
to modify the look of all widgets that use those functions.
Languages written from right to left (as hebrew and arabic) 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
they also look correct for a mirrored layout. You can start your application
with -reverse to check the mirrored layout. Also notice, that for a reversed
layout, the light usually comes from top right instead of top left.
Member Type Documentation
QStyle::ScrollControl
This enum type defines
- QStyle::AddLine - control to scroll one line down, usually an arrow button
- QStyle::SubLine - control to scroll one line up, usually an arrow button
- QStyle::AddPage - control to scroll one page down
- QStyle::SubPage - control to scroll one page up
- QStyle::First - control to scroll to top of the range
- QStyle::Last - control to scroll to bottom of the range
- QStyle::Slider - the slider control
- QStyle::NoScroll - null value, indicates none of the visible controls
Member Function Documentation
QStyle::~QStyle () [virtual]
Destroys the style and frees all allocated resources.
QRect QStyle::bevelButtonRect ( int x, int y, int w, int h ) const [virtual]
Returns the rectangle available for contents in a bevel
button. Usually this is the entire rectangle minus the border, but
it may also be smaller when you think about rounded buttons.
See also drawBevelButton().
int QStyle::buttonDefaultIndicatorWidth () const [virtual]
Returns the width of the indicator frame for a default button.
In this version of the Qt library, subclasses must call
setButtonDefaultIndicatorWidth() to change the frame width. In a
future version of Qt this function will become virtual.
int QStyle::buttonMargin () const [virtual]
Returns the amount of whitespace between pushbutton labels and
the frame in this style.
QRect QStyle::buttonRect ( int x, int y, int w, int h ) const [virtual]
Returns the rectangle available for contents in a push
button. Usually this is the entire rectangle minus the border, but
it may also be smaller when you think about rounded buttons.
See also drawButton().
Example: themes/wood.cpp.
QRect QStyle::comboButtonFocusRect ( int x, int y, int w, int h ) const [virtual]
Returns the rectangle used to draw the focus rectangle in a combo box.
Example: themes/wood.cpp.
QRect QStyle::comboButtonRect ( int x, int y, int w, int h ) const [virtual]
Returns the rectangle available for contents in a combo box
button. Usually this is the entire rectangle without the nifty menu
indicator, but it may also be smaller when you think about rounded
buttons.
Example: themes/wood.cpp.
const QWidget * QStyle::contextWidget () [static protected]
Returns the global static widget currently requesting a QStyle operations.
This value will be modified whenever QApplication::style() or QWidget::style()
is called, you may use this pointer to gain information about the widget
you may be drawing on.
int QStyle::defaultFrameWidth () const [virtual]
The default frame width, usually 2.
void QStyle::drawArrow ( QPainter * p, Qt::ArrowType type, bool down, int x, int y, int w, int h, const QColorGroup & g, bool enabled, const QBrush * fill = 0 ) [virtual]
Draws an arrow to indicate direction. Used, for example, in scroll bars and spin-boxes.
void QStyle::drawBevelButton ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool sunken = FALSE, const QBrush * fill = 0 ) [virtual]
Draws a press-sensitive shape in the style of a bevel button.
See also bevelButtonRect().
Examples: themes/metal.cpp and themes/wood.cpp.
void QStyle::drawButton ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool sunken = FALSE, const QBrush * fill = 0 ) [virtual]
Draws a press-sensitive shape in the style of a full-featured push button
See also buttonRect().
Examples: themes/metal.cpp and themes/wood.cpp.
void QStyle::drawButtonMask ( QPainter * p, int x, int y, int w, int h ) [virtual]
Draws the mask of a push button. Useful if a rounded push button needs
to be transparent because the style uses a fancy background pixmap.
See also
Example: themes/wood.cpp.
void QStyle::drawCheckMark ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool act, bool dis ) [virtual]
Draws a check mark suitable for check boxes and checkable menu items.
void QStyle::drawComboButton ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool sunken = FALSE, bool editable = FALSE, bool enabled = TRUE, const QBrush * fill = 0 ) [virtual]
Draws a press-sensitive shape in the style of a combo box or menu button.
Example: themes/wood.cpp.
void QStyle::drawComboButtonMask ( QPainter * p, int x, int y, int w, int h ) [virtual]
Draw the mask of a combo box button. Useful if a rounded buttons
needs to be transparent because the style uses a fancy background
pixmap.
void QStyle::drawDropDownButton ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool down, bool enabled, bool autoRaised = FALSE, const QBrush * fill = 0 ) [virtual]
Draws a press-sensitive shape in the style of a tool bar button that is shown
when the tool button provides a popup list.
The default implementation calls drawBevelButton() when autoRaised is FALSE,
otherwise drawPanel.
See also drawToolButton.
void QStyle::drawExclusiveIndicator ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool on, bool down = FALSE, bool enabled = TRUE ) [virtual]
Draws a mark indicating the state of an exclusive choice.
void QStyle::drawExclusiveIndicatorMask ( QPainter * p, int x, int y, int w, int h, bool on ) [virtual]
Draws the mask of a mark indicating the state of an exclusive choice
Reimplemented in QMotifStyle.
void QStyle::drawFocusRect ( QPainter * p, const QRect & r, const QColorGroup & g, const QColor * bg = 0, bool atBorder = FALSE ) [virtual]
Draws a mark indicating that keyboard focus is on r. atBorder
indicates whether the focus rectangle is at the border of an item
(for example, an item in a list box). Certain styles (Motif style is
the most prominent example) might then have to shrink the rectangle a bit
to ensure that the focus rectangle is visible.
void QStyle::drawGroupBoxFrame ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, const QGroupBox * gb ) [virtual]
Draws the frame of groupbox gb with painter p into the rectangle
(x, y, w, h) using colorgroup g.
void QStyle::drawGroupBoxTitle ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, const QString & text, bool enabled ) [virtual]
Draws a groupbox title text with painter p into the rectangle (x, y, w, h)
using colorgroup g. enabled represents the state of the groupbox.
void QStyle::drawHeaderSection ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool down ) [virtual]
void QStyle::drawIndicator ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, int state, bool down = FALSE, bool enabled = TRUE ) [virtual]
Draws a mark indicating the state of a choice.
void QStyle::drawIndicatorMask ( QPainter * p, int x, int y, int w, int h, int state ) [virtual]
Draws the mask of a mark indicating the state of a choice.
Reimplemented in QSGIStyle.
void QStyle::drawItem ( QPainter * p, int x, int y, int w, int h, int flags, const QColorGroup & g, bool enabled, const QPixmap * pixmap, const QString & text, int len = -1, const QColor * penColor = 0 ) [virtual]
Draws text or a pixmap in an area.
void QStyle::drawListViewItemBranch ( QPainter * p, int y, int w, int h, const QColorGroup & cg, QListViewItem * i ) [virtual]
Paints the branches of QListViewItem i.
void QStyle::drawMenuBarItem ( QPainter * p, int x, int y, int w, int h, QMenuItem * mi, QColorGroup & g, bool active, bool down, bool hasFocus = FALSE ) [virtual]
Draws the menu item mi using the painter p and the ButtonText
color of g. The painter is preset to the right font. x, y, w
and h determine the geometry of the entire item, and active, down and
hasFocus represent the state of the menu bar item.
In a future version of the Qt library this function will become
obsolete, and subclasses will be able to reimplement drawMenuBarItem().
See also drawPopupMenuItem().
void QStyle::drawMenuBarPanel ( QPainter * p, int x, int y, int w, int h, const QColorGroup & cg, const QBrush * fill = 0 ) [virtual]
Draws a panel suitable for menu bars.
void QStyle::drawPanel ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool sunken = FALSE, int lineWidth = 1, const QBrush * fill = 0 ) [virtual]
Draws a panel to separate parts of the visual interface.
Example: themes/metal.cpp.
Reimplemented in QSGIStyle.
void QStyle::drawPopupMenuItem ( QPainter * p, bool checkable, int maxpmw, int tab, QMenuItem * mi, const QPalette & pal, bool act, bool enabled, int x, int y, int w, int h ) [virtual]
Draws the menu item mi using the painter p. The painter is preset
to the right font. maxpmw is the maximium width of all iconsets within
a check column. tab specifies the minimum number of pixels necessary
to draw all labels of the menu without their accelerators (which are
separated by a tab character in the label text). pal is the palette;
act and enabled define whether the item is active (i.e.,
highlighted) or enabled respectively. Finally, x, y, w and h
determine the geometry of the entire item.
Note that mi can be 0 when a multi-column popup menu ins being
drawn. In that case, drawPopupMenuItem() simply draws the appropriate
item background.
void QStyle::drawPopupPanel ( QPainter * p, int x, int y, int w, int h, const QColorGroup & cg, int lineWidth = 2, const QBrush * fill = 0 ) [virtual]
Draws a panel suitable as a frame for popup windows.
void QStyle::drawProgressBar ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g ) [virtual]
Draws a progressbar with painter p into the rectangle (x, y, w, h) using colorgroup g.
void QStyle::drawProgressChunk ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g ) [virtual]
Draws a progressbar chunk with painter p into the rectangle (x, y, w, h) using
colorgroup g.
void QStyle::drawPushButton ( QPushButton * btn, QPainter * p ) [virtual]
Draws a push button. This function will normally call drawButton()
with arguments according to the current state of the push button.
See also drawPushButtonLabel() and QPushButton::drawButton().
Examples: themes/metal.cpp and themes/wood.cpp.
void QStyle::drawPushButtonLabel ( QPushButton * btn, QPainter * p ) [virtual]
Draws the label of a push button. This function will normally call
drawItem() with arguments according to the current state of the
push button.
In reimplementations of this function, you will find
pushButtonContentsRect() useful.
See also drawPushButton() and QPushButton::drawButtonLabel().
Examples: themes/metal.cpp and themes/wood.cpp.
void QStyle::drawRect ( QPainter * p, int x, int y, int w, int h, const QColor & c, int lineWidth = 1, const QBrush * fill = 0 ) [virtual]
Draws a simple rectangle to separate parts of the visual interface.
void QStyle::drawRectStrong ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool sunken = FALSE, int lineWidth = 1, int midLineWidth = 0, const QBrush * fill = 0 ) [virtual]
Draws an emphasized rectangle to strongly separate parts of the
visual interface.
void QStyle::drawScrollBarControls ( QPainter *, const QScrollBar *, int sliderStart, uint controls, uint activeControl ) [virtual]
Draws the given scroll bar. Used internally by QScrollbar.
The controls are either ADD_LINE, SUB_LINE, ADD_PAGE, SUB_PAGE,
FIRST, LAST, SLIDER or NONE.
Controls is a combination of these; activeControl is the control
currently pressed down.
Example: themes/wood.cpp.
void QStyle::drawSeparator ( QPainter * p, int x1, int y1, int x2, int y2, const QColorGroup & g, bool sunken = TRUE, int lineWidth = 1, int midLineWidth = 0 ) [virtual]
Draws a line to separate parts of the visual interface.
Reimplemented in QSGIStyle.
void QStyle::drawSizeGrip ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g ) [virtual]
Draws a size grip with painter p into the rectangle (x, y, w, h) using colorgroup g.
void QStyle::drawSlider ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, Orientation, bool tickAbove, bool tickBelow ) [virtual]
Draws a slider.
void QStyle::drawSliderGroove ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, QCOORD c, Orientation ) [virtual]
Draws a slider groove.
void QStyle::drawSpinWidgetButton ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, QSpinWidget * sw, bool downbtn, bool enabled, bool down ) [virtual]
Draws the spinbox button of the spin widget sw with the painter p into the rectangle
(x, y, w, h) using colorgroup g. The function draws the down button if downbtn is TRUE,
otherwise the up button. enabled and down represent the state of the button.
void QStyle::drawSpinWidgetSymbol ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, QSpinWidget * sw, bool downbtn, bool enabled, bool down ) [virtual]
Draws the spinbox button symbol of the spin widget sw with the painter p into the rectangle
(x, y, w, h) using colorgroup g. The function draws the down symbol if downbtn is TRUE,
otherwise the up symbol. enabled and down represent the state of the button.
void QStyle::drawSplitter ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, Orientation orient ) [virtual]
Using painter p and color group g, draws a splitter handle in
the rectangle described by x, y, w, h. The orientation
is orient.
See also splitterWidth().
void QStyle::drawStatusBarSection ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool permanent ) [virtual]
Draws a statusbar section with painter p into the rectangle (x, y, w, h) using colorgroup g.
permanent represents the type of the section. Permanent sections are usually sunken.
void QStyle::drawTabBarExtension ( QPainter * p, int x, int y, int w, int h, const QColorGroup & cg, const QTabWidget * tw ) [virtual]
Draws the area between the tab bar and the tab pages. Some GUI styles
use this area to draw special decorations.
See also tabBarExtensionMetrics().
void QStyle::drawTitleBarControls ( QPainter * p, const QTitleBar * tb, uint controls, uint activeControl ) [virtual]
Paints parts of the titlebar tb with painter p. The parts painted must be OR'd into controls, and all
active (or pressed controls) will be OR'd into activeControl.
void QStyle::drawToolBarHandle ( QPainter * p, const QRect & r, Qt::Orientation orientation, bool highlight, const QColorGroup & cg, bool drawBorder = FALSE ) [virtual]
Draws the handle for the tool bar using the painter p with the handle
coordinates r. orientation gives the orientation of the tool bar;
the handle is drawn highlighted if highlight is TRUE, otherwise
not. cg is the QColorGroup of the tool bar; and if drawBorder is
TRUE a border around the handle may be drawn.
void QStyle::drawToolBarPanel ( QPainter * p, int x, int y, int w, int h, const QColorGroup & cg, const QBrush * fill = 0 ) [virtual]
Draws a panel suitable for tool bars.
void QStyle::drawToolBarSeparator ( QPainter * p, int x, int y, int w, int h, const QColorGroup & cg, Orientation orientation ) [virtual]
Draws a tool bar separator.
void QStyle::drawToolButton ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool sunken, const QBrush * fill = 0 ) [virtual]
Draws a press-sensitive shape in the style of a tool bar button.
The default implementation calls drawBevelButton().
void QStyle::drawToolButton ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, bool on, bool down, bool enabled, bool autoRaised = FALSE, const QBrush * fill = 0 ) [virtual]
Draws a press-sensitive shape in the style of a tool bar button.
The default implementation calls drawBevelButton().
See also drawBevelButton() and drawDropDownButton().
QSize QStyle::exclusiveIndicatorSize () const [virtual]
Returns the size of the mark used to indicate exclusive choice.
int QStyle::extraPopupMenuItemWidth ( bool checkable, int maxpmw, QMenuItem * mi, const QFontMetrics & fm ) const [virtual]
Returns the extra width of a menu item mi, which means all the extra
pixels besides the space that the menu item text requires. checkable
defines whether the menu has a check column. maxpmw is the
maximium width of all iconsets within a check column and fm
defines the font metrics used to draw the label. This is
particulary useful for calculating a suitable size for a submenu
indicator or the column separation, including the tab column used to
indicate item accelerators.
void QStyle::getButtonShift ( int & x, int & y ) const [virtual]
Some GUI styles shift the contents of a button when the button is down.
The default implementation returns 0 for both x and y.
GUIStyle QStyle::guiStyle () const
Returns an indicator to the additional "feel" component of a
style. Current supported values are Qt::WindowsStyle and Qt::MotifStyle.
QSize QStyle::indicatorSize () const [virtual]
Returns the size of the mark used to indicate choice.
QRect QStyle::itemRect ( QPainter * p, int x, int y, int w, int h, int flags, bool enabled, const QPixmap * pixmap, const QString & text, int len = -1 ) const [virtual]
Returns the appropriate area within a rectangle in which to
draw text or a pixmap.
ListViewItemControl QStyle::listViewItemPointOver ( const QListViewItem * i, const QPoint & p ) [virtual]
Returns the listview item part of the item i that contains the point p.
int QStyle::maximumSliderDragDistance () const [virtual]
Some styles require the scroll bar (or other slider) to jump back to
the original position when the mouse pointer is too far away while
dragging.
This behavior can be customized with this function. The default is -1
(no jump back); Windows requires 20 (weird jump back).
int QStyle::menuBarFrameWidth () const [virtual]
Returns the frame width for menu bars.
int QStyle::menuButtonIndicatorWidth ( int h ) const [virtual]
Returns the width of the menu button indicator for a given button
height h.
void QStyle::polish ( QWidget * ) [virtual]
Initializes the appearance of a widget.
This function is called for every widget at some point after it has
been fully created but just before it is shown the very first
time.
Reasonable actions in this function might be to call
QWidget::setBackgroundMode for the widget. An example of highly
unreasonable use would be setting the geometry!
The 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 will be expected to work
reasonably with all current and future widgets.
See also unPolish(QWidget*).
Examples: themes/metal.cpp and themes/wood.cpp.
void QStyle::polish ( QApplication * ) [virtual]
Late initialization of the QApplication object.
See also unPolish(QApplication*).
void QStyle::polish ( QPalette & ) [virtual]
The style may have certain requirements for color palettes. In this
function it has the chance to change the palette according to these
requirements.
See also QPalette and QApplication::setPalette().
void QStyle::polishPopupMenu ( QPopupMenu * p ) [virtual]
Polishes the popup menu p according to the GUI style. This
usually means setting the mouse tracking (see
QPopupMenu::setMouseTracking()) and whether the menu is checkable by
default (see QPopupMenu::setCheckable()).
int QStyle::popupMenuItemHeight ( bool checkable, QMenuItem * mi, const QFontMetrics & fm ) const [virtual]
Returns the height of the menu item mi. checkable defines
whether the menu has a check column; fm defines the font metrics
used to draw the label.
int QStyle::popupSubmenuIndicatorWidth ( const QFontMetrics & fm ) const [virtual]
Returns the width of the arrow indicating popup submenus.
fm defines the font metrics used to draw the popup menu.
int QStyle::progressChunkWidth () const [virtual]
Returns the width of a chunk of a progress bar.
QRect QStyle::pushButtonContentsRect ( QPushButton * btn ) const [virtual]
Returns the contents rectangle of a push button btn. The contents
rectangle is the space available for the button label.
The result depends on the look (buttonRect()), whether the button needs
space for a default indicator (buttonDefaultIndicatorWidth()), and
whether it is pushed down and needs to be shifted (getButtonShift()).
QSize QStyle::scrollBarExtent () const [virtual]
Returns a QSize containing the width of a vertical scroll bar and
the height of a horizontal scroll bar in this style.
In this version of the Qt library subclasses must call
setScrollBarExtent() to change the extent of scroll bars. In a future
version of Qt this function will become virtual.
void QStyle::scrollBarMetrics ( const QScrollBar *, int &, int &, int &, int & ) const [virtual]
Returns the metrics of the passed scroll bar: sliderMin, sliderMax,
sliderLength, and buttonDim.
ScrollControl QStyle::scrollBarPointOver ( const QScrollBar * sb, int sliderStart, const QPoint & p ) [virtual]
Returns the scroll bar control under the passed point.
int QStyle::sliderLength () const [virtual]
The length of a slider.
int QStyle::sliderThickness () const [virtual]
Returns the thickness of a slider in this style. The thickness is
dimension perpendicular to the slider motion (e.g. the height for
a horizontal slider).
int QStyle::spinBoxFrameWidth () const [virtual]
Returns the width of the frame around a spinbox.
If this function returns is 0, the spin buttons are embedded into the spinbox,
otherwise they are placed separately next to the edit control.
int QStyle::splitterWidth () const [virtual]
Returns the width of a splitter handle.
See also drawSplitter().
void QStyle::tabBarExtensionMetrics ( const QTabWidget *, int & width, int & height, int & overlap ) const [virtual]
Sets the width and height of the area between the tab bar and the
tab pages (called the tab bar extension area). overlap contains the
number of pixels the tab bar overlaps the tab bar extension area.
See also drawTabBarExtension().
void QStyle::titleBarMetrics ( const QTitleBar * tb, int & ctrlW, int & ctrlH, int & titleW, int & titleH ) const [virtual]
Retrieves metrics about the titlebar tb. ctrlW, ctrlH, titleW, and titleH are set to
the width and height of all controls on a title bar, and the width and height of the title label
itself.
QPixmap QStyle::titleBarPixmap ( const QTitleBar * tb, TitleControl ctrl ) [virtual]
Returns the pixmap representing the action in ctrl.
TitleControl QStyle::titleBarPointOver ( const QTitleBar * tb, const QPoint & pos ) [virtual]
Returns the control of titlebar tb under point pos, if none are available TitleNone will be returned.
int QStyle::toolBarFrameWidth () const [virtual]
Returns the frame width for tool bars, usually 1.
int QStyle::toolBarHandleExtent () const [virtual]
Returns the extent of a tool bar handle.
(The extent of a horizontal tool bar's handle is the handle's height.)
QSize QStyle::toolBarSeparatorSize ( Qt::Orientation orientation ) const [virtual]
Returns the size for a tool bar separator.
QRect QStyle::toolButtonRect ( int x, int y, int w, int h ) [virtual]
Returns the rectangle available for contents in a tool
button. Usually this is the entire rectangle minus the border, but
it may also be smaller when you think about rounded buttons.
The default implementation returns bevelButtonRect().
See also drawToolButton().
void QStyle::unPolish ( QWidget * ) [virtual]
Undoes the initialization of a widget's appearance.
This 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.
See also polish(QWidget*).
Examples: themes/metal.cpp and themes/wood.cpp.
void QStyle::unPolish ( QApplication * ) [virtual]
Undoes the application polish.
See also polish(QApplication*).
Search the documentation, FAQ, qt-interest archive and more (uses
www.trolltech.com):
This file is part of the Qt toolkit,
copyright © 1995-2001
Trolltech, all rights reserved.
Copyright © 2001 Trolltech | Trademarks
| Qt version 3.0.0-beta1-beta1
|