本文整理汇总了C++中DocumentView::getHeader方法的典型用法代码示例。如果您正苦于以下问题:C++ DocumentView::getHeader方法的具体用法?C++ DocumentView::getHeader怎么用?C++ DocumentView::getHeader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocumentView
的用法示例。
在下文中一共展示了DocumentView::getHeader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_actionOpen_Project_triggered
void MainWindow::on_actionOpen_Project_triggered()
{
if(project_open)
on_actionClose_Project_triggered();
if(project_open)
return;
editor = new DocumentEditorView(this);
editor->hide();
QDomDocument doc;
QString filename = QFileDialog::getOpenFileName(this, QString("Choose Project"), ".", "TRX Project (*.trx)");
QFile file(filename);
current_project_directory = QFileInfo(filename).absoluteDir();
current_project_name = QFileInfo(filename).baseName();
qDebug() << "filename: " << filename;
if (!file.open(QIODevice::ReadOnly | QFile::Text))
return;
QString message;
if (!doc.setContent(&file ,false, &message)) {
file.close();
return;
}
file.close();
QDomElement docEl = doc.documentElement();
QString docName = docEl.toElement().firstChild().nodeValue();
qDebug() << docEl.toElement().firstChild().nodeValue();
QDomNode child = docEl.firstChild().nextSibling();
qDebug() << child.toElement().firstChild().nodeValue();
qDebug() << QFileInfo(filename).absoluteDir().filePath(child.toElement().firstChild().nodeValue());
requirements = DocumentView::loadDocument(QFileInfo(filename).absoluteDir().filePath(child.toElement().firstChild().nodeValue()));
requirements->hide();
traceability = new TraceabilityView(requirements, this);
ui->centralWidget->layout()->addWidget(traceability);
QObject::connect(ui->showReq, SIGNAL(pressed()), this, SLOT(showRequirements()));
QObject::connect(ui->showEdit, SIGNAL(pressed()), this, SLOT(showEditor()));
QObject::connect(ui->showTrace, SIGNAL(pressed()), this, SLOT(showTraceability()));
QObject::connect(editor, SIGNAL(docAdded(DocumentView*)), traceability, SLOT(addModels(DocumentView*)));
QObject::connect(editor, SIGNAL(removeDocument(int)), traceability, SLOT(removeDocument(int)));
QHash<DocumentView*, QStandardItemModel*> *traceModelList = traceability->getTraceModelList();
bool modelset = false;
child = child.nextSibling();
while (!child.isNull())
{
QDomNode subchild = child.firstChild();
qDebug() << subchild.toElement().firstChild().nodeValue();
DocumentView* docview = DocumentView::loadDocument(current_project_directory.dirName() + "/" + subchild.toElement().firstChild().nodeValue());
subchild = subchild.nextSibling();
qDebug() << subchild.toElement().firstChild().nodeValue();
QStandardItemModel *matrix = TraceabilityView::loadMatrix(current_project_directory.dirName() + "/" + subchild.toElement().firstChild().nodeValue()+ "_matrix");
//traceability->addModels(docview, matrix);
editor->addLoadedTab(docview);
matrix->setHorizontalHeaderLabels(docview->getHeader());
traceModelList->insert(docview, matrix);
if(!modelset){
traceability->setMatrixModel(matrix);
modelset = true;
}
child = child.nextSibling();
}
traceability->addRowToDocument(requirements, -1);
traceability->updateReqListModel();
project_open = true;
ui->frame_2->hide();
ui->frame->show();
}