Krita Source Code Documentation
Loading...
Searching...
No Matches
KisKXMLGUI::ActionList Class Reference

#include <kxmlguifactory_p.h>

+ Inheritance diagram for KisKXMLGUI::ActionList:

Public Member Functions

 ActionList ()
 
 ActionList (const QList< QAction * > &rhs)
 
ActionListoperator= (const QList< QAction * > &rhs)
 
void plug (QWidget *container, int index) const
 
void unplug (QWidget *container) const
 

Detailed Description

Definition at line 24 of file kxmlguifactory_p.h.

Constructor & Destructor Documentation

◆ ActionList() [1/2]

KisKXMLGUI::ActionList::ActionList ( )
inline

Definition at line 27 of file kxmlguifactory_p.h.

27{}

◆ ActionList() [2/2]

KisKXMLGUI::ActionList::ActionList ( const QList< QAction * > & rhs)
inline

Definition at line 28 of file kxmlguifactory_p.h.

29 : QList<QAction *>(rhs)
30 {}

Member Function Documentation

◆ operator=()

ActionList & KisKXMLGUI::ActionList::operator= ( const QList< QAction * > & rhs)
inline

Definition at line 31 of file kxmlguifactory_p.h.

32 {
34 return *this;
35 }

◆ plug()

void ActionList::plug ( QWidget * container,
int index ) const

Definition at line 20 of file kxmlguifactory_p.cpp.

21{
22 QAction *before = 0L; // Insert after end of widget's current actions (default).
23
24 if ((index < 0) || (index > container->actions().count())) {
25 qWarning() << "Index " << index << " is not within range (0 - " << container->actions().count();
26 } else if (index != container->actions().count()) {
27 before = container->actions().at(index); // Insert before indexed action.
28 }
29
30 Q_FOREACH (QAction *action, *this) {
31 container->insertAction(before, action);
32 // before = action; // BUG FIX: do not insert actions in reverse order.
33 }
34}

◆ unplug()

void ActionList::unplug ( QWidget * container) const

Definition at line 36 of file kxmlguifactory_p.cpp.

37{
38 Q_FOREACH (QAction *action, *this) {
39 if (container->actions().contains(action)) {
40 container->removeAction(action);
41 }
42 }
43}

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