Polkit-Qt-1  0.95.0
Public Member Functions
PolkitQt1::Gui::ActionButtons Class Reference

Class used to hold and update a list of QAbstractButtons. More...

#include <ActionButtons>

Inheritance diagram for PolkitQt1::Gui::ActionButtons:
PolkitQt1::Gui::ActionButton PolkitQt1::Gui::Action

Public Member Functions

 ActionButtons (const QList< QAbstractButton *> &buttons, const QString &actionId=QString(), QObject *parent=0)
 
void setButtons (const QList< QAbstractButton *> &buttons)
 
QList< QAbstractButton * > buttons () const
 
void addButton (QAbstractButton *button)
 
void removeButton (QAbstractButton *button)
 
- Public Member Functions inherited from PolkitQt1::Gui::ActionButton
 ActionButton (QAbstractButton *button, const QString &actionId=QString(), QObject *parent=0)
 
void setButton (QAbstractButton *button)
 
QAbstractButton * button () const
 
- Public Member Functions inherited from PolkitQt1::Gui::Action
 Action (const QString &actionId=QString(), QObject *parent=0)
 
void setPolkitAction (const QString &actionId)
 
QString actionId () const
 
void setText (const QString &text, States states=All)
 
void setToolTip (const QString &toolTip, States states=All)
 
void setWhatsThis (const QString &whatsThis, States states=All)
 
void setIcon (const QIcon &icon, States states=All)
 
void setVisible (bool visible, States states=All)
 
void setEnabled (bool enabled, States states=All)
 
void setTargetPID (qint64 pid)
 
QString text (State state=None) const
 
QString toolTip (State state=None) const
 
QString whatsThis (State state=None) const
 
QIcon icon (State state=None) const
 
bool isVisible (State state=None) const
 
bool isEnabled (State state=None) const
 
qint64 targetPID () const
 
bool isAllowed () const
 
bool is (const QString &actionId) const
 

Additional Inherited Members

- Public Types inherited from PolkitQt1::Gui::Action
enum  State {
  None = 0, SelfBlocked = 1, Yes = 2, No = 4,
  Auth = 8, All = 512
}
 
- Public Slots inherited from PolkitQt1::Gui::ActionButton
bool activate ()
 
- Public Slots inherited from PolkitQt1::Gui::Action
bool activate ()
 
void setChecked (bool checked)
 
void revoke ()
 
- Signals inherited from PolkitQt1::Gui::ActionButton
void clicked (QAbstractButton *button, bool checked=false)
 
- Signals inherited from PolkitQt1::Gui::Action
void dataChanged ()
 
void authorized ()
 
- Protected Member Functions inherited from PolkitQt1::Gui::ActionButton
 ActionButton (ActionButtonPrivate &dd, const QString &actionId, QObject *parent=0)
 
- Protected Attributes inherited from PolkitQt1::Gui::ActionButton
ActionButtonPrivate *const d_ptr
 

Detailed Description

Class used to hold and update a list of QAbstractButtons.

Author
Dario Freddi drf@k.nosp@m.de.o.nosp@m.rg

This class is a convenience wrapper around ActionButton that lets you associate an undefined number of QAbstractButtons with a single action. Every button will be updated accordingly upon action's properties changes.

See also
ActionButton

Constructor & Destructor Documentation

◆ ActionButtons()

PolkitQt1::Gui::ActionButtons::ActionButtons ( const QList< QAbstractButton *> &  buttons,
const QString &  actionId = QString(),
QObject *  parent = 0 
)
explicit

Constructs a new ActionButton. You need to pass this constructor an existing list of QAbstractButtons, whose properties will be modified according to the underlying Action object. As ActionButtons inherits from Action, you can define your buttons' behavior right through this wrapper.

See also
Action
Parameters
buttonsthe QAbstractButton to associate to this ActionButton
actionIdthe action Id to create the underlying Action
parentthe parent object

Member Function Documentation

◆ addButton()

void PolkitQt1::Gui::ActionButtons::addButton ( QAbstractButton *  button)

Adds a button to the current button list. The button's properties will be updated according to the action upon adding.

Parameters
buttonthe button to add

◆ buttons()

QList< QAbstractButton * > PolkitQt1::Gui::ActionButtons::buttons ( ) const

Returns the current buttons list

Returns
the buttons currently associated with the underlying action

◆ removeButton()

void PolkitQt1::Gui::ActionButtons::removeButton ( QAbstractButton *  button)

Removes a button from the current list. Please note that Polkit-Qt does not handle the removed button's memory, so you should take care of deleting it yourself (if needed).

Parameters
buttonthe button to remove

◆ setButtons()

void PolkitQt1::Gui::ActionButtons::setButtons ( const QList< QAbstractButton *> &  buttons)

Sets a list of buttons associated to the underlying action.

Note
If you are calling this function, you're probably changing the buttons list the action is referring to. If this is the case, please note that Polkit-Qt does not handle the previous buttons' memory, so you should take care of deleting them yourself (if needed). You can retrieve it by using buttons()
See also
buttons
Parameters
buttonsthe new buttons associated with the underlying action

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