QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgstablewidgetitem.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstablewidgetitem.h - QgsTableWidgetItem
3
4 ---------------------
5 begin : 27.3.2016
6 copyright : (C) 2016 by Matthias Kuhn, OPENGIS.ch
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16#ifndef QGSTABLEWIDGETITEM_H
17#define QGSTABLEWIDGETITEM_H
18
19#include <QTableWidget>
20#include "qgis_gui.h"
21
27class GUI_EXPORT QgsTableWidgetItem : public QTableWidgetItem
28{
29 public:
30 QgsTableWidgetItem() = default;
31
35 QgsTableWidgetItem( const QString &text );
36
37
42 void setSortRole( int role );
43
48 int sortRole() const;
49
50 bool operator<( const QTableWidgetItem &other ) const override;
51
52 private:
53 int mSortRole = Qt::DisplayRole;
54};
55
56#endif // QGSTABLEWIDGETITEM_H
This can be used like a regular QTableWidgetItem with the difference that a specific role can be set ...
QgsTableWidgetItem()=default
bool operator<(const QVariant &v1, const QVariant &v2)
Compares two QVariant values and returns whether the first is less than the second.
Definition qgis.h:6425