Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::ActionButton Class Reference

A QPushButton which is associated with an action. More...

#include <ActionButton.h>

Inheritance diagram for sf::ActionButton:
Collaboration diagram for sf::ActionButton:

Public Member Functions

 ActionButton (QWidget *parent=nullptr)
 Standard widget constructor.
 
bool isRequiredProperty (const QString &name) override
 Overloaded from base class.
 
void setAction (QAction *action)
 Set the action owner of this button, that is the action associated to the button. The button is configured immediately depending on the action status and the button and the action are connected together so that when the action is changed the button is updated and when the button has been clicked the 'action' is triggered.
 
QAction * getAction () const
 Gets the current associated action. When the action is set by name this value is effected too.
 
void setActionByName (const QString &name)
 Sets an 'action' by finding it in the parent child list by name. When found the getAction()
 
QString getActionByName () const
 Property handler function to retrieve the actions name.
 
void updateButtonStatusFromAction ()
 Update the button status depending on a change on the action status. This slot is invoked each time the action "changed" signal is emitted.
 
- Public Member Functions inherited from sf::ObjectExtension
virtual void addPropertyPages (PropertySheetDialog *sheet)
 Adds the pages specific for this object.
 
virtual bool getSaveChildren () const
 Gets if the children needs saving by the FormBuilder class.
 

Properties

QString action
 

Additional Inherited Members

- Static Public Member Functions inherited from sf::ObjectExtension
static bool inDesigner ()
 Gets the designer status.
 
static QObject * getExtensionParent (QObject *obj, bool first=true)
 Return if the passed object has this type as parent. It starts by testing the passed object itself.
 
- Protected Member Functions inherited from sf::ObjectExtension
 ObjectExtension (QObject *object)
 Protected constructor only. Inlined so no external libs are need for designer.
 
virtual ~ObjectExtension ()=default
 Virtual destructor.
 

Detailed Description

A QPushButton which is associated with an action.

Constructor & Destructor Documentation

◆ ActionButton()

sf::ActionButton::ActionButton ( QWidget *  parent = nullptr)
explicit

Standard widget constructor.

Member Function Documentation

◆ getAction()

QAction * sf::ActionButton::getAction ( ) const

Gets the current associated action. When the action is set by name this value is effected too.

Returns
Null when not set.

◆ getActionByName()

QString sf::ActionButton::getActionByName ( ) const

Property handler function to retrieve the actions name.

Returns
Name of the action.

◆ isRequiredProperty()

bool sf::ActionButton::isRequiredProperty ( const QString &  name)
overridevirtual

Overloaded from base class.

Implements sf::ObjectExtension.

◆ setAction()

void sf::ActionButton::setAction ( QAction *  action)

Set the action owner of this button, that is the action associated to the button. The button is configured immediately depending on the action status and the button and the action are connected together so that when the action is changed the button is updated and when the button has been clicked the 'action' is triggered.

Parameters
actionThe action to associate to this button.

◆ setActionByName()

void sf::ActionButton::setActionByName ( const QString &  name)

Sets an 'action' by finding it in the parent child list by name. When found the getAction()

Parameters
nameName of the action to look for.

◆ updateButtonStatusFromAction()

void sf::ActionButton::updateButtonStatusFromAction ( )

Update the button status depending on a change on the action status. This slot is invoked each time the action "changed" signal is emitted.

Property Documentation

◆ action

QString sf::ActionButton::action
readwrite

The documentation for this class was generated from the following file: