Krita Source Code Documentation
Loading...
Searching...
No Matches
KisStretchedIconButton.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KISSTRETCHEDICONBUTTON_H
8#define KISSTRETCHEDICONBUTTON_H
9
10#include <kritawidgets_export.h>
11#include <QToolButton>
12
13#include <QPointer>
15
16class QLabel;
17class QAction;
18
19class KRITAWIDGETS_EXPORT KisStretchedIconButton : public QToolButton
20{
21public:
22 KisStretchedIconButton(QWidget *parent);
24
25 void setStretchedIcon(const QIcon &icon);
26 QIcon stretchedIcon() const;
27
28 void setAssociatedAction(QAction *action);
29 QAction* associatedAction() const;
30
31protected:
32 void resizeEvent(QResizeEvent *event);
33
34private:
35 void updateLabelIcon();
36
37protected Q_SLOTS:
38 void slotActionChanged();
39
40private:
41 QLabel *m_label {nullptr};
45};
46
47#endif // KISSTRETCHEDICONBUTTON_H
KisSignalAutoConnectionsStore m_actionConnections