QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 
25 class GUI_EXPORT QgsTableWidgetItem : public QTableWidgetItem
26 {
27  public:
32  QgsTableWidgetItem( const QString& text );
33 
34 
39  void setSortRole( int role );
44  int sortRole() const;
45 
46  bool operator <( const QTableWidgetItem& other ) const override;
47 
48  private:
49  int mSortRole;
50 };
51 
52 #endif // QGSTABLEWIDGETITEM_H
This can be used like a regular QTableWidgetItem with the difference that a specific role can be set ...
virtual bool operator<(const QTableWidgetItem &other) const