QGIS API Documentation  3.20.0-Odense (decaadbb31)
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
7  email : [email protected]
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 
27 class GUI_EXPORT QgsTableWidgetItem : public QTableWidgetItem
28 {
29  public:
30 
34  QgsTableWidgetItem() = default;
35 
39  QgsTableWidgetItem( const QString &text );
40 
41 
46  void setSortRole( int role );
47 
52  int sortRole() const;
53 
54  bool operator <( const QTableWidgetItem &other ) const override;
55 
56  private:
57  int mSortRole = Qt::DisplayRole;
58 };
59 
60 #endif // QGSTABLEWIDGETITEM_H
This can be used like a regular QTableWidgetItem with the difference that a specific role can be set ...
QgsTableWidgetItem()=default
Constructor for QgsTableWidgetItem.
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:895