KDEUI
kstyle.h
Go to the documentation of this file.
75// - Remi Villatel: extend QStyle enums for KColorButton, KColorCombo, KKeyButton, split PE_HeaderSection into KPopupTitle, PopupMenuTitle, TaskContainer)
77// - RV: KMulitTabBarTab ... does it need support from KStyle (instead of manual button rotation etc.)? Or is it dumped already?
79// - RV: fixed colors (e.g. Konqueror, KToolbarButton label text ->KPE_ToolbarButton?): To prevent hacks like "preventing any PaletteChange()"... mor related to KDE4 color schemes... I guess
81// - e.g. drawFancyPE() in kdeui for KDE widgets: check "qobject_cast<KStyle*>(style())", or fallback drawing...
83// TODO: maybe the arrow in CE_PushButtonLabel should be painted in CE_PushButtonBevel like QCommonStyle
353// /// whether the button is hovered, this doesn't work at the moment (not even in any Qt style)...
1568 QSize expandDim(const QSize& orig, WidgetType widget, int baseMarginMetric, const QStyleOption* opt, const QWidget* w, bool rotated = false) const;
1572 QRect insideMargin(const QRect &orig, WidgetType widget, int baseMarginMetric, const QStyleOption* opt, const QWidget* w) const;
1594 void drawControl (ControlElement elem, const QStyleOption* opt, QPainter* p, const QWidget* w) const;
1693 if ( qstrcmp(typeid(*option).name(), typeid(extractOptionHelper(static_cast<T>(0))).name()) == 0 )
Template class which helps implementing the widget style plugin interface.
Definition kstyle.h:1657
A representation for colors for use as a widget layout property.
Definition kstyle.h:192
ColorMode(QPalette::ColorRole _role)
Constructor, using a the given palette role _role and a default mode.
Definition kstyle.cpp:4432
QRect centerRect(const QRect &in, int w, int h) const
Returns a w x h QRect center inside the 'in' rectangle.
Definition kstyle.cpp:599
static StyleHint customStyleHint(const QString &element, const QWidget *widget)
Runtime element extension This is just convenience and does /not/ require the using widgets style to ...
Definition kstyle.cpp:386
void drawInsideRect(QPainter *p, const QRect &r) const
Draws inside the rectangle using a thinkness 0 pen.
Definition kstyle.cpp:594
static ControlElement customControlElement(const QString &element, const QWidget *widget)
Definition kstyle.cpp:391
WidgetType
This enum is used to represent KStyle's concept of a widget, and to associate drawing requests and me...
Definition kstyle.h:402
static SubElement customSubElement(const QString &element, const QWidget *widget)
Definition kstyle.cpp:396
StyleHint newStyleHint(const QString &element)
Runtime element extension, allows inheriting styles to add support custom elements merges supporting ...
Definition kstyle.cpp:344
ControlElement newControlElement(const QString &element)
Definition kstyle.cpp:349
static T extractOption(Option *option)
The extractOption method casts the passed in option object, and returns it, if available,...
Definition kstyle.h:1684
MarginOffsets
These constants describe how to access various fields of a margin property.
Definition kstyle.h:441
@ MarginInc
Used to reserve space in an enum for the Top, Bot, Left, Right margins.
Definition kstyle.h:449
#define T
@ NoLabelFocusMargin
(1) rectangle to apply to the checkbox rectangle to get where to paint the focus rectangle in case of...
Definition kstyle.h:583
@ FocusMargin
(0) margin around the checkbox contents reserved for the focus rect
Definition kstyle.h:586
@ BoxTextSpace
(6) space to leave between checkbox and text (and icon between them in case there is one)
Definition kstyle.h:582
@ FocusMargin
(1) Focus margin for ComboBoxes that aren't editable, measured from the EditField rect
Definition kstyle.h:1178
@ TitleMargin
(2) Margin around title contents: Note that the symmetric margin (MainMargin) is used to size the tit...
Definition kstyle.h:658
@ TitleTextColor
(ColorMode(QPalette::HighlightedText)) color mode of the title text
Definition kstyle.h:657
@ FrameWidth
(3) width of the frame around floating dockwidgets [sets QStyle::PM_DockWidgetFrameWidth]
Definition kstyle.h:659
@ SeparatorExtent
(6) width of the area which separates the (docked) dock window from the window contents [sets QStyle:...
Definition kstyle.h:660
ActiveButton activeButton
Whether any of the two buttons is active; and if yes, which one.
Definition kstyle.h:330
@ DefaultLayoutMargin
The margin used by layouts, default is 9 [sets QStyle::PM_DefaultChildMargin and QStyle::PM_DefaultTo...
Definition kstyle.h:469
@ DefaultFrameWidth
The FrameWidth used by LineEdit, etc..., default is 2 [sets QStyle::PM_DefaultFrameWidth].
Definition kstyle.h:467
@ DefaultLayoutSpacing
The spacing used by layouts, unless the style implements layoutSpacingImplementation(),...
Definition kstyle.h:468
@ TextAlignTop
(0) set to non-zero, the title will be aligned above the groupbox frame, not vertically centered [set...
Definition kstyle.h:1278
@ FlatFrame
For groupboxes which are set to be 'flat' (usually a divider line from top left to top right).
Definition kstyle.h:1288
@ TextToIconSpace
(3) space that is allocated between icon and text if both exist [sets QStyle::PM_HeaderMargin]
Definition kstyle.h:1217
@ MarkSize
(9) size of the sort indicator in a header [sets QStyle::PM_HeaderMarkSize]
Definition kstyle.h:1221
@ Panel
the panel for a QLineEdit (including frame...) [implements QStyle::PE_PanelLineEdit]
Definition kstyle.h:1254
@ Panel
The panel/background of a menubar item. Interesting flags: State_Selected && State_HasFocus for mouse...
Definition kstyle.h:772
@ CheckWidth
(12) size of the checkmark column (CheckAlongsideButton enabled).
Definition kstyle.h:839
@ ActiveTextColor
(ColorMode(QPalette::HighlightedText)) color for active text and arrow
Definition kstyle.h:850
@ CheckSpace
(3) Space between the checkmark column and the icon column (CheckAlongsideButton enabled).
Definition kstyle.h:841
@ DisabledTextColor
(ColorMode(QPalette::Text)) color for inactive + disabled text and arrow
Definition kstyle.h:852
@ ActiveDisabledTextColor
(ColorMode(QPalette::Text)) color for active + disabled text and arrow
Definition kstyle.h:853
@ CheckAlongsideIcon
(0) Set to non-zero to have checkmarks painted separate from icons.
Definition kstyle.h:836
@ ArrowSpace
(3) space between the text column and arrow column (indicating sub menus)
Definition kstyle.h:846
@ CheckIcon
When CheckAlongsideIcon is disabled and item is checked: checkmark Indicator painted below the icon.
Definition kstyle.h:870
@ ScrollerHeight
(10) Height of a menu scroller. [sets QStyle::PM_MenuScrollerHeight]
Definition kstyle.h:790
@ TearOffHeight
(10) Height of the TearOff area. [sets QStyle::PM_MenuTearoffHeight]
Definition kstyle.h:791
@ FrameWidth
(1) The width of the frame, note that this does not affect the layout.
Definition kstyle.h:788
@ TearOff
paints the area where a menu can be teared off [implements QStyle::CE_MenuTearoff]
Definition kstyle.h:803
Intermediatary base that helps implement subtypes of Option that properly handle defaults.
Definition kstyle.h:255
@ BusyIndicator
Used to indicate business, for example when no progress is known (minimum and maximum values both set...
Definition kstyle.h:712
@ Groove
the progressbar groove, drawn before the progress Indicator [implements QStyle::CE_ProgressBarGroove]
Definition kstyle.h:709
@ Precision
(1) The indicator size will always be a multiple of this (modulo busy indicator size clamping)....
Definition kstyle.h:696
@ SideTextSpace
(3) Extra space besides that needed for text to allocate to side indicator (on both sides).
Definition kstyle.h:695
@ GrooveMargin
(2) Margin to allocate for the groove. Content area will be inside of it.
Definition kstyle.h:693
@ PressedShiftHorizontal
(2) horizontal contents shift for pressed buttons [sets QStyle::PM_ButtonShiftHorizontal]
Definition kstyle.h:516
@ PressedShiftVertical
(2) vertical contents shift for pressed buttons [sets QStyle::PM_ButtonShiftVertical]
Definition kstyle.h:517
@ FocusMargin
(3) Used to calculate the area of the focus indicator. Measured from the bevel.
Definition kstyle.h:514
@ MenuIndicatorSize
(8) Space inside the content area, which is allocated to the down arrow if there is a popup menu [set...
Definition kstyle.h:518
@ DefaultIndicatorMargin
(0 ?) Default indicator between the very outside and the bevel. KStyle may reserve this for auto-defa...
Definition kstyle.h:515
@ DefaultButtonFrame
frame indicating a default button, painted before the button Panel [implements QStyle::PE_FrameDefaul...
Definition kstyle.h:536
@ Size
[sets QStyle::PM_ExclusiveIndicatorWidth, QStyle::PM_ExclusiveIndicatorHeight]
Definition kstyle.h:619
@ GrooveAreaHorRight
scrollbar groove area, horizontal. Flags: State_Sunken for pressed state
Definition kstyle.h:923
@ GrooveAreaVertBottom
scrollbar groove area, vertical. An interesting flag is State_Sunken for pressed state
Definition kstyle.h:922
@ SliderVert
scrollbar slider, vertical. Flags: State_On&&State_Sunken for pressed state
Definition kstyle.h:926
@ GrooveAreaVertTop
scrollbar groove area, vertical. An interesting flag is State_Sunken for pressed state
Definition kstyle.h:924
@ GrooveAreaHorLeft
scrollbar groove area, horizontal. Flags: State_Sunken for pressed state
Definition kstyle.h:925
@ SliderHor
scrollbar slider, horizontal. Flags: State_On&&State_Sunken for pressed state
Definition kstyle.h:927
@ ArrowColor
(ColorMode(ColorMode::BWAutoContrastMode, QPalette::Button)) color mode of a button arrow
Definition kstyle.h:900
@ ActiveArrowColor
(ColorMode(ColorMode::BWAutoContrastMode, QPalette::ButtonText)) color mode of a pressed button arrow...
Definition kstyle.h:902
@ HandleLength
(16) The width of a slider handle [sets QStyle::PM_SliderLength]
Definition kstyle.h:1034
@ SymmetricButtons
(0) Set to non-zero to make sure both buttons are always of the same height.
Definition kstyle.h:1120
@ ButtonMargin
(MainMargin 0, Right Top Bot 1) Where the up/down buttons are located, measured from right of the edi...
Definition kstyle.h:1115
@ FrameWidth
(1) Space reserved left, top, bottom of the SpinBox [sets QStyle::PM_SpinBoxFrameWidth]
Definition kstyle.h:1112
@ SupportFrameless
(0) Set to non-zero to indicate that you are able to handle frame-less SpinBoxes.
Definition kstyle.h:1125
@ ButtonArea
Can be used in addition or instead of KPE_SpinBox_UpButton and KPE_SpinBox_DownButton.
Definition kstyle.h:1146
@ PlusSymbol
Plus symbol painted on top of the up button, centering primitive.
Definition kstyle.h:1149
@ MinusSymbol
Minus symbol painted on top of the down button, centering primitive.
Definition kstyle.h:1151
LayoutProp
Each tab is basically built hiearchically out of the following areas:
Definition kstyle.h:952
@ TabFocusMargin
(3) where the tab focus rect is placed, measured from the tab sides (?)
Definition kstyle.h:954
@ TabTextToIconSpace
(0 ?) space between icon and text if the tab contains both
Definition kstyle.h:957
@ BaseOverlap
(2) the number of pixels the tabs overlap with the base (i.e. tabWidget frame) [sets QStyle::PM_TabBa...
Definition kstyle.h:965
@ BaseHeight
(2) the height of the tabBar's base, usually the frame width [sets QStyle::PM_TabBarBaseHeight]
Definition kstyle.h:964
@ ScrollButtonWidth
(10) buttons which are shown when there's not enough space for tabs (A ToolButton is used for this) [...
Definition kstyle.h:966
@ IndicatorTear
painted in the left edge of a tabbar when the left tab is scrolled out [implements PE_IndicatorTabTea...
Definition kstyle.h:985
Primitive
[the Handles implement QStyle::PE_IndicatorToolBarHandle] [the Panels implement QStyle::CE_ToolBar]
Definition kstyle.h:1339
@ HandleExtent
(6) the width(hor)/height(vert) of a ToolBar handle [sets QStyle::PM_ToolBarHandleExtent]
Definition kstyle.h:1323
@ FrameWidth
(2) width of the frame around toolbars [sets QStyle::PM_ToolBarFrameWidth]
Definition kstyle.h:1326
@ ExtensionExtent
(10) the width/height of a ToolBar extender, when there is not enough room for toolbar buttons [sets ...
Definition kstyle.h:1325
@ SeparatorExtent
(6) the width/height of a ToolBar separator [sets QStyle::PM_ToolBarSeparatorExtent]
Definition kstyle.h:1324
@ Margin
(0) used to specify the position of the tab contents, doesn't influence the tab size [sets QStyle::SE...
Definition kstyle.h:1361
@ Panel
the panel of a toolbox tab, KStyles default implementation paints WT_ToolButton/ToolButtonPanel [impl...
Definition kstyle.h:1371
Describes widgets like QToolButton (usually inside a QToolBar).
Definition kstyle.h:1389
@ MenuIndicatorSize
(11) Size for the separate menu arrows on tool buttons [sets QStyle::PM_MenuButtonIndicator wheen a t...
Definition kstyle.h:1400
@ FocusMargin
(3) Where the focus rect will be drawn, measured from the widget sides
Definition kstyle.h:1397
@ InlineMenuIndicatorXOff
Horizontal offset off the bottom-right corner to place the arrow if it's incorporated directly,...
Definition kstyle.h:1405
@ InlineMenuIndicatorYOff
Vertical offset off the bottom-right corner to place the arrow if it's incorporated directly,...
Definition kstyle.h:1408
@ InlineMenuIndicatorSize
(0) Size of arrow when it's incorporated into the button directly.
Definition kstyle.h:1402
@ ContentsMargin
(5) Margin reserved around the contents size of a toolbutton.
Definition kstyle.h:1395
@ ExpanderOpen
An opened tree expander, usually drawn as '-' KStyle has a default implementation.
Definition kstyle.h:1081
@ ExpanderClosed
A closed tree expander, usually drawn as '+'. KStyle has a default implementation (Windows-like look)...
Definition kstyle.h:1080
LayoutProp
For trees, all the control we provide here is to provide a cap on the size of the expander widget,...
Definition kstyle.h:1068
@ TitlePanel
whole titlebar panel/background, by KStyle default it's filled with plain highlight color
Definition kstyle.h:1469
@ TitleMargin
(2) margin around titlebar contents (buttons, text label), used to position them and determine the he...
Definition kstyle.h:1450
@ TitleTextColor
(ColorMode(QPalette::HighlightedText)) color mode of the titlebar text
Definition kstyle.h:1445
@ NoTitleFrame
(0) if set to non-zero, the frame primitive is not expected to paint around the titlebar area [sets Q...
Definition kstyle.h:1447
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.