#include <tableselection.hpp>
Definition at line 17 of file tableselection.hpp.
◆ type_datum
◆ FilterType
◆ tableselection()
dbe::models::tableselection::tableselection |
( |
QObject * | parent = 0 | ) |
|
Definition at line 5 of file tableselection.cpp.
6 : QSortFilterProxyModel ( parent ),
8{
10}
void model_common_connections()
◆ filterAcceptsRow()
bool dbe::models::tableselection::filterAcceptsRow |
( |
int | sourceRow, |
|
|
const QModelIndex & | sourceParent ) const |
|
protected |
Definition at line 80 of file tableselection.cpp.
82{
83 QModelIndex index0 = sourceModel()->index ( sourceRow, 0, sourceParent );
84
85 if ( filterRegExp().isEmpty() )
86 {
87 return true;
88 }
89
91 {
93 if ( filterRegExp().indexIn ( sourceModel()->data ( index0 ).toString() ) != -1 )
94 {
95 return true;
96 }
97 else
98 {
99 return false;
100 }
101
103 return ( filterRegExp().exactMatch ( sourceModel()->data ( index0 ).toString() ) );
104
105 default:
106 return true;
107 }
108}
◆ getnode()
dbe::TableNode * dbe::models::tableselection::getnode |
( |
const QModelIndex & | index | ) |
const |
Definition at line 18 of file tableselection.cpp.
19{
20 if (
index.isValid() )
21 {
22 QModelIndex sourceParent = mapToSource ( index );
24
25 if ( my != 0 )
26 {
27 return my->
getnode ( sourceParent );
28 }
29 else
30 {
31 return nullptr;
32 }
33 }
34 else
35 {
36 return nullptr;
37 }
38}
TableNode * getnode(const QModelIndex &Index) const
◆ lessThan()
bool dbe::models::tableselection::lessThan |
( |
const QModelIndex & | left, |
|
|
const QModelIndex & | right ) const |
|
protected |
Definition at line 110 of file tableselection.cpp.
112{
113 QVariant LeftData = sourceModel()->data ( left );
114 QVariant RightData = sourceModel()->data ( right );
115
116 switch ( LeftData.type() )
117 {
118 case QVariant::Bool:
119 case QVariant::UInt:
120 return ( LeftData.toUInt() < RightData.toUInt() );
121
122 case QVariant::Int:
123 return ( LeftData.toInt() < RightData.toInt() );
124
125 case QVariant::String:
126 {
127 const QString&
l = LeftData.toString();
128 const QString&
r = RightData.toString();
129
130 bool ok;
131 const double ld =
l.toDouble(&ok);
132 if(ok == true) {
133 return ( ld <
r.toDouble());
134 }
135
136 const qint64 lll =
l.toLongLong(&ok);
137 if(ok == true) {
138 return (lll <
r.toLongLong());
139 }
140
141 const quint64 lull =
l.toULongLong(&ok);
142 if(ok == true) {
143 return (lull <
r.toULongLong());
144 }
145
146 return ((l).compare(r) > 0);
147 }
148
149 default:
150 return false;
151 }
152
153 return true;
154}
◆ ResetModel()
void dbe::models::tableselection::ResetModel |
( |
| ) |
|
◆ setData()
bool dbe::models::tableselection::setData |
( |
const QModelIndex & | index, |
|
|
const QVariant & | value, |
|
|
int | role ) |
Definition at line 40 of file tableselection.cpp.
43{
44 if (
index.isValid() )
45 {
46 QModelIndex sourceParent;
47
48 int idx_row =
index.row();
49 int idx_col =
index.column();
50
51 try
52 {
53 QModelIndex idx_index = this->
index ( idx_row, idx_col );
54 sourceParent = mapToSource ( idx_index );
55 }
56 catch ( std::exception const & stderr )
57 {
58 WARN (
"Error setting data", stderr.what() );
59 return true;
60 }
61
62 bool success = sourceModel()->setData ( sourceParent, value, role );
63 QModelIndex idx_index = this->
index ( idx_row, idx_col );
64 emit dataChanged ( idx_index, idx_index );
65
66 return success;
67 }
68 else
69 {
70 return true;
71 }
72}
◆ SetFilterType()
void dbe::models::tableselection::SetFilterType |
( |
FilterType | Filter | ) |
|
◆ slot_create_object
void dbe::models::tableselection::slot_create_object |
( |
QString const & | src, |
|
|
dref const & | obj ) |
|
privateslot |
◆ slot_remove_object
void dbe::models::tableselection::slot_remove_object |
( |
QString const & | src, |
|
|
dref const & | obj ) |
|
privateslot |
◆ slot_rename_object
void dbe::models::tableselection::slot_rename_object |
( |
QString const & | src, |
|
|
dref const & | obj ) |
|
privateslot |
◆ slot_update_object
void dbe::models::tableselection::slot_update_object |
( |
QString const & | src, |
|
|
dref const & | obj ) |
|
privateslot |
◆ LastSavedValue
QVariant dbe::models::tableselection::LastSavedValue |
|
private |
◆ Type
The documentation for this class was generated from the following files: