QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
i
l
m
n
o
p
s
t
+
Functions
a
b
c
d
f
g
i
l
m
n
o
p
t
Variables
Typedefs
Enumerations
Enumerator
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
2
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
2
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
+
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Properties
a
b
c
d
e
f
h
i
l
m
n
o
p
r
s
t
u
v
+
Related Functions
a
c
d
e
f
g
l
n
o
p
q
r
s
t
v
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Variables
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
u
z
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
Enumerations
Enumerator
+
Macros
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
gui
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
7
email : matthias@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
QgsTableWidgetItem::QgsTableWidgetItem
()
19
:
QTableWidgetItem
()
20
, mSortRole(
Qt
::DisplayRole )
21
{
22
}
23
24
QgsTableWidgetItem::QgsTableWidgetItem
(
const
QString
&
text
)
25
:
QTableWidgetItem
( text )
26
, mSortRole(
Qt
::DisplayRole )
27
{
28
}
29
30
void
QgsTableWidgetItem::setSortRole
(
int
role )
31
{
32
mSortRole = role;
33
}
34
35
int
QgsTableWidgetItem::sortRole
()
const
36
{
37
return
mSortRole;
38
}
39
40
bool
QgsTableWidgetItem::operator<
(
const
QTableWidgetItem
& other )
const
41
{
42
#if QT_VERSION < 0x050000
43
return
data
( mSortRole ).
toString
() < other.
data
( mSortRole ).
toString
();
44
#else
45
return
data
( mSortRole ) < other.
data
( mSortRole );
46
#endif
47
}
QgsTableWidgetItem::sortRole
int sortRole() const
Get the role by which the items should be sorted.
Definition:
qgstablewidgetitem.cpp:35
QTableWidgetItem
QTableWidgetItem::data
virtual QVariant data(int role) const
Qt
QgsTableWidgetItem::setSortRole
void setSortRole(int role)
Set the role by which the items should be sorted.
Definition:
qgstablewidgetitem.cpp:30
QString
QTableWidgetItem::text
QString text() const
QgsTableWidgetItem::operator<
bool operator<(const QTableWidgetItem &other) const override
Definition:
qgstablewidgetitem.cpp:40
QgsTableWidgetItem::QgsTableWidgetItem
QgsTableWidgetItem()
Definition:
qgstablewidgetitem.cpp:18
qgstablewidgetitem.h
QVariant::toString
QString toString() const
Generated on Sun Jun 24 2018 11:42:48 for QGIS API Documentation by
1.8.13