#include <KisView_p.h>
Definition at line 17 of file KisView_p.h.
◆ UnitActionGroup()
| UnitActionGroup::UnitActionGroup |
( |
KisDocument * | document, |
|
|
bool | addPixelUnit, |
|
|
QObject * | parent = 0 ) |
|
inlineexplicit |
Definition at line 21 of file KisView_p.h.
22 : QActionGroup(parent)
25 {
26 setExclusive(true);
27 connect(
this, SIGNAL(triggered(QAction*)), SLOT(
onTriggered(QAction*)));
29
32
33 for (int i = 0; i < unitNames.count(); ++i) {
34 QAction* action = new QAction(unitNames.at(i), this);
35 action->setData(i);
36 action->setCheckable(true);
37
38 if (currentUnitIndex == i) {
39 action->setChecked(true);
40 }
41 }
42 }
static QStringList listOfUnitNameForUi(ListOptions listOptions=ListAll)
Returns the list of unit types for the UI, controlled with the given listOptions.
int indexInListForUi(ListOptions listOptions=ListAll) const
KoUnit::ListOptions m_listOptions
void onTriggered(QAction *action)
void onUnitChanged(const KoUnit &unit)
References KoUnit::indexInListForUi(), KoUnit::listOfUnitNameForUi(), m_document, m_listOptions, onTriggered(), onUnitChanged(), and KisDocument::unit.
◆ onTriggered
| void UnitActionGroup::onTriggered |
( |
QAction * | action | ) |
|
|
inlineprivateslot |
◆ onUnitChanged
| void UnitActionGroup::onUnitChanged |
( |
const KoUnit & | unit | ) |
|
|
inlineprivateslot |
Definition at line 50 of file KisView_p.h.
51 {
53
54 Q_FOREACH (QAction *action, actions()) {
55 if (action->data().toInt() == indexInList) {
56 action->setChecked(true);
57 break;
58 }
59
60
61
62 if (action->isChecked()) {
63 action->setChecked(false);
64 }
65 }
66 }
References KoUnit::indexInListForUi(), and m_listOptions.
◆ m_document
◆ m_listOptions
| KoUnit::ListOptions UnitActionGroup::m_listOptions |
|
private |
The documentation for this class was generated from the following file: