12 : QSortFilterProxyModel(parent)
25 if (index.isValid()) {
26 QModelIndex sourceParent = mapToSource(index);
27 return sourceModel()->hasChildren(sourceParent);
36 if (index.isValid()) {
37 QModelIndex sourceParent = mapToSource(index);
38 return sourceModel()->canFetchMore(sourceParent);
47 QModelIndex sourceParent = mapToSource(index);
48 sourceModel()->fetchMore(sourceParent);
78 if (index.isValid()) {
81 if (UnderlyingModel) {
82 return UnderlyingModel->
getnode(index);
93 if (index.isValid()) {
94 QModelIndex sourceParent = mapToSource(index);
102 throw daq::dbe::cannot_handle_invalid_qmodelindex(
ERS_HERE);
105dunedaq::conffwk::class_t
108 QModelIndex sourceParent = mapToSource(index);
110 if (dbe::models::tree* my =
dynamic_cast<dbe::models::tree*
>(sourceModel())) {
114 return dunedaq::conffwk::class_t();
120 return sourceModel();
139 treenode* NodeObject =
getnode(sourceModel()->index(source_row, 0, source_parent));
146 if (!source_parent.isValid()) {
147 QModelIndex Index_1 = sourceModel()->index(source_row, 1, source_parent);
149 if (sourceModel()->data(Index_1).toUInt() == 0) {
170 if (left.parent() == QModelIndex() || left.parent().parent() == QModelIndex()) {
171 QVariant LeftData = sourceModel()->data(left);
172 QVariant RightData = sourceModel()->data(right);
174 switch (LeftData.type()) {
177 return (LeftData.toUInt() < RightData.toUInt());
180 return (LeftData.toInt() < RightData.toInt());
182 case QVariant::String:
183 return ((LeftData.toString()).compare(RightData.toString()) > 0);
199 sourceModel()->fetchMore(SourceIndex);
202 if (sourceModel()->data(SourceIndex).toString().contains(filterRegExp())) {
210 for (
int i = 0; i < sourceModel()->rowCount(SourceIndex); ++i) {
223 QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent);
233 QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent);
234 QString
id = sourceModel()->data(index0).toString();
236 if ((filterRegExp()).isEmpty()) {
240 if (
AtDepth(sourceParent) > 2) {
244 if (!sourceParent.isValid()) {
246 if (QString(
QueryObjects.at(i).class_name().c_str()).compare(
id) == 0) {
251 if (
id.compare(QString(
QueryObjects.at(i).UID().c_str())) == 0) {
263 QModelIndex CurrentIndex = SourceParent;
265 while (CurrentIndex.isValid()) {
266 CurrentIndex = CurrentIndex.parent();
286 auto found = [&obj, classnode](
int i) {
287 return obj.UID() == classnode->GetChild(i)->GetData(0).toString().toStdString();
291 int const childs = classnode->ChildCount();
293 for (; i < childs and not found(i); ++i)
296 return i == childs ? QModelIndex() : index(i, 0, QModelIndex());
299 return QModelIndex();
322 type_index
const mapped_index = this->mapFromSource(index);
323 emit dataChanged(mapped_index, mapped_index);
329 type_index
const mapped_index = this->mapFromSource(index);
330 emit dataChanged(mapped_index, mapped_index);
#define TREEMODEL_REMOVE_ROWS_DEF(classname)
static cptr< datahandler > gethandler()
void model_common_connections()
type_datum * getnode(const type_index &index) const override
int AtDepth(const QModelIndex &SourceParent) const
void SetFilterType(FilterType Filter)
bool canFetchMore(type_index const &index) const
treeselection(QObject *parent=0)
Including DBE.
std::vector< tref > QueryObjects
bool hasChildren(type_index const &index) const
bool RegexpFilter(int sourceRow, const QModelIndex &sourceParent) const
std::vector< dbe::tref > GetQueryObjects()
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
type_datum * getnode(type_index const &index) const override
bool ObjectFilter(int sourceRow, const QModelIndex &sourceParent) const
void ToggleEmptyClasses(bool HideLocal)
void SetQueryObjects(std::vector< tref > Objects)
bool lessThan(const QModelIndex &left, const QModelIndex &right) const
void SetFilterRestrictionLevel(int Levels)
bool AcceptItem(const QModelIndex &SourceIndex, int LevelRestriction) const
void fetchMore(type_index const &index)
#define MODEL_COMMON_INTERFACE_LOOKUP_IMPL(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)
inner::configobject::tref tref
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