Krita Source Code Documentation
Loading...
Searching...
No Matches
KoSectionListItem Class Reference
+ Inheritance diagram for KoSectionListItem:

Public Member Functions

 KoSectionListItem (QTreeWidget *treeWidget, const QString &name, QString untranslatedName, int sortWeight, int widgetIndex=-1)
 
bool operator< (const QTreeWidgetItem &other) const override
 
int sortWeight () const
 
QString untranslatedName () const
 
int widgetIndex () const
 

Private Attributes

int m_sortWeight {0}
 
QString m_untranslatedName
 
int m_widgetIndex {-1}
 

Detailed Description

Definition at line 46 of file KisOpenPane.cpp.

Constructor & Destructor Documentation

◆ KoSectionListItem()

KoSectionListItem::KoSectionListItem ( QTreeWidget * treeWidget,
const QString & name,
QString untranslatedName,
int sortWeight,
int widgetIndex = -1 )
inline

Definition at line 49 of file KisOpenPane.cpp.

50 : QTreeWidgetItem(treeWidget, QStringList() << name)
54 {
55 Qt::ItemFlags newFlags = Qt::NoItemFlags;
56
57 if(m_widgetIndex >= 0)
58 newFlags |= Qt::ItemIsEnabled | Qt::ItemIsSelectable;
59
60 setFlags(newFlags);
61 }
QList< QString > QStringList
int widgetIndex() const
int sortWeight() const
QString m_untranslatedName
QString untranslatedName() const

References m_widgetIndex.

Member Function Documentation

◆ operator<()

bool KoSectionListItem::operator< ( const QTreeWidgetItem & other) const
inlineoverride

Definition at line 63 of file KisOpenPane.cpp.

63 {
64 const KoSectionListItem* item = dynamic_cast<const KoSectionListItem*>(&other);
65
66 if (!item)
67 return 0;
68
69 return ((item->sortWeight() - sortWeight()) < 0);
70 }

References sortWeight().

◆ sortWeight()

int KoSectionListItem::sortWeight ( ) const
inline

Definition at line 72 of file KisOpenPane.cpp.

72 {
73 return m_sortWeight;
74 }

References m_sortWeight.

◆ untranslatedName()

QString KoSectionListItem::untranslatedName ( ) const
inline

Definition at line 80 of file KisOpenPane.cpp.

80 {
81 return m_untranslatedName;
82 }

References m_untranslatedName.

◆ widgetIndex()

int KoSectionListItem::widgetIndex ( ) const
inline

Definition at line 76 of file KisOpenPane.cpp.

76 {
77 return m_widgetIndex;
78 }

References m_widgetIndex.

Member Data Documentation

◆ m_sortWeight

int KoSectionListItem::m_sortWeight {0}
private

Definition at line 85 of file KisOpenPane.cpp.

85{0};

◆ m_untranslatedName

QString KoSectionListItem::m_untranslatedName
private

Definition at line 87 of file KisOpenPane.cpp.

◆ m_widgetIndex

int KoSectionListItem::m_widgetIndex {-1}
private

Definition at line 86 of file KisOpenPane.cpp.

86{-1};

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