KWidgetsAddons

kfontsizeaction.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 1999 Reginald Stadlbauer <[email protected]>
4  SPDX-FileCopyrightText: 1999 Simon Hausmann <[email protected]>
5  SPDX-FileCopyrightText: 2000 Nicolas Hadacek <[email protected]>
6  SPDX-FileCopyrightText: 2000 Kurt Granroth <[email protected]>
7  SPDX-FileCopyrightText: 2000 Michael Koch <[email protected]>
8  SPDX-FileCopyrightText: 2001 Holger Freyther <[email protected]>
9  SPDX-FileCopyrightText: 2002 Ellis Whitehead <[email protected]>
10  SPDX-FileCopyrightText: 2003 Andras Mantia <[email protected]>
11  SPDX-FileCopyrightText: 2005-2006 Hamish Rodda <[email protected]>
12 
13  SPDX-License-Identifier: LGPL-2.0-only
14 */
15 
16 #ifndef KFONTSIZEACTION_H
17 #define KFONTSIZEACTION_H
18 
19 #include <kselectaction.h>
20 
21 class KFontSizeActionPrivate;
22 
23 /**
24  * @class KFontSizeAction kfontsizeaction.h KFontSizeAction
25  *
26  * An action to allow changing of the font size.
27  * This action will be shown as a combobox on a toolbar with a proper set of font sizes.
28  */
29 class KWIDGETSADDONS_EXPORT KFontSizeAction : public KSelectAction
30 {
31  Q_OBJECT
32  Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize)
33 
34 public:
35  explicit KFontSizeAction(QObject *parent);
36  KFontSizeAction(const QString &text, QObject *parent);
37  KFontSizeAction(const QIcon &icon, const QString &text, QObject *parent);
38 
39  ~KFontSizeAction() override;
40 
41  int fontSize() const;
42 
43  void setFontSize(int size);
44 
45 Q_SIGNALS:
46  void fontSizeChanged(int);
47 
48 protected Q_SLOTS:
49  /**
50  * This function is called whenever an action from the selections is triggered.
51  */
52  void actionTriggered(QAction *action) override;
53 
54 private:
55  Q_DECLARE_PRIVATE(KFontSizeAction)
56 #if KWIDGETSADDONS_BUILD_DEPRECATED_SINCE(5, 79)
57  QT_WARNING_PUSH
58  QT_WARNING_DISABLE_CLANG("-Wunused-private-field")
59  // Unused, kept for ABI compatibility
60  const void *__kwidgetsaddons_d_do_not_use;
61  QT_WARNING_POP
62 #endif
63 };
64 
65 #endif
Q_PROPERTY(...)
Q_SLOTSQ_SLOTS
virtual void actionTriggered(QAction *action)
This function is called whenever an action from the selections is triggered.
Q_SIGNALSQ_SIGNALS
Action for selecting one of several items.
Definition: kselectaction.h:44
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:03:40 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.