KWidgetsAddons

kfontrequester.h
1 /*
2  SPDX-FileCopyrightText: 2003 Nadeem Hasan <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KFONTREQUESTER_H
8 #define KFONTREQUESTER_H
9 
10 #include <QWidget>
11 #include <QFont>
12 #include <QString>
13 
14 #include <kwidgetsaddons_export.h>
15 
16 class QLabel;
17 class QPushButton;
18 
33 class KWIDGETSADDONS_EXPORT KFontRequester : public QWidget
34 {
35  Q_OBJECT
36 
37  Q_PROPERTY(QString title READ title WRITE setTitle)
38  Q_PROPERTY(QString sampleText READ sampleText WRITE setSampleText)
39  Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontSelected USER true)
40 
41 public:
42 
50  explicit KFontRequester(QWidget *parent = nullptr, bool onlyFixed = false);
51 
52  ~KFontRequester();
53 
57  QFont font() const;
58 
62  bool isFixedOnly() const;
63 
67  QString sampleText() const;
68 
72  QString title() const;
73 
77  QLabel *label() const;
78 
82  QPushButton *button() const;
83 
91  virtual void setFont(const QFont &font, bool onlyFixed = false);
92 
104  virtual void setSampleText(const QString &text);
105 
112  virtual void setTitle(const QString &title);
113 
114 Q_SIGNALS:
118  void fontSelected(const QFont &font);
119 
120 private:
121  class KFontRequesterPrivate;
122  friend class KFontRequesterPrivate;
123  KFontRequesterPrivate *const d;
124 
125  Q_PRIVATE_SLOT(d, void _k_buttonClicked())
126 
128 };
129 
130 #endif // KFONTREQUESTER_H
131 
This class provides a widget with a lineedit and a button, which invokes a font dialog (KFontChooserD...
Q_PROPERTY(...)
const QFont & font() const const
Q_DISABLE_COPY(Class)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 7 2020 22:42:36 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.