#include "quam/project.h" #include #include #include #include Project::Project(std::istream &st, QErrorMessage *errors, QMdiArea *parent) : QMdiSubWindow{parent}, Ui::Project{}, m_arc{new Arc::Arc{st, this}}, m_root{&m_arc->root}, m_errors{errors}, m_model{new Arc::Model{this}}, m_sorter{new QSortFilterProxyModel{this}} { auto widget = new QWidget{this}; setupUi(widget); setWidget(widget); setAttribute(Qt::WA_DeleteOnClose); showMaximized(); connect(m_model, &Arc::Model::dirChanged, this, &Project::dirChanged); connect(tableView, &QAbstractItemView::doubleClicked, m_model, &Arc::Model::setDirToIndex); dirName->setValidator(m_arc->validator); m_sorter->setSourceModel(m_model); tableView->setModel(m_sorter); m_model->setDir(m_root); } Project::~Project() { } void Project::dirChanged(Arc::Dir *from, Arc::Dir *to) { tableView->resizeColumnsToContents(); } bool Project::dirUp() { return m_model->dirUp(); } // EOF