6 : QSortFilterProxyModel ( parent ),
20 if ( index.isValid() )
22 QModelIndex sourceParent = mapToSource ( index );
27 return my->
getnode ( sourceParent );
41 const QVariant & value,
44 if ( index.isValid() )
46 QModelIndex sourceParent;
48 int idx_row = index.row();
49 int idx_col = index.column();
53 QModelIndex idx_index = this->index ( idx_row, idx_col );
54 sourceParent = mapToSource ( idx_index );
56 catch ( std::exception
const & stderr )
58 WARN (
"Error setting data", stderr.what() );
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 );
81 const QModelIndex & sourceParent )
const
83 QModelIndex index0 = sourceModel()->index ( sourceRow, 0, sourceParent );
85 if ( filterRegExp().isEmpty() )
93 if ( filterRegExp().indexIn ( sourceModel()->data ( index0 ).toString() ) != -1 )
103 return ( filterRegExp().exactMatch ( sourceModel()->data ( index0 ).toString() ) );
111 const QModelIndex & right )
const
113 QVariant LeftData = sourceModel()->data ( left );
114 QVariant RightData = sourceModel()->data ( right );
116 switch ( LeftData.type() )
120 return ( LeftData.toUInt() < RightData.toUInt() );
123 return ( LeftData.toInt() < RightData.toInt() );
125 case QVariant::String:
127 const QString& l = LeftData.toString();
128 const QString& r = RightData.toString();
131 const double ld = l.toDouble(&ok);
133 return ( ld < r.toDouble());
136 const qint64 lll = l.toLongLong(&ok);
138 return (lll < r.toLongLong());
141 const quint64 lull = l.toULongLong(&ok);
143 return (lull < r.toULongLong());
146 return ((l).compare(r) > 0);
158 if ( index.isValid() )
161 ( this->sourceModel() ) )
163 QModelIndex
const src_index = this->mapToSource ( index );
165 if ( src_index.isValid() )
167 return src_model->GetTableObject ( src_index.row() );
172 throw daq::dbe::cannot_handle_invalid_qmodelindex (
ERS_HERE );
178 if (
index.isValid() )
183 QModelIndex
const src_index = this->mapToSource ( index );
185 if ( src_index.isValid() )
187 return src_model->getclass ( src_index );
222 return QModelIndex();
void model_common_connections()
TableNode * getnode(const QModelIndex &Index) const
TableNode * getnode(const QModelIndex &index) const
void SetFilterType(FilterType Filter)
bool setData(const QModelIndex &index, const QVariant &value, int role)
bool lessThan(const QModelIndex &left, const QModelIndex &right) const
tableselection(QObject *parent=0)
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
#define MODEL_COMMON_INTERFACE_LOOKUP_IMPL(classname)
#define MODEL_REMOVE_ROWS_DEF(classname)
#define MODEL_COMMON_INTERFACE_RENAME_THAT_OBJ_IMPL(classname)
#define MODEL_COMMON_INTERFACE_UPDATE_THAT_OBJ_IMPL(classname)
#define MODEL_COMMON_INTERFACE_DELETE_THAT_OBJ_IMPL(classname)
#define MODEL_COMMON_INTERFACE_SLOTS_DEF(classname)
#define MODEL_COMMON_INTERFACE_CREATE_THAT_OBJ_IMPL(classname)
virtual type_class_info getclass(type_index const &index) const =0
virtual type_object_ref getobject(type_index const &index) const =0
virtual QAbstractItemModel * ReturnSourceModel() const =0