KIconThemes

kiconbutton.h
1 /* vi: ts=8 sts=4 sw=4
2 
3  This file is part of the KDE project, module kfile.
4  SPDX-FileCopyrightText: 2000 Geert Jansen <[email protected]>
5  SPDX-FileCopyrightText: 2000 Kurt Granroth <[email protected]>
6  SPDX-FileCopyrightText: 1997 Christoph Neerfeld <[email protected]>
7  SPDX-FileCopyrightText: 2002 Carsten Pfeiffer <[email protected]>
8 
9  SPDX-License-Identifier: LGPL-2.0-only
10 */
11 
12 #ifndef KICONBUTTON_H
13 #define KICONBUTTON_H
14 
15 #include "kiconthemes_export.h"
16 
17 #include <QPushButton>
18 
19 #include <kiconloader.h>
20 
31 class KICONTHEMES_EXPORT KIconButton: public QPushButton
32 {
33  Q_OBJECT
34  Q_PROPERTY(QString icon READ icon WRITE setIcon RESET resetIcon NOTIFY iconChanged USER true)
35  Q_PROPERTY(int iconSize READ iconSize WRITE setIconSize)
36  Q_PROPERTY(bool strictIconSize READ strictIconSize WRITE setStrictIconSize)
37 
38 public:
44  explicit KIconButton(QWidget *parent = nullptr);
45 
52  KIconButton(KIconLoader *loader, QWidget *parent);
53 
57  ~KIconButton();
58 
64  void setStrictIconSize(bool b);
68  bool strictIconSize() const;
69 
74  void setIconType(KIconLoader::Group group, KIconLoader::Context context, bool user = false);
75 
79  void setIcon(const QString &icon);
80 
81  void setIcon(const QIcon &icon);
82 
86  void resetIcon();
87 
91  const QString &icon() const;
92 
98  void setIconSize(int size);
103  int iconSize() const;
104 
111  void setButtonIconSize(int size);
116  int buttonIconSize() const;
117 
118 Q_SIGNALS:
122  void iconChanged(const QString &icon);
123 
124 private:
125  class KIconButtonPrivate;
126  KIconButtonPrivate *const d;
127 
129 };
130 
131 #endif // KICONBUTTON_H
A pushbutton for choosing an icon.
Definition: kiconbutton.h:31
void setIcon(const QIcon &icon)
void setIconSize(const QSize &size)
Q_PROPERTY(...)
Q_DISABLE_COPY(Class)
Context
Defines the context of the icon.
Definition: kiconloader.h:74
Group
The group of the icon.
Definition: kiconloader.h:117
Iconloader for KDE.
Definition: kiconloader.h:66
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Nov 27 2020 22:43:02 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.