QGIS API Documentation 3.41.0-Master (cea29feecf2)
|
QTreeWidgetItem subclass with custom handling for item sorting. More...
#include <qgstreewidgetitem.h>
Public Member Functions | |
QgsTreeWidgetItem (const QStringList &strings, int type=Type) | |
Constructor for QgsTreeWidgetItem. | |
QgsTreeWidgetItem (int type=Type) | |
Constructor for QgsTreeWidgetItem. | |
QgsTreeWidgetItem (QTreeWidget *view, const QStringList &strings, int type=Type) | |
Constructor for QgsTreeWidgetItem. | |
QgsTreeWidgetItem (QTreeWidget *view, int type=Type) | |
Constructor for QgsTreeWidgetItem. | |
QgsTreeWidgetItem (QTreeWidget *view, QTreeWidgetItem *after, int type=Type) | |
Constructor for QgsTreeWidgetItem. | |
QgsTreeWidgetItem (QTreeWidgetItem *parent, const QStringList &strings, int type=Type) | |
Constructor for QgsTreeWidgetItem. | |
QgsTreeWidgetItem (QTreeWidgetItem *parent, int type=Type) | |
Constructor for QgsTreeWidgetItem. | |
QgsTreeWidgetItem (QTreeWidgetItem *parent, QTreeWidgetItem *after, int type=Type) | |
Constructor for QgsTreeWidgetItem. | |
int | alwaysOnTopPriority () const |
Returns the item's priority when it is set to show always on top. | |
bool | operator< (const QTreeWidgetItem &other) const override |
Returns true if this item should appear before another item when sorting a list of items. | |
bool | operator>= (const QTreeWidgetItem &other) const |
Returns true if this item should appear after another item when sorting a list of items. | |
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. | |
void | setSortData (int column, const QVariant &value) |
Sets the custom sort data for a specified column. | |
QVariant | sortData (int column) const |
Returns the custom sort data for a specified column. | |
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 35 of file qgstreewidgetitem.h.
|
explicit |
Constructor for QgsTreeWidgetItem.
view | parent QTreeWidget view |
type | item type |
Definition at line 23 of file qgstreewidgetitem.cpp.
|
explicit |
Constructor for QgsTreeWidgetItem.
type | item type |
Definition at line 27 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 31 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 35 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 39 of file qgstreewidgetitem.cpp.
|
explicit |
Constructor for QgsTreeWidgetItem.
parent | QTreeWidgetItem item |
type | item type |
Definition at line 43 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 47 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 51 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 70 of file qgstreewidgetitem.cpp.
|
override |
Returns true
if this item should appear before another item when sorting a list of items.
Definition at line 76 of file qgstreewidgetitem.cpp.
|
inline |
Returns true
if this item should appear after another item when sorting a list of items.
Definition at line 142 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 65 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 55 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 60 of file qgstreewidgetitem.cpp.