QGIS API Documentation 3.41.0-Master (3440c17df1d)
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
31 QgsTableWidgetItem() = default;
32
36 QgsTableWidgetItem( const QString &text );
37
38
43 void setSortRole( int role );
44
49 int sortRole() const;
50
51 bool operator <( const QTableWidgetItem &other ) const override;
52
53 private:
54 int mSortRole = Qt::DisplayRole;
55};
56
57#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:6359