Krita Source Code Documentation
Loading...
Searching...
No Matches
NodeView::PropertyAction Class Reference

#include <NodePropertyAction_p.h>

+ Inheritance diagram for NodeView::PropertyAction:

Signals

void toggled (bool on, const QPersistentModelIndex &index, int property)
 

Public Member Functions

 PropertyAction (int num, const KisBaseNode::Property &p, const QPersistentModelIndex &index, QObject *parent=0)
 

Private Types

typedef QAction super
 

Private Slots

void slotTriggered ()
 

Private Attributes

QPersistentModelIndex m_index
 
int m_num
 
KisBaseNode::Property m_property
 

Detailed Description

Internal class for the NodeView widget. Provides a toggle action for a particular property associated with a document section, such as visible, selected, locked. Property actions have associated on/off icons to show their state in the NodeView.

Definition at line 24 of file NodePropertyAction_p.h.

Member Typedef Documentation

◆ super

typedef QAction NodeView::PropertyAction::super
private

Definition at line 26 of file NodePropertyAction_p.h.

Constructor & Destructor Documentation

◆ PropertyAction()

NodeView::PropertyAction::PropertyAction ( int num,
const KisBaseNode::Property & p,
const QPersistentModelIndex & index,
QObject * parent = 0 )
inline

Definition at line 36 of file NodePropertyAction_p.h.

37 : QAction( parent ), m_property( p ), m_num( num ), m_index( index )
38 {
39 connect( this, SIGNAL( triggered( bool ) ), this, SLOT( slotTriggered() ) );
41 setIcon( m_property.state.toBool() ? m_property.onIcon : m_property.offIcon );
42 }
const Params2D p
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
QPersistentModelIndex m_index
KisBaseNode::Property m_property
void setText(QSpinBox *spinBox, const QStringView textTemplate)

References connect(), m_property, KisBaseNode::Property::name, KisBaseNode::Property::offIcon, KisBaseNode::Property::onIcon, slotTriggered(), and KisBaseNode::Property::state.

Member Function Documentation

◆ slotTriggered

void NodeView::PropertyAction::slotTriggered ( )
inlineprivateslot

Definition at line 45 of file NodePropertyAction_p.h.

46 {
47 m_property.state = !m_property.state.toBool();
48 setIcon( m_property.state.toBool() ? m_property.onIcon : m_property.offIcon );
49 Q_EMIT toggled( m_property.state.toBool(), m_index, m_num );
50 }
void toggled(bool on, const QPersistentModelIndex &index, int property)

References m_index, m_num, m_property, KisBaseNode::Property::offIcon, KisBaseNode::Property::onIcon, KisBaseNode::Property::state, and toggled().

◆ toggled

void NodeView::PropertyAction::toggled ( bool on,
const QPersistentModelIndex & index,
int property )
signal

Member Data Documentation

◆ m_index

QPersistentModelIndex NodeView::PropertyAction::m_index
private

Definition at line 30 of file NodePropertyAction_p.h.

◆ m_num

int NodeView::PropertyAction::m_num
private

Definition at line 29 of file NodePropertyAction_p.h.

◆ m_property

KisBaseNode::Property NodeView::PropertyAction::m_property
private

Definition at line 28 of file NodePropertyAction_p.h.


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