KDELibs4Support

k4style.h
1 
35 #ifndef KDE_K4STYLE_H
36 #define KDE_K4STYLE_H
37 
38 #include <kdelibs4support_export.h>
39 
40 #include <QCommonStyle>
41 #include <QPalette>
42 #include <QStylePlugin>
43 #include <typeinfo>
44 
46 class QStyleOptionTab;
47 
48 class K4StylePrivate;
74 // TODO: From 'Qt4 Themes' discussion on kde-devel
75 // - Remi Villatel: extend QStyle enums for KColorButton, KColorCombo, KKeyButton, split PE_HeaderSection into KPopupTitle, PopupMenuTitle, TaskContainer)
76 // - RV: KLineEdit "plays with its colors" - related to K4Style?
77 // - RV: KMulitTabBarTab ... does it need support from K4Style (instead of manual button rotation etc.)? Or is it dumped already?
78 // - RV: KTabCtl draws itself mimicking QDrawShadeThingies
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
80 // - LM: User interface guidelines... related to K4Style?
81 // - e.g. drawFancyPE() in kdeui for KDE widgets: check "qobject_cast<K4Style*>(style())", or fallback drawing...
82 // TODO: implement standardIcon().. and what about standardPalette()?
83 // TODO: maybe the arrow in CE_PushButtonLabel should be painted in CE_PushButtonBevel like QCommonStyle
84 
85 class KDELIBS4SUPPORT_DEPRECATED_EXPORT K4Style: public QCommonStyle
86 {
87  Q_OBJECT
88 
89 public:
90  K4Style();
91  ~K4Style();
92 
96  static QString defaultStyle();
123  static StyleHint customStyleHint(const QString &element, const QWidget *widget);
124  static ControlElement customControlElement(const QString &element, const QWidget *widget);
125  static SubElement customSubElement(const QString &element, const QWidget *widget);
126 
127 protected:
128 
157  StyleHint newStyleHint(const QString &element);
158  ControlElement newControlElement(const QString &element);
159  SubElement newSubElement(const QString &element);
160 
168  void drawInsideRect(QPainter *p, const QRect &r) const;
169 
173  QRect centerRect(const QRect &in, int w, int h) const;
174 
178  QRect centerRect(const QRect &in, const QSize &size) const;
180 
191  class KDELIBS4SUPPORT_DEPRECATED_EXPORT ColorMode //krazy:exclude=dpointer (lightweight helper)
192  {
193  public:
201  enum Mode {
202  PaletteEntryMode,
203  BWAutoContrastMode = 0x8000000
204  };
205  private:
206  Mode mode;
207  QPalette::ColorRole role;
208  public:
209 
213 
215  ColorMode(Mode _mode, QPalette::ColorRole _role);
216 
218  operator int() const;
219 
221  ColorMode(int encoded);
222 
225  QColor color(const QPalette &palette);
226  };
227 
237  struct KDELIBS4SUPPORT_DEPRECATED_EXPORT Option {
238  virtual ~Option() {} //So dynamic_cast works, and g++ shuts up
239  };
240 
250  template<typename EventualSubtype, typename BaseType>
251  struct KDELIBS4SUPPORT_DEPRECATED_EXPORT OptionBase: public BaseType {
255  static EventualSubtype *defaultOption()
256  {
257  static EventualSubtype *theDefault = nullptr; //### function static, not very nice,
258  //but avoids need for explicit instantiation.
259 
260  if (!theDefault) {
261  theDefault = new EventualSubtype;
262  }
263 
264  return theDefault;
265  }
266  };
267 
274  template<typename T>
275  static T extractOption(Option *option);
276 
281  struct KDELIBS4SUPPORT_DEPRECATED_EXPORT ColorOption: public OptionBase<ColorOption, Option> {
284 
285  ColorOption(): color(QPalette::ButtonText)
286  {}
287  };
288 
293  struct KDELIBS4SUPPORT_DEPRECATED_EXPORT IconOption: public OptionBase<IconOption, Option> {
294  bool active;
296  QSize size;
297 
298  IconOption(): active(false)
299  {}
300  };
301 
307  struct KDELIBS4SUPPORT_DEPRECATED_EXPORT DoubleButtonOption: public OptionBase<DoubleButtonOption, Option> {
313  Top,
316  Bottom
317  };
318 
324 
325  DoubleButtonOption(): activeButton(None)
326  {}
327 
333  DoubleButtonOption(ActiveButton ab): activeButton(ab)
334  {}
335  };
336 
342  struct KDELIBS4SUPPORT_DEPRECATED_EXPORT TitleButtonOption: public OptionBase<TitleButtonOption, Option> {
343  bool active;
345 // /// whether the button is hovered, this doesn't work at the moment (not even in any Qt style)...
346 // bool hover;
347 
348  TitleButtonOption(): active(false)/*, hover(false)*/
349  {}
350 
356  TitleButtonOption(bool act): active(act)
357  {}
358  };
359 
361  struct KDELIBS4SUPPORT_DEPRECATED_EXPORT TextOption: public OptionBase<TextOption, ColorOption> {
364 
365  TextOption();
366 
372  TextOption(const QString &_text);
373 
377  void init();
378  };
380 
392  enum WidgetType {
419  WT_Limit = 0xFFFF
420  };
421 
433  Top,
434  Bot,
437  MarginInc
439  };
440 
445  struct Generic {
451  enum LayoutProp {
454  DefaultLayoutMargin
455  };
456 
462  enum Primitive {
463  Text = 0xFFFF,
466  Frame,
472  ArrowLeft
473  };
474  };
475 
481  struct PushButton {
494  enum LayoutProp {
496  FocusMargin = ContentsMargin + MarginInc,
497  DefaultIndicatorMargin = FocusMargin + MarginInc,
498  PressedShiftHorizontal = DefaultIndicatorMargin + MarginInc,
501  TextToIconSpace
502  };
503 
514  enum Primitive {
515  Panel,
517  DefaultButtonFrame
520  };
521  };
522 
528  struct Splitter {
532  enum LayoutProp {
534  };
535 
541  enum Primitive {
543  HandleVert
544  };
545  };
546 
552  struct CheckBox {
556  enum LayoutProp {
559  NoLabelFocusMargin,
562  FocusMargin = NoLabelFocusMargin + MarginInc
563  };
564 
577  enum Primitive {
580  CheckTriState
581  };
582  };
583 
587  struct RadioButton {
591  enum LayoutProp {
592  Size,
596  FocusMargin
597  };
598 
610  enum Primitive {
612  RadioOff
613  };
614  };
615 
621  struct DockWidget {
625  enum LayoutProp {
628  FrameWidth = TitleMargin + MarginInc,
629  SeparatorExtent
630  };
631 
641  enum Primitive {
643  SeparatorHandle
644  };
645  };
646 
654  struct ProgressBar {
658  enum LayoutProp {
660  SideText = GrooveMargin + MarginInc,
664  MaxBusyIndicatorSize
665  };
666 
673  enum Primitive {
674  Groove,
677  BusyIndicator
680  };
681  };
682 
688  struct MenuBar {
692  enum LayoutProp {
693  Margin,
695  ItemSpacing = Margin + MarginInc
696  };
697 
701  enum Property {
702  EmptyArea
705  };
706  };
707 
714  struct MenuBarItem {
718  enum LayoutProp {
719  Margin,
722  Dummy = Margin + MarginInc //Paranoia about underlying type
723  };
724 
728  enum Primitive {
729  Panel
730  };
731  };
732 
738  struct Menu {
742  enum LayoutProp {
745  ScrollerHeight = Margin + MarginInc,
746  TearOffHeight
747  };
748 
755  enum Primitive {
757  TearOff,
759  Scroller
761  };
762  };
763 
782  struct MenuItem {
786  enum LayoutProp {
788  CheckAlongsideIcon = Margin + MarginInc,
791  CheckWidth,
793  CheckSpace,
805  ActiveDisabledTextColor
806  };
807 
815  enum Primitive {
822  Separator, //A separator item.
823  ItemIndicator //Shows the active item
824  };
825  };
826 
832  struct ScrollBar {
839  enum LayoutProp {
845  MinimumSliderHeight,
848  ArrowColor,
850  ActiveArrowColor
851  };
852 
862  enum Primitive {
865  DoubleButtonVert,
868  DoubleButtonHor,
874  SliderHor
875  };
876  };
877 
883  struct TabBar {
897  enum LayoutProp {
899  TabFocusMargin = TabContentsMargin + MarginInc,
902  TabTextToIconSpace = TabFocusMargin + MarginInc,
904  TabOverlap,
911  ScrollButtonWidth
912  };
913 
921  enum Primitive {
925  EastTab,
926  WestTab,
927  SouthTab,
929  IndicatorTear
933  };
934  };
935 
944  struct TabWidget {
948  enum LayoutProp {
949  ContentsMargin,
956  DummyProp = ContentsMargin + MarginInc
957  };
958  };
959 
965  struct Slider {
966 
972  enum LayoutProp {
974  HandleLength
975  };
976 
983  enum Primitive {
987  GrooveHor
988  };
989  };
990 
994  struct Tree {
1004  enum LayoutProp {
1005  MaxExpanderSize
1009  };
1010 
1014  enum Primitive {
1017  HorizontalBranch,
1021  VerticalBranch
1022  };
1023  };
1024 
1028  struct SpinBox {
1044  enum LayoutProp {
1045  FrameWidth,
1048  ButtonMargin,
1052  ButtonSpacing = ButtonMargin + MarginInc,
1053  SymmetricButtons,
1058  SupportFrameless,
1062  ContentsMargin
1065  };
1066 
1072  enum Primitive {
1073  EditField,
1078  ButtonArea,
1081  PlusSymbol,
1083  MinusSymbol
1085  };
1086  };
1087 
1091  struct ComboBox {
1103  enum LayoutProp {
1106  ButtonMargin,
1108  FocusMargin = ButtonMargin + MarginInc,
1111  SupportFrameless = FocusMargin + MarginInc,
1114  ContentsMargin
1117  };
1118 
1127  enum Primitive {
1129  Button
1130  };
1131  };
1132 
1138  struct Header {
1142  enum LayoutProp {
1144  TextToIconSpace = ContentsMargin + MarginInc,
1148  MarkSize
1150  };
1151 
1159  enum Primitive {
1161  SectionVert
1162  };
1163  };
1164 
1170  struct LineEdit {
1177  enum Primitive {
1178  Panel
1179  };
1180  };
1181 
1194  struct GroupBox {
1200  TextAlignTop,
1203  TitleTextColor
1204  };
1208  enum Primitive {
1209  FlatFrame
1212  };
1213  };
1214 
1225  struct StatusBar {
1229  };
1230 
1236  struct ToolBar {
1244  FrameWidth,
1247  ItemSpacing
1248  };
1249 
1256  enum Primitive {
1261  PanelVert
1262  };
1263  };
1264 
1270  struct ToolBoxTab {
1275  Margin
1278  };
1279 
1283  enum Primitive {
1284  Panel
1287  };
1288  };
1289 
1300  struct ToolButton {
1305  ContentsMargin,
1307  FocusMargin = ContentsMargin + MarginInc,
1310  MenuIndicatorSize,
1312  InlineMenuIndicatorSize = FocusMargin + MarginInc,
1315  InlineMenuIndicatorXOff,
1318  InlineMenuIndicatorYOff
1321  };
1322 
1333  enum Primitive {
1334  Panel
1336  };
1337  };
1338 
1346  struct Window {
1353  NoTitleFrame,
1356  TitleMargin,
1359  ButtonWidth = TitleMargin + MarginInc,
1361  ButtonToTextSpace
1362  };
1363 
1373  enum Primitive {
1382  ButtonHelp
1383  };
1384  };
1386 
1388  void setWidgetLayoutProp(WidgetType widget, int metric, int value);
1389 
1404  virtual int widgetLayoutProp(WidgetType widgetType, int metric,
1405  const QStyleOption *opt = nullptr, const QWidget *w = nullptr) const;
1406 
1435  virtual void drawKStylePrimitive(WidgetType widgetType, int primitive,
1436  const QStyleOption *opt,
1437  const QRect &r, const QPalette &pal,
1438  State flags, QPainter *p,
1439  const QWidget *widget = nullptr,
1440  Option *kOpt = nullptr) const;
1441 private:
1443  bool useSideText(const QStyleOptionProgressBar *opt) const;
1444  int sideTextWidth(const QStyleOptionProgressBar *pbOpt) const;
1445 
1447  bool isVerticalTab(const QStyleOptionTab *tbOpt) const;
1448 
1450  bool isReflectedTab(const QStyleOptionTab *tbOpt) const;
1451 
1452  enum Side {
1453  North,
1454  East,
1455  West,
1456  South
1457  };
1458 
1459  Side tabSide(const QStyleOptionTab *tbOpt) const;
1460 
1462  QRect marginAdjustedTab(const QStyleOptionTab *tbOpt, int property) const;
1463 
1465  QRect handleRTL(const QStyleOption *opt, const QRect &subRect) const;
1466  QPoint handleRTL(const QStyleOption *opt, const QPoint &pos) const;
1467 
1469  QVector<QVector<int> > metrics;
1470 
1472  QSize expandDim(const QSize &orig, WidgetType widget, int baseMarginMetric, const QStyleOption *opt, const QWidget *w, bool rotated = false) const;
1473 
1476  QRect insideMargin(const QRect &orig, WidgetType widget, int baseMarginMetric, const QStyleOption *opt, const QWidget *w) const;
1477 
1480  QRect internalSubControlRect(ComplexControl control, const QStyleOptionComplex *opt,
1481  SubControl subControl, const QWidget *w) const;
1482 
1483  // fitt's law label support: QLabel focusing its buddy widget
1484  const QObject *clickedLabel;
1485 
1486 public:
1495  void drawControl(ControlElement elem, const QStyleOption *opt, QPainter *p, const QWidget *w) const override;
1496  void drawPrimitive(PrimitiveElement elem, const QStyleOption *opt, QPainter *p, const QWidget *w) const override;
1497  int pixelMetric(PixelMetric metric, const QStyleOption *opt = nullptr, const QWidget *w = nullptr) const override;
1498  QRect subElementRect(SubElement subRect, const QStyleOption *opt, const QWidget *w) const override;
1499  QSize sizeFromContents(ContentsType type, const QStyleOption *opt,
1500  const QSize &contentsSize, const QWidget *w) const override;
1501  int styleHint(StyleHint hint, const QStyleOption *opt, const QWidget *w,
1502  QStyleHintReturn *returnData) const override;
1503  QRect subControlRect(ComplexControl control, const QStyleOptionComplex *opt,
1504  SubControl subControl, const QWidget *w) const override;
1505  SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
1506  const QPoint &pt, const QWidget *w) const override;
1507  void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
1508  QPainter *p, const QWidget *w) const override;
1509 
1510  void polish(QWidget *) override;
1511  void unpolish(QWidget *) override;
1512  void polish(QApplication *) override;
1513  void unpolish(QApplication *) override;
1514  void polish(QPalette &) override;
1515  QRect itemTextRect(const QFontMetrics &fm, const QRect &r,
1516  int flags, bool enabled,
1517  const QString &text) const override;
1518  QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const override;
1519  void drawItemText(QPainter *painter, const QRect &rect,
1520  int flags, const QPalette &pal, bool enabled,
1521  const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const override;
1522  void drawItemPixmap(QPainter *painter, const QRect &rect,
1523  int alignment, const QPixmap &pixmap) const override;
1524  QPalette standardPalette() const override;
1525  QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt,
1526  const QWidget *widget = nullptr) const override; //### kde5 remove
1527  QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
1528  const QStyleOption *opt) const override;
1529  bool eventFilter(QObject *, QEvent *) override;
1530 
1531  int layoutSpacing(QSizePolicy::ControlType control1,
1532  QSizePolicy::ControlType control2, Qt::Orientation orientation,
1533  const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override;
1534 
1535  QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = nullptr,
1536  const QWidget *widget = nullptr) const override;
1538 private:
1539  K4StylePrivate *const d;
1540 };
1541 
1542 template<typename T>
1543 const char *kstyleName()
1544 {
1545  return "default";
1546 }
1547 
1557 template<typename T>
1559 {
1560  QStringList keys() const
1561  {
1562  QStringList l;
1563  l << kstyleName<T>();
1564  return l;
1565  }
1566 
1567  QStyle *create(const QString &id) override
1568  {
1569  QStringList names = keys();
1570  //check whether included in the keys
1571  if (names.contains(id, Qt::CaseInsensitive)) {
1572  return new T();
1573  }
1574 
1575  return nullptr;
1576  }
1577 };
1578 
1579 template<typename T>
1581 {
1582  if (option) {
1583  if (dynamic_cast<T>(option)) {
1584  return static_cast<T>(option);
1585  }
1586  // Ugly hacks for when RTLD_GLOBAL is not used (quite common with plugins, really)
1587  // and dynamic_cast fails.
1588  // This is still partially broken as it doesn't take into account subclasses.
1589  // ### KDE5 do this somehow differently
1590  if (qstrcmp(typeid(*option).name(), typeid(typename std::remove_pointer<T>::type).name()) == 0) {
1591  return static_cast<T>(option);
1592  }
1593  }
1594 
1595  //### warn if cast failed?
1596 
1597  //since T is a pointer type, need this to get to the static.
1598  return static_cast<T>(nullptr)->defaultOption();
1599 }
1600 
1601 #define K_EXPORT_K4STYLE(name,type) template<> const char* kstyleName<type>() { return name; } \
1602  Q_EXPORT_PLUGIN(K4StyleFactory<type>)
1603 
1604 #endif
bool active
whether the button is pressed
Definition: k4style.h:343
Primitive
Relevant elements:
Definition: k4style.h:577
the actual toolbar, horizontal
Definition: k4style.h:1260
Primitive
Relevant elements:
Definition: k4style.h:921
static EventualSubtype * defaultOption()
Default value for this option.
Definition: k4style.h:255
maximize button, passes TitleButtonOption
Definition: k4style.h:1377
(0) set to non-zero to have two buttons on top
Definition: k4style.h:840
Special rotated text for east tabs.
Definition: k4style.h:922
Describes widgets like QToolButton (usually inside a QToolBar).
Definition: k4style.h:1300
Describes a tab bar.
Definition: k4style.h:883
(6) space to leave between checkbox and text (and icon between them in case there is one) ...
Definition: k4style.h:558
Primitive
Relevant Generic elements:
Definition: k4style.h:641
Describes widgets like QSplitter.
Definition: k4style.h:528
Template class which helps implementing the widget style plugin interface.
Definition: k4style.h:1558
(11) space to reserve for the menu arrow column
Definition: k4style.h:799
(20) The height of a slider handle
Definition: k4style.h:973
(10) The busy indicator size, in percent of area size.
Definition: k4style.h:663
Primitive
Relevant Generic elements:
Definition: k4style.h:1159
(2) the height of the tabBar&#39;s base, usually the frame width [sets QStyle::PM_TabBarBaseHeight] ...
Definition: k4style.h:909
scrollbar slider, vertical. Flags: State_On&&State_Sunken for pressed state
Definition: k4style.h:873
MarginOffsets
These constants describe how to access various fields of a margin property.
Definition: k4style.h:429
(6) the width/height of a ToolBar separator [sets QStyle::PM_ToolBarSeparatorExtent] ...
Definition: k4style.h:1242
(20) height of the titlebar [sets QStyle::PM_TitleBarHeight]
Definition: k4style.h:1352
(3) margin around contents used to size the header.
Definition: k4style.h:1143
Primitive
Relevant Generic elements:
Definition: k4style.h:610
radiobutton which is checked
Definition: k4style.h:611
Primitive
Relevant Generic elements:
Definition: k4style.h:815
Basic primitive drawing operations.
Definition: k4style.h:445
A horizontal slider handle.
Definition: k4style.h:985
Apply an additional left margin.
Definition: k4style.h:435
(2) Margin around title contents: Note that the symmetric margin (MainMargin) is used to size the tit...
Definition: k4style.h:627
(1) [sets QStyle::PM_ToolBarItemMargin]
Definition: k4style.h:1246
The spacing used by layouts, unless the style implements layoutSpacingImplementation(), default is 6 [sets QStyle::PM_DefaultLayoutSpacing].
Definition: k4style.h:453
bool contains(const QString &str, Qt::CaseSensitivity cs) const const
Describes widgets like QPushButton.
Definition: k4style.h:481
Describes widgets like QCheckBox.
Definition: k4style.h:552
(6) the width(hor)/height(vert) of a ToolBar handle [sets QStyle::PM_ToolBarHandleExtent] ...
Definition: k4style.h:1241
The checkmark - not checked.
Definition: k4style.h:818
Describes widgets like QProgressBar.
Definition: k4style.h:654
The checkmark - checked.
Definition: k4style.h:817
checkbox which is not checked
Definition: k4style.h:579
Base for our own option classes.
Definition: k4style.h:237
QString text
The text to draw.
Definition: k4style.h:363
ActiveButton
List of active button possibilities.
Definition: k4style.h:311
(32) height of a double button
Definition: k4style.h:843
scrollbar groove area, vertical. An interesting flag is State_Sunken for pressed state ...
Definition: k4style.h:869
Describes windows, like in QWorkspace.
Definition: k4style.h:1346
scrollbar groove area, vertical. An interesting flag is State_Sunken for pressed state ...
Definition: k4style.h:871
Option representing text drawing info. For Generic::Text.
Definition: k4style.h:361
Option for drawing double scrollbar buttons, indicating whether a button should be drawn active or no...
Definition: k4style.h:307
Primitive
Relevant Generic elements:
Definition: k4style.h:1373
Apply an additional bottom margin.
Definition: k4style.h:434
(3) space between the text column and arrow column (indicating sub menus)
Definition: k4style.h:798
typedef Alignment
scrollbar groove area, horizontal. Flags: State_Sunken for pressed state
Definition: k4style.h:870
bool active
Is the icon active?
Definition: k4style.h:294
The main margin is applied equally on each side.
Definition: k4style.h:430
used to draw a 1-button bevel, vertical
Definition: k4style.h:863
Mode
K4Style understands two kinds of colors:Palette entries.
Definition: k4style.h:201
Panel of the spinbox button which decreases the value.
Definition: k4style.h:1077
Primitive
Relevant Generic elements:
Definition: k4style.h:1072
Primitive
Relevant Generic elements:
Definition: k4style.h:1127
The actual bar indicating the progress...
Definition: k4style.h:676
A closed tree expander, usually drawn as &#39;+&#39;. K4Style has a default implementation (Windows-like look...
Definition: k4style.h:1015
(6) margin around the tab contents, used to size the tab
Definition: k4style.h:898
(1) The width of the frame, note that this does not affect the layout.
Definition: k4style.h:743
(0 ?) space between text and keyboard accelerator label
Definition: k4style.h:797
(2) Margin to allocate for the groove. Content area will be inside of it.
Definition: k4style.h:659
Background of the checkmark/icon column.
Definition: k4style.h:816
LayoutProp
Layout properties.
Definition: k4style.h:451
button to remove the shade state, passes TitleButtonOption
Definition: k4style.h:1381
The checkmark of exclusive actions - selected.
Definition: k4style.h:819
Describes a menu.
Definition: k4style.h:738
Option representing the color of the thing to draw.
Definition: k4style.h:281
(16) limit on the size of item content
Definition: k4style.h:801
static T extractOption(Option *option)
The extractOption method casts the passed in option object, and returns it, if available, or the defaults for the given type.
Definition: k4style.h:1580
CaseInsensitive
Describes widgets like QScrollBar.
Definition: k4style.h:832
Primitive
Relevant Generic elements:
Definition: k4style.h:673
minimize button, passes TitleButtonOption
Definition: k4style.h:1376
used to draw a 1-button bevel, horizontal
Definition: k4style.h:864
handle of a toolbar, horizontal
Definition: k4style.h:1257
Describes something like QGroupBox.
Definition: k4style.h:1194
Describes a tab widget (frame).
Definition: k4style.h:944
Primitive
Relevant Generic elements:
Definition: k4style.h:1177
(3) The margin of the menu.
Definition: k4style.h:744
Qt::Alignment hAlign
The horizontal alignment, default is Qt::AlignLeft.
Definition: k4style.h:362
Intermediatary base that helps implement subtypes of Option that properly handle defaults.
Definition: k4style.h:251
Makes style coding more convenient.
Definition: k4style.h:85
Horizontal scrollbar: The left button is active.
Definition: k4style.h:314
the panel/background of the title bar
Definition: k4style.h:642
ActiveButton activeButton
Whether any of the two buttons is active; and if yes, which one.
Definition: k4style.h:323
(2) vertical contents shift for pressed buttons [sets QStyle::PM_ButtonShiftVertical] ...
Definition: k4style.h:499
An opened tree expander, usually drawn as &#39;-&#39; K4Style has a default implementation.
Definition: k4style.h:1016
TitleButtonOption(bool act)
Convenience constructor.
Definition: k4style.h:356
Up arrow (pointing up)
Definition: k4style.h:469
Describes an expandable tree, e.g.
Definition: k4style.h:994
(2) margin for each entry
Definition: k4style.h:787
Menu and MenuItem background.
Definition: k4style.h:756
PrimitiveElement
Primitive
[the Handles implement QStyle::PE_IndicatorToolBarHandle] [the Panels implement QStyle::CE_ToolBar] ...
Definition: k4style.h:1256
Primitive
[the Handles implement QStyle::CE_Splitter]
Definition: k4style.h:541
A vertical slider handle.
Definition: k4style.h:984
No button is active.
Definition: k4style.h:312
system menu button, passes TitleButtonOption
Definition: k4style.h:1375
QIcon icon
window Icon
Definition: k4style.h:344
(3) space between the icon column and text column
Definition: k4style.h:796
A vertical slider groove.
Definition: k4style.h:986
Indication that this widget has focus.
Definition: k4style.h:465
Describes an item in a menu.
Definition: k4style.h:782
Primitive
Relevant Generic elements:
Definition: k4style.h:862
Width
(3) Extra space besides that needed for text to allocate to side indicator (on both sides)...
Definition: k4style.h:661
handle of a toolbar, vertical
Definition: k4style.h:1258
Describes MenuBar items.
Definition: k4style.h:714
(8) Space inside the content area, which is allocated to the down arrow if there is a popup menu [set...
Definition: k4style.h:500
(ColorMode(QPalette::Text)) color for inactive text and arrow
Definition: k4style.h:803
Apply an additional right margin.
Definition: k4style.h:436
(16) width of a scrollbar [sets QStyle::PM_ScrollBarExtent]
Definition: k4style.h:844
QCA_EXPORT void init()
header section, horizontal
Definition: k4style.h:1160
Describes a tool bar.
Definition: k4style.h:1236
Describes widgets like QRadioButton.
Definition: k4style.h:587
(16) Space reserved for the widget, right of the EditField
Definition: k4style.h:1047
Primitive
Relevant Generic elements:
Definition: k4style.h:514
A representation for colors for use as a widget layout property.
Definition: k4style.h:191
(5) space between the bevel and the button contents
Definition: k4style.h:495
QIcon icon
Icon drawn by this option.
Definition: k4style.h:295
Describes widgets like QMenuBar.
Definition: k4style.h:688
Describes a widget like QSpinBox.
Definition: k4style.h:1028
close button, passes TitleButtonOption
Definition: k4style.h:1379
(1) The indicator size will always be a multiple of this (modulo busy indicator size clamping)...
Definition: k4style.h:662
[implements QStyle::PE_FrameTabBarBase]
Definition: k4style.h:928
Primitive
Primitive drawing operations.
Definition: k4style.h:462
When CheckAlongsideIcon is disabled and item is checked: checkmark Indicator painted below the icon...
Definition: k4style.h:821
Apply an additional top margin.
Definition: k4style.h:433
(ColorMode(QPalette::HighlightedText)) color mode of the title text
Definition: k4style.h:626
WidgetType
This enum is used to represent K4Style&#39;s concept of a widget, and to associate drawing requests and m...
Definition: k4style.h:392
Vertical scrollbar: The upper button is active.
Definition: k4style.h:313
Passes in IconOption.
Definition: k4style.h:464
scrollbar groove area, horizontal. Flags: State_Sunken for pressed state
Definition: k4style.h:872
(ColorMode(QPalette::HighlightedText)) color for active text and arrow
Definition: k4style.h:802
Horizontal scrollbar: The right button is active.
Definition: k4style.h:315
Describes a widget like QComboBox.
Definition: k4style.h:1091
(0) heigh of separator
Definition: k4style.h:800
LayoutProp
For trees, all the control we provide here is to provide a cap on the size of the expander widget...
Definition: k4style.h:1004
Describes a list header, like in QListView.
Definition: k4style.h:1138
Option for drawing WT_Window titlebar buttons, indicating whether the button is pressed, and containing the window icon.
Definition: k4style.h:342
(16) height of a single button
Definition: k4style.h:842
(12) minimum size of the icon column
Definition: k4style.h:795
Describes the title of a dock widget.
Definition: k4style.h:621
Panel of the spinbox button which increases the value.
Definition: k4style.h:1076
(2) width of a groupbox frame
Definition: k4style.h:1199
Primitive
Relevant Generic elements:
Definition: k4style.h:1333
[implements QStyle::PE_IndicatorToolBarSeparator]
Definition: k4style.h:1259
LayoutProp
Each tab is basically built hiearchically out of the following areas:Content area, one of the following layouts:
Definition: k4style.h:897
The checkmark of exclusive actions - not selected.
Definition: k4style.h:820
Option for drawing icons: represents whether the icon should be active or not.
Definition: k4style.h:293
whole titlebar panel/background, by K4Style default it&#39;s filled with plain highlight color ...
Definition: k4style.h:1374
DoubleButtonOption(ActiveButton ab)
Convenience constructor.
Definition: k4style.h:333
restore button, passes TitleButtonOption
Definition: k4style.h:1378
Orientation
Describes a status bar section.
Definition: k4style.h:1225
The FrameWidth used by LineEdit, etc..., default is 2 [sets QStyle::PM_DefaultFrameWidth].
Definition: k4style.h:452
shade button, passes TitleButtonOption
Definition: k4style.h:1380
The splitter handle, horizontal.
Definition: k4style.h:542
Describes a tab for a tool box, like QToolBox.
Definition: k4style.h:1270
Primitive
Relevant Generic elements:
Definition: k4style.h:983
(ColorMode(QPalette::HighlightedText)) color mode of the titlebar text
Definition: k4style.h:1351
(1) set to non-zero to have two buttons on bottom
Definition: k4style.h:841
Describes a slider, like QSlider.
Definition: k4style.h:965
(10) the width/height of a ToolBar extender, when there is not enough room for toolbar buttons [sets ...
Definition: k4style.h:1243
LayoutProp
The layout of a PushButton is structured as follows:Between the very outside and the bevel is the def...
Definition: k4style.h:494
Describes a text edit widget like QLineEdit.
Definition: k4style.h:1170
Primitive
Relevant Generic elements:
Definition: k4style.h:755
(2) the number of pixels the tabs overlap with the base (i.e. tabWidget frame) [sets QStyle::PM_TabBa...
Definition: k4style.h:910
(ColorMode(QPalette::Text)) color for inactive + disabled text and arrow
Definition: k4style.h:804
ColorMode color
Color to use for the drawing.
Definition: k4style.h:283
(16) size of the checkbox [sets PM_IndicatorWidth, PM_IndicatorHeight]
Definition: k4style.h:557
checkbox which is checked
Definition: k4style.h:578
(2) space between titlebar buttons
Definition: k4style.h:1360
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Sep 23 2020 22:59:16 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.