#include "myproxymodel.h" MyProxyModel::MyProxyModel() { QFile file("C:/Project/editabletreemodel/default.txt"); file.open(QIODevice::ReadOnly | QIODevice::Text); //qInfo() << QString::fromUtf8(file.readAll()); QString s = QString::fromUtf8(file.readAll()); TestModel = new TreeModel({"title","description"},s,this); file.close(); this->setSourceModel(TestModel); } bool MyProxyModel::filterAcceptsColumn(int SourceColumn, const QModelIndex& SourceParent) const { return this->bHide ? SourceColumn != 1 : true; //return true; }