OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
aToolButtonWidget.h
Go to the documentation of this file.
1/*
2 * File: aToolButtonWidget.h
3 * Package: akWidgets
4 *
5 * Created on: November 07, 2020
6 * Author: Alexander Kuester
7 * Copyright (c) 2022 Alexander Kuester
8 * This file is part of the uiCore component.
9 * This file is subject to the terms and conditions defined in
10 * file 'LICENSE', which is part of this source code package.
11 */
12
13#pragma once
14
15 // AK header
17#include <akWidgets/aWidget.h>
18
19// Qt header
20#include <qtoolbutton.h> // Base class
21#include <qstring.h> // QString
22#include <qicon.h> // QIcon
23#include <qpoint.h>
24
25class QMenu;
26
27namespace ak {
28
29 class aAction;
30
31 class UICORE_API_EXPORT aToolButtonWidget : public QToolButton, public aWidget {
32 Q_OBJECT
33 public:
35
37 const QString & _text
38 );
39
41 const QIcon & _icon,
42 const QString & _text
43 );
44
45 virtual ~aToolButtonWidget();
46
47 // #######################################################################################################
48
49 // Event handling
50
52 virtual void keyPressEvent(QKeyEvent * _event) override;
53
55 virtual void keyReleaseEvent(QKeyEvent * _event) override;
56
57 // #######################################################################################################
58
59 // Base class functions
60
62 virtual QWidget * widget(void) override { return this; }
63
64 // #######################################################################################################
65
67 aAction * getAction() const { return m_action; }
68
71 void SetToolTip(
72 const QString & _text
73 );
74
76 QString ToolTip(void) const;
77
78 Q_SIGNALS:
79 void btnClicked();
80 void keyPressed(QKeyEvent *);
81 void keyReleased(QKeyEvent *);
82
83 private Q_SLOTS:
84 void slotClicked();
85
86 private:
87
89 void ini(void);
90
91 aAction * m_action;
92
93 };
94}
#define UICORE_API_EXPORT
Definition globalDataTypes.h:20
This class combines the functionallity of a QAction and a ak::ui::core::aPaintable.
Definition aAction.h:29
Definition aToolButtonWidget.h:31
virtual QWidget * widget(void) override
Will return the widgets widget to display it.
Definition aToolButtonWidget.h:62
void keyPressed(QKeyEvent *)
aAction * getAction() const
Will return the action of this tool button.
Definition aToolButtonWidget.h:67
void keyReleased(QKeyEvent *)
This class provides a interface that represents a widget. Every class derived from this class must be...
Definition aWidget.h:27
Definition uiAPI.h:45