当前位置: 首页>>代码示例>>C++>>正文


C++ DocumentView::getHeader方法代码示例

本文整理汇总了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();
}
开发者ID:JoseCM,项目名称:TraceabilityMatrix,代码行数:83,代码来源:mainwindow.cpp


注:本文中的DocumentView::getHeader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。