QGIS API Documentation
3.6.0-Noosa (5873452)
|
QTreeWidgetItem subclass with custom handling for item sorting. More...
#include <qgstreewidgetitem.h>
Public Member Functions | |
QgsTreeWidgetItem (QTreeWidget *view, int type=Type) | |
Constructor for QgsTreeWidgetItem. More... | |
QgsTreeWidgetItem (int type=Type) | |
Constructor for QgsTreeWidgetItem. More... | |
QgsTreeWidgetItem (const QStringList &strings, int type=Type) | |
Constructor for QgsTreeWidgetItem. More... | |
QgsTreeWidgetItem (QTreeWidget *view, const QStringList &strings, int type=Type) | |
Constructor for QgsTreeWidgetItem. More... | |
QgsTreeWidgetItem (QTreeWidget *view, QTreeWidgetItem *after, int type=Type) | |
Constructor for QgsTreeWidgetItem. More... | |
QgsTreeWidgetItem (QTreeWidgetItem *parent, int type=Type) | |
Constructor for QgsTreeWidgetItem. More... | |
QgsTreeWidgetItem (QTreeWidgetItem *parent, const QStringList &strings, int type=Type) | |
Constructor for QgsTreeWidgetItem. More... | |
QgsTreeWidgetItem (QTreeWidgetItem *parent, QTreeWidgetItem *after, int type=Type) | |
Constructor for QgsTreeWidgetItem. More... | |
int | alwaysOnTopPriority () const |
Returns the item's priority when it is set to show always on top. More... | |
bool | operator< (const QTreeWidgetItem &other) const override |
Returns true if this item should appear before another item when sorting a list of items. More... | |
bool | operator>= (const QTreeWidgetItem &other) const |
Returns true if this item should appear after another item when sorting a list of items. More... | |
void | setAlwaysOnTopPriority (int priority) |
Sets a the item to display always on top of other items in the widget, regardless of the sort column and sort or display value for the item. More... | |
void | setSortData (int column, const QVariant &value) |
Sets the custom sort data for a specified column. More... | |
QVariant | sortData (int column) const |
Returns the custom sort data for a specified column. More... | |
QTreeWidgetItem subclass with custom handling for item sorting.
QgsTreeWidgetItem allows for items to be sorted using a specified user role, and also correctly handles sorting numeric or mixed text and numeric values.
Definition at line 36 of file qgstreewidgetitem.h.
|
explicit |
Constructor for QgsTreeWidgetItem.
view | parent QTreeWidget view |
type | item type |
Definition at line 21 of file qgstreewidgetitem.cpp.
|
explicit |
Constructor for QgsTreeWidgetItem.
type | item type |
Definition at line 25 of file qgstreewidgetitem.cpp.
QgsTreeWidgetItem::QgsTreeWidgetItem | ( | const QStringList & | strings, |
int | type = Type |
||
) |
Constructor for QgsTreeWidgetItem.
strings | list of strings containing text for each column in the item |
type | item type |
Definition at line 29 of file qgstreewidgetitem.cpp.
QgsTreeWidgetItem::QgsTreeWidgetItem | ( | QTreeWidget * | view, |
const QStringList & | strings, | ||
int | type = Type |
||
) |
Constructor for QgsTreeWidgetItem.
view | parent QTreeWidget view |
strings | list of strings containing text for each column in the item |
type | item type |
Definition at line 33 of file qgstreewidgetitem.cpp.
QgsTreeWidgetItem::QgsTreeWidgetItem | ( | QTreeWidget * | view, |
QTreeWidgetItem * | after, | ||
int | type = Type |
||
) |
Constructor for QgsTreeWidgetItem.
view | parent QTreeWidget view |
after | QTreeWidgetItem to place insert item after in the view |
type | item type |
Definition at line 37 of file qgstreewidgetitem.cpp.
|
explicit |
Constructor for QgsTreeWidgetItem.
parent | QTreeWidgetItem item |
type | item type |
Definition at line 41 of file qgstreewidgetitem.cpp.
QgsTreeWidgetItem::QgsTreeWidgetItem | ( | QTreeWidgetItem * | parent, |
const QStringList & | strings, | ||
int | type = Type |
||
) |
Constructor for QgsTreeWidgetItem.
parent | QTreeWidgetItem item |
strings | list of strings containing text for each column in the item |
type | item type |
Definition at line 45 of file qgstreewidgetitem.cpp.
QgsTreeWidgetItem::QgsTreeWidgetItem | ( | QTreeWidgetItem * | parent, |
QTreeWidgetItem * | after, | ||
int | type = Type |
||
) |
Constructor for QgsTreeWidgetItem.
parent | QTreeWidgetItem item |
after | QTreeWidgetItem to place insert item after in the view |
type | item type |
Definition at line 49 of file qgstreewidgetitem.cpp.
int QgsTreeWidgetItem::alwaysOnTopPriority | ( | ) | const |
Returns the item's priority when it is set to show always on top.
Items with a lower priority will be placed above items with a higher priority.
Definition at line 68 of file qgstreewidgetitem.cpp.
|
override |
Returns true if this item should appear before another item when sorting a list of items.
Definition at line 74 of file qgstreewidgetitem.cpp.
|
inline |
Returns true if this item should appear after another item when sorting a list of items.
Definition at line 144 of file qgstreewidgetitem.h.
void QgsTreeWidgetItem::setAlwaysOnTopPriority | ( | int | priority | ) |
Sets a the item to display always on top of other items in the widget, regardless of the sort column and sort or display value for the item.
priority | priority for sorting always on top items. Items with a lower priority will be placed above items with a higher priority. |
Definition at line 63 of file qgstreewidgetitem.cpp.
void QgsTreeWidgetItem::setSortData | ( | int | column, |
const QVariant & | value | ||
) |
Sets the custom sort data for a specified column.
If set, this value will be used when sorting the item instead of the item's display text. If not set, the item's display text will be used when sorting.
column | column index |
value | sort value |
Definition at line 53 of file qgstreewidgetitem.cpp.
QVariant QgsTreeWidgetItem::sortData | ( | int | column | ) | const |
Returns the custom sort data for a specified column.
If set, this value will be used when sorting the item instead of the item's display text. If not set, the item's display text will be used when sorting.
Definition at line 58 of file qgstreewidgetitem.cpp.