QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgstablewidgetitem.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgstablewidgetitem.cpp - 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#include "qgstablewidgetitem.h"
17
18#include "qgis.h"
19
21 : QTableWidgetItem( text )
22{
23}
24
26{
27 mSortRole = role;
28}
29
31{
32 return mSortRole;
33}
34
35bool QgsTableWidgetItem::operator<( const QTableWidgetItem &other ) const
36{
37 return qgsVariantLessThan( data( mSortRole ), other.data( mSortRole ) );
38}
int sortRole() const
Gets the role by which the items should be sorted.
void setSortRole(int role)
Set the role by which the items should be sorted.
bool operator<(const QTableWidgetItem &other) const override
QgsTableWidgetItem()=default
bool qgsVariantLessThan(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether the first is less than the second.
Definition qgis.cpp:588