Scanframe Modular Application
0.1.0
Loading...
Searching...
No Matches
ActionButton.h
Go to the documentation of this file.
1
#pragma once
2
#include <QAction>
3
#include <QPushButton>
4
#include <QtUiPlugin/QDesignerExportWidget>
5
#include <
misc/qt/ObjectExtension.h
>
6
7
namespace
sf
8
{
9
13
class
QDESIGNER_WIDGET_EXPORT
ActionButton
14
:
public
QPushButton
15
,
public
ObjectExtension
16
{
17
Q_OBJECT
18
Q_PROPERTY(QString action READ getActionByName WRITE setActionByName)
19
20
public
:
24
explicit
ActionButton
(QWidget* parent =
nullptr
);
25
29
bool
isRequiredProperty
(
const
QString& name)
override
;
30
38
void
setAction
(QAction* action);
39
45
[[nodiscard]] QAction*
getAction
()
const
;
46
52
void
setActionByName
(
const
QString& name);
53
58
[[nodiscard]] QString
getActionByName
()
const
;
59
64
void
updateButtonStatusFromAction
();
65
66
private
:
72
void
connectAction(QAction* action);
73
77
QAction* _action;
81
QString _actionName;
82
};
83
84
}
// namespace sf
ObjectExtension.h
sf::ActionButton
A QPushButton which is associated with an action.
Definition
ActionButton.h:16
sf::ActionButton::setActionByName
void setActionByName(const QString &name)
Sets an 'action' by finding it in the parent child list by name. When found the getAction()
sf::ActionButton::ActionButton
ActionButton(QWidget *parent=nullptr)
Standard widget constructor.
sf::ActionButton::getActionByName
QString getActionByName() const
Property handler function to retrieve the actions name.
sf::ActionButton::isRequiredProperty
bool isRequiredProperty(const QString &name) override
Overloaded from base class.
sf::ActionButton::updateButtonStatusFromAction
void updateButtonStatusFromAction()
Update the button status depending on a change on the action status. This slot is invoked each time t...
sf::ActionButton::setAction
void setAction(QAction *action)
Set the action owner of this button, that is the action associated to the button. The button is confi...
sf::ActionButton::getAction
QAction * getAction() const
Gets the current associated action. When the action is set by name this value is effected too.
sf::ObjectExtension
Interface class to multiple inherit when the sf::FormWriter class needs to be restricted in writing o...
Definition
ObjectExtension.h:17
sf
Definition
Application.h:10
src
com
misc
qt
ActionButton.h
Generated by
1.9.8