Пример #1
0
void MainWindow::insertChild()
{
    QModelIndex index = view->selectionModel()->currentIndex();
    QAbstractItemModel *model = view->model();

    if (model->columnCount(index) == 0) {
        if (!model->insertColumn(0, index))
            return;
    }

    if (!model->insertRow(0, index))
        return;

    for (int column = 0; column < model->columnCount(index); ++column) {
        QModelIndex child = model->index(0, column, index);
        model->setData(child, QVariant("[No data]"), Qt::EditRole);
        if (!model->headerData(column, Qt::Horizontal).isValid())
            model->setHeaderData(column, Qt::Horizontal, QVariant("[No header]"),
                                 Qt::EditRole);
    }

    view->selectionModel()->setCurrentIndex(model->index(0, 0, index),
                                            QItemSelectionModel::ClearAndSelect);
    updateActions();
}
Пример #2
0
QModelIndex TreeViewFind::prevIndex(const QModelIndex &idx, bool *wrapped) const
{
    if (wrapped)
        *wrapped = false;
    QModelIndex current = idx;
    bool checkForChildren = true;
    QAbstractItemModel *model = d->m_view->model();
    if (current.isValid()) {
        int row = current.row();
        int column = current.column();
        if (column > 0) {
            current = model->index(row, column - 1, current.parent());
        } else {
            if (row > 0) {
                current = model->index(row - 1, model->columnCount(current.parent()) - 1,
                                       current.parent());
            } else {
                current = current.parent();
                checkForChildren = !current.isValid();
                if (checkForChildren && wrapped) {
                    // we start from the end
                    *wrapped = true;
                }
            }
        }
    }
    if (checkForChildren) {
        // traverse down the hierarchy
        while (int rc = model->rowCount(current)) {
            current = model->index(rc - 1, model->columnCount(current) - 1, current);
        }
    }
    return current;
}
Пример #3
0
void MetaEditor::insertRow(QString code, QString contents)
{
    QModelIndex index = view->selectionModel()->currentIndex();
    QAbstractItemModel *model = view->model();

    // force all row insertions to be children of the root item
    while(index.parent() != QModelIndex()) {
        index = index.parent();
    }

    if (!model->insertRow(index.row()+1, index.parent()))
        return;


    updateActions();

    QModelIndex child = model->index(index.row()+1, 0, index.parent());
    model->setData(child, QVariant(code), Qt::EditRole);
    for (int column = 1; column < model->columnCount(index.parent()); ++column) {
        QModelIndex nchild = model->index(index.row()+1, column, index.parent());
        if (!contents.isEmpty()) {
            model->setData(nchild, QVariant(contents), Qt::EditRole);
        } else {
            model->setData(nchild, QVariant(tr("[Your value here]")), Qt::EditRole);
        }
    }

    // force newly inserted row to be the currently selected item so that any
    // follow-on insertChild calls use this as their parent.
    view->selectionModel()->setCurrentIndex(child, QItemSelectionModel::ClearAndSelect);
    updateActions();
}
Пример #4
0
void ResultsOutput::copy()
{
  if (DEBUG)
    qDebug("ResultsOutput::copy() entered");

  QClipboard *clipboard = QApplication::clipboard();
  QAbstractItemModel *model = _table->model();
  QByteArray  bytes;
  for (int i = 0; i < model->rowCount(); i++)
  {
    for (int j = 0; j < model->columnCount(); j++)
    {
      if (j)
        bytes += ",";
      bytes += "\"" +
              model->data(model->index(i, j)).toString().replace("\"", "\"\"") +
              "\"";
    }
    bytes += "\n";
  }
  clipboard->setText(bytes);

  if (DEBUG)
    qDebug("ResultsOutput::copy() returning with bytes %s", bytes.data());
}
Пример #5
0
bool KTreeViewSearchLine::itemMatches( const QModelIndex &parentIndex, int row, const QString &pattern ) const
{
  if ( pattern.isEmpty() )
    return true;

  if ( !parentIndex.isValid() && parentIndex != d->treeView->rootIndex() )
    return false;

  // Contruct a regular expression object with the right options.
  QRegExp expression = QRegExp( pattern,
      d->caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive,
      d->regularExpression ? QRegExp::RegExp : QRegExp::FixedString );

  // If the search column list is populated, search just the columns
  // specifified.  If it is empty default to searching all of the columns.

  QAbstractItemModel *model = d->treeView->model();
  const int columncount = model->columnCount( parentIndex );
  for ( int i = 0; i < columncount; ++i) {
    if ( expression.indexIn( model->data( model->index( row, i, parentIndex ), Qt::DisplayRole ).toString() ) >= 0 )
      return true;
  }

  return false;
}
Пример #6
0
QModelIndex TreeViewFind::prevIndex(const QModelIndex &idx, bool *wrapped) const
{
    if (wrapped)
        *wrapped = false;
    QAbstractItemModel *model = d->m_view->model();
    // if same parent has earlier columns, just move there
    if (idx.column() > 0)
        return model->index(idx.row(), idx.column() - 1, idx.parent());

    QModelIndex current = idx;
    bool checkForChildren = true;
    if (current.isValid()) {
        int row = current.row();
        if (row > 0) {
            current = model->index(row - 1, 0, current.parent());
        } else {
            current = current.parent();
            checkForChildren = !current.isValid();
            if (checkForChildren && wrapped) {
                // we start from the end
                *wrapped = true;
            }
        }
    }
    if (checkForChildren) {
        // traverse down the hierarchy
        while (int rc = model->rowCount(current)) {
            current = model->index(rc - 1, 0, current);
        }
    }
    // set to last column
    current = model->index(current.row(), model->columnCount(current.parent()) - 1, current.parent());
    return current;
}
Пример #7
0
void WulforUtil::headerMenu(QTreeView *tree){
    if (!tree || !tree->model() || !tree->header())
        return;

    QMenu * mcols = new QMenu(nullptr);
    QAbstractItemModel *model = tree->model();
    QAction * column;

    int count = 0;
    for (int i = 0; i < model->columnCount(); ++i)
        count += tree->header()->isSectionHidden(tree->header()->logicalIndex(i))? 0 : 1;

    bool allowDisable = count > 1;
    int index;

    for (int i = 0; i < model->columnCount(); ++i) {
        index = tree->header()->logicalIndex(i);
        column = mcols->addAction(model->headerData(index, Qt::Horizontal).toString());
        column->setCheckable(true);

        bool checked = !tree->header()->isSectionHidden(index);

        column->setChecked(checked);
        column->setData(index);

        if (checked && !allowDisable)
            column->setEnabled(false);
    }

    QAction * chosen = mcols->exec(QCursor::pos());

    if (chosen) {
        index = chosen->data().toInt();

        if (tree->header()->isSectionHidden(index)) {
            tree->header()->showSection(index);
        } else {
            tree->header()->hideSection(index);
        }
    }

    delete mcols;
}
Пример #8
0
void GroupItem::recalculateGroupValues( const QModelIndex & self )
{
	QAbstractItemModel * model = const_cast<QAbstractItemModel*>(self.model());
	for( int i = model->columnCount(self) - 1; i >= 0; --i ) {
		QModelIndex ci = self.sibling(self.row(),i);
		QString val = calculateGroupValue( self, i );
		if( !val.isEmpty() )
			setModelData( ci, val, Qt::DisplayRole );
	}
}
Пример #9
0
int Utils::ModelListModel::columnCount(const QModelIndex& parent) const
{
	Utils::ModelListModel::SubModelIndex smi = mapToSource(parent);
	if (smi.first == m_metaModel && smi.second.isValid())
	{
		QAbstractItemModel* subModel = m_subModels.value(smi.second.row());
		if (subModel)
			return subModel->columnCount();
	}
	return smi.first->columnCount(smi.second);
}
Пример #10
0
void MetaEditor::insertChild(QString code, QString contents)
{
    QModelIndex index = view->selectionModel()->currentIndex();
    QAbstractItemModel *model = view->model();

    // restrict children to be a grandchild of the root item
    // and make sure you are in column 0 when inserting a child
    if (index.parent() != QModelIndex()) {
        index = index.parent();
    }
    int row = index.row();
    index = index.sibling(row,0);

    if (model->columnCount(index) == 0) {
        if (!model->insertColumn(0, index))
            return;
    }

    if (!model->insertRow(0, index))
        return;

    QModelIndex child = model->index(0, 0, index);
    model->setData(child, QVariant(code), Qt::EditRole);
    for (int column = 1; column < model->columnCount(index); ++column) {
        QModelIndex child = model->index(0, column, index);
        if (!contents.isEmpty()) {
            model->setData(child, QVariant(contents), Qt::EditRole);
        } else {
            model->setData(child, QVariant(tr("[Place value here]")), Qt::EditRole);
        }
        if (!model->headerData(column, Qt::Horizontal).isValid())
            model->setHeaderData(column, Qt::Horizontal, QVariant("[No header]"), Qt::EditRole);
    }

    view->selectionModel()->setCurrentIndex(model->index(0, 0, index),
                                            QItemSelectionModel::ClearAndSelect);
    updateActions();
}
Пример #11
0
void BuildConfigDialog::resizeTableView(QTableView *tableView)
{
    QAbstractItemModel *model = tableView->model();
    if (model && model->columnCount() >= 2) {
        tableView->resizeColumnToContents(0);
#if QT_VERSION >= 0x050000
        tableView->horizontalHeader()->setSectionResizeMode(0,QHeaderView::Interactive);
        tableView->horizontalHeader()->setSectionResizeMode(1,QHeaderView::Stretch);
#else
        tableView->horizontalHeader()->setResizeMode(0,QHeaderView::Interactive);
        tableView->horizontalHeader()->setResizeMode(1,QHeaderView::Stretch);
#endif
    }
}
Пример #12
0
    void ICatInvestigation::onSelectAllFiles()
    {
      QItemSelectionModel* selectionModel = m_uiForm.invsttableWidget->selectionModel();
      QAbstractItemModel *model = m_uiForm.invsttableWidget->model();
      int rowCount = model->rowCount();
      int colCount = model->columnCount();

      QModelIndex topLeft = model->index(0,0,QModelIndex());
      QModelIndex bottomRight = model->index(rowCount-1,colCount-1,QModelIndex());

      QItemSelection selection(topLeft, bottomRight);
      selectionModel->select(selection, QItemSelectionModel::Select);


    }
Пример #13
0
void MainWindow::insertRow()
{
    QModelIndex index = view->selectionModel()->currentIndex();
    QAbstractItemModel *model = view->model();

    if (!model->insertRow(index.row()+1, index.parent()))
        return;

    updateActions();

    for (int column = 0; column < model->columnCount(index.parent()); ++column) {
        QModelIndex child = model->index(index.row()+1, column, index.parent());
        model->setData(child, QVariant("[No data]"), Qt::EditRole);
    }
}
Пример #14
0
void CsvTableView::updateHeaderAndFooterCache() {
  QAbstractItemModel *m = model();
  QString v;
  if (m && _columnHeaders) {
    if (_rowHeaders)
      v.append(_topLeftHeader).append(_fieldSeparator);
    int columns = m->columnCount(QModelIndex());
    for (int i = 0; i < columns; ++i) {
      v.append(formatField(m->headerData(i, Qt::Horizontal).toString()));
      if (i < columns-1)
        v.append(_fieldSeparator);
    }
    v.append(_recordSeparator);
  }
  _tableHeader = v;
}
Пример #15
0
QModelIndex ItemViewFind::nextIndex(const QModelIndex &idx, bool *wrapped) const
{
    if (wrapped)
        *wrapped = false;
    QAbstractItemModel *model = d->m_view->model();
    // pathological
    if (!idx.isValid())
        return model->index(0, 0);

    // same parent has more columns, go to next column
    if (idx.column() + 1 < model->columnCount(idx.parent()))
        return model->index(idx.row(), idx.column() + 1, idx.parent());

    // tree views have their children attached to first column
    // make sure we are at first column
    QModelIndex current = model->index(idx.row(), 0, idx.parent());

    // check for children
    if (d->m_option == FetchMoreWhileSearching && model->canFetchMore(current))
        model->fetchMore(current);
    if (model->rowCount(current) > 0)
        return current.child(0, 0);

    // no more children, go up and look for parent with more children
    QModelIndex nextIndex;
    while (!nextIndex.isValid()) {
        int row = current.row();
        current = current.parent();

        if (d->m_option == FetchMoreWhileSearching && model->canFetchMore(current))
            model->fetchMore(current);
        if (row + 1 < model->rowCount(current)) {
            // Same parent has another child
            nextIndex = model->index(row + 1, 0, current);
        } else {
            // go up one parent
            if (!current.isValid()) {
                // we start from the beginning
                if (wrapped)
                    *wrapped = true;
                nextIndex = model->index(0, 0);
            }
        }
    }
    return nextIndex;
}
Пример #16
0
void GPUCommandListWidget::CopyAllToClipboard() {
    QClipboard* clipboard = QApplication::clipboard();
    QString text;

    QAbstractItemModel* model = static_cast<QAbstractItemModel*>(list_widget->model());

    for (int row = 0; row < model->rowCount({}); ++row) {
        for (int col = 0; col < model->columnCount({}); ++col) {
            QModelIndex index = model->index(row, col);
            text += model->data(index).value<QString>();
            text += '\t';
        }
        text += '\n';
    }

    clipboard->setText(text);
}
Пример #17
0
void TableEditorDialog::slotInsertColumnPressed()
{
    Q_ASSERT( m_tableView->model() );
    
    QAbstractItemModel *model = m_tableView->model();
    QModelIndex         currIndex = m_tableView->currentIndex();

    int selectedColumn;
    if ( model->columnCount() == 0 )
        // +1 is added below.
        selectedColumn = -1;
    if ( currIndex.isValid() )
        selectedColumn = currIndex.column();
    else
        selectedColumn = m_tableView->model()->columnCount() - 1;

    // Insert the column *after* the selection, thus +1
    model->insertColumn( selectedColumn + 1 );
}
Пример #18
0
void ItemViewSettup::setDefault()
{
    kDebug(planDbg());
    selector->availableListWidget()->clear();
    selector->selectedListWidget()->clear();
    QAbstractItemModel *model = m_view->model();
    int c = m_includeColumn0 ? 0 : 1;
    QList<int> def = m_view->defaultColumns();
    for ( ; c < model->columnCount(); ++c ) {
        if ( ! def.contains( c ) ) {
            Item *item = new Item( c, model->headerData( c, Qt::Horizontal ).toString() );
            item->setToolTip( model->headerData( c, Qt::Horizontal, Qt::ToolTipRole ).toString() );
            selector->availableListWidget()->addItem( item );
        }
    }
    foreach ( int i, def ) {
        Item *item = new Item( i, model->headerData( i, Qt::Horizontal ).toString() );
        item->setToolTip( model->headerData( i, Qt::Horizontal, Qt::ToolTipRole ).toString() );
        selector->selectedListWidget()->addItem( item );
    }
Пример #19
0
QModelIndex TreeViewFind::nextIndex(const QModelIndex &idx, bool *wrapped) const
{
    if (wrapped)
        *wrapped = false;
    QAbstractItemModel *model = d->m_view->model();
    // pathological
    if (!idx.isValid())
        return model->index(0, 0);


    if (model->rowCount(idx) > 0) {
        // node with children
        return idx.child(0, 0);
    }
    // leaf node
    QModelIndex nextIndex;
    QModelIndex current = idx;
    while (!nextIndex.isValid()) {
        int row = current.row();
        int column = current.column();
        current = current.parent();

        if (column + 1 < model->columnCount(current)) {
            nextIndex = model->index(row, column + 1, current);
        } else {
            if (row + 1 < model->rowCount(current)) {
                // Same parent has another child
                nextIndex = model->index(row + 1, 0, current);
            } else {
                // go up one parent
                if (!current.isValid()) {
                    // we start from the beginning
                    if (wrapped)
                        *wrapped = true;
                    nextIndex = model->index(0, 0);
                }
            }
        }
    }
    return nextIndex;
}
QVariantMap RemoteControl::get_switchboard_infos()
{
    QVariantMap args;

    Directory *xlet = this->get_xlet<Directory>("directory");
    QAbstractItemModel *model = xlet->ui.entry_table->model();

    QVariantList content;

    int nb_rows = model->rowCount();
    int nb_cols = model->columnCount();
    for (int row = 0; row < nb_rows; row++) {
        QVariantMap header_value;
        for (int col = 0; col < nb_cols; col++) {
            header_value[getHeaderValueInModel(model, col)] = getValueInModel(model, row, col);
        }
        content.append(header_value);
    }
    args["content"] = content;

    return args;
}
void FolderManager::runCommand(const QString &name)
{
  qDebug() << "FolderManager::runCommand()" << name;

  FolderView *sourceView = currentFolderView(m_active_side);
  FolderView *targetView = currentFolderView((m_active_side == LeftSide) ? RightSide : LeftSide);

  if (! sourceView) {
    qDebug() << "no source view";
    return;
  }

  if (name == "parent") {
    QDir dir(sourceView->fileSystemModel()->rootPath());
    dir.cdUp();
    sourceView->navigateToPath(dir.absolutePath());
  }
  else if (name == "select-all") {
    sourceView->selectAll();
  }
  else if (name == "select-none") {
    sourceView->clearSelection();
  }
  else if (name == "invert-selection") {
    QItemSelectionModel *selectionModel  = sourceView->selectionModel();
    selectionModel->select(selectionModel->selection(), QItemSelectionModel::Toggle);

#if 0
    QAbstractItemModel  *model        = sourceView->model();
    QModelIndex          topLeft      = model->index(0, 0);
    QModelIndex          bottomRight  = model->index(model->rowCount(parent)-1,
                                                     model->columnCount(parent)-1);
    QItemSelection selection(topLeft, bottomRight);
    selectionModel->select(selection, QItemSelectionModel::Toggle);
#endif
  }
}
Пример #22
0
void
setSymbolicColumnNames(QAbstractItemModel &model,
                       QStringList const &names) {
    for (auto column = 0, numColumns = std::min(model.columnCount(), names.count()); column < numColumns; ++column)
        model.setHeaderData(column, Qt::Horizontal, names[column], Util::SymbolicNameRole);
}
Пример #23
0
QDomElement OOoReportBuilder::processDetail(const QDomElement &rowDetail)
{
    QDomElement lastElement = rowDetail;

    if (rowDetail.isNull() || reportBand(rowDetail) != Detail)
        return QDomElement();

    QString textCell = cellText(rowDetail.firstChild().toElement());
    textCell.remove(QRegExp("\\{|\\}|detail"));
    int modelId = textCell.toInt() - 1;

    if (modelId < m_models.count() - 1) {
        rowDetail.parentNode().removeChild(rowDetail);
        return lastElement.previousSibling().toElement();
    }

    QAbstractItemModel *model = m_models.at(modelId);

    for (int i = 0; i < model->rowCount(); i++) {
        QDomElement tmpRow = rowDetail.cloneNode(true).toElement();

        QDomElement cell = tmpRow.firstChild().toElement();
        cell = cell.nextSibling().toElement();

        while (!cell.isNull()) {
            QString str = cellText(cell);

            if (!str.isEmpty()) {
                str.remove(QRegExp("\\{|\\}"));

                if (!QString::compare(str,"rowno",Qt::CaseInsensitive)) {
                    setText(cell,QString::number(i));
                } else if (str[0] == 'P') {

                    QVariant var = processParams(str.mid(2));
                    if (var.type() == QVariant::Double) {
                        setText(cell,var.toDouble());
                    } else {
                        setText(cell,var.toString());
                    }
                } else {
                    QRegExp rx("col\\d{1,2}");

                    if (rx.indexIn(str) == 0) {
                        int colNo = str.remove(QRegExp("col")).toInt();
                        QVariant var = model->data(model->index(i,colNo));
                        if (colNo <= model->columnCount() - 1) {
                            if (var.type() == QVariant::Double) {
                                setText(cell, var.toDouble());
                            } else
                                setText(cell, var.toString());
                        } else
                            setText(cell,"Err");
                    } else
                        setText(cell,str);
                }
            }

            if (cell.attributes().contains("table:formula")) {
                QString formula = processFormula(cell.attribute("table:formula"), i);
                cell.setAttribute("table:formula",formula);
            }

            cell = cell.nextSibling().toElement();
        }

        lastElement = rowDetail.parentNode().insertBefore(tmpRow,rowDetail).toElement();
    }

    rowDetail.parentNode().removeChild(rowDetail);
    return lastElement;
}
Пример #24
0
void RDHeaderView::cacheSections()
{
  if(m_suppressSectionCache)
    return;

  QAbstractItemModel *m = this->model();

  int oldCount = m_sections.count();
  m_sections.resize(m->columnCount());

  // give new sections a default minimum size
  for(int col = oldCount; col < m_sections.count(); col++)
    m_sections[col].size = 10;

  for(int col = 0; col < m_sections.count(); col++)
  {
    if(m_columnGroupRole > 0)
    {
      QVariant v = m->data(m->index(0, col), m_columnGroupRole);
      if(v.isValid())
        m_sections[col].group = v.toInt();
      else
        m_sections[col].group = -m_columnGroupRole - col;

      if(col > 0)
      {
        m_sections[col - 1].groupGap =
            (m_sections[col].group != m_sections[col - 1].group) && m_sections[col].group >= 0;
      }
    }
    else
    {
      m_sections[col].group = col;
      m_sections[col].groupGap = true;
    }
  }

  int accum = 0;

  for(int col = 0; col < m_sections.count(); col++)
  {
    if(col == m_pinnedColumns)
      m_pinnedWidth = accum;

    m_sections[col].offset = accum;
    accum += m_sections[col].size;

    if(hasGroupGap(col))
      accum += groupGapSize();
  }

  if(m_pinnedColumns >= m_sections.count())
    m_pinnedWidth = m_pinnedColumns;

  QStyleOptionHeader opt;
  initStyleOption(&opt);

  QFont f = font();
  f.setBold(true);

  opt.section = 0;
  opt.fontMetrics = QFontMetrics(f);
  opt.text = m->headerData(0, orientation(), Qt::DisplayRole).toString();

  m_sizeHint = style()->sizeFromContents(QStyle::CT_HeaderSection, &opt, QSize(), this);
  m_sizeHint.setWidth(accum);

  viewport()->update(viewport()->rect());
}
Пример #25
0
QString m_savemanager::timelineToXml(v_timeline * timeline){

    QString ret = "<timeline>\n";
    //sauvegarde du log des bouton (il n'y a que des indices)
    ret+="<logButton>\n";
    for(int i=0;i<timeline->getModeleTimeline()->getLogClickedButton()->size();i++){

        for(int j=0;j<timeline->getModeleTimeline()->getframesTimeLine()->size();j++){

            if(timeline->getModeleTimeline()->getLogClickedButton()->at(i) == timeline->getModeleTimeline()->getframesTimeLine()->at(j)){

                ret+="<button>";
                ret+=QString::number(j);
                ret+="</button>";
            }
        }
    }
    ret+="<logButton>\n";

    ret+="<listPushButton>";
    for(int i=0;i<timeline->getModeleTimeline()->getframesTimeLine()->size();i++){


        ret+="<button>";
        ret+=QString::number(i);
        ret+="</button>";

    }
    ret+="</listPushButton>\n";

    ret+="<listDelButtonPushButton>";
    ret+="</listDelButtonPushButton>\n";

    ret+="<lignesCourantesEditeur>";
    for(int i=0;i<timeline->getModeleTimeline()->getCurrentLines()->size();i++){
        ret+="<line>";
        ret+=QString::number(timeline->getModeleTimeline()->getCurrentLines()->at(i));
        ret+="</line>";
    }
    ret+="</lignesCourantesEditeur>\n";

    ret+="<lignesSimpleTable>";
    for(int i=0;i<timeline->getModeleTimeline()->getBottomLineEditData()->size();i++){
        ret+="<line>";
        QString  valueWithoutUnexpectedChar = *(timeline->getModeleTimeline()->getBottomLineEditData()->at(i));
        valueWithoutUnexpectedChar = valueWithoutUnexpectedChar.replace("-","&#45;");
        valueWithoutUnexpectedChar = valueWithoutUnexpectedChar.replace("<","&lt;");
        valueWithoutUnexpectedChar = valueWithoutUnexpectedChar.replace(">","&gt;");
        valueWithoutUnexpectedChar = valueWithoutUnexpectedChar.replace("\"","&quot;");
        valueWithoutUnexpectedChar = valueWithoutUnexpectedChar.replace("\'","&apos;");
        valueWithoutUnexpectedChar = valueWithoutUnexpectedChar.replace("&","&amp;");
        ret+= valueWithoutUnexpectedChar;
        ret+="</line>";
    }
    ret+="</lignesSimpleTable>\n";

    ret+="<listeItemTable>\n";
    for(int i=0;i<timeline->getModeleTimeline()->getTableViewModelData()->size();i++){
        ret+="<frame>\n";
        QAbstractItemModel * currentmodel = timeline->getModeleTimeline()->getTableViewModelData()->at(i);
        ret+="<x>"+QString::number(currentmodel->columnCount())+"</x>"; //combien il y a de colonnes
        ret+="<y>"+QString::number(currentmodel->rowCount())+"</y>"; //combien il y a de lignes
        ret+="<lines>";
        for(int j=0;j<currentmodel->columnCount();j++){
            ret+="<line>";
            for(int k =0;k<currentmodel->rowCount();k++){

                ret+="<case>";
                    QString valueWithoutUnexpectedChar = currentmodel->index(k,j).data(Qt::DisplayRole).toString();
                    valueWithoutUnexpectedChar = valueWithoutUnexpectedChar.replace("<","&lt;");
                    valueWithoutUnexpectedChar = valueWithoutUnexpectedChar.replace(">","&gt;");
                    valueWithoutUnexpectedChar = valueWithoutUnexpectedChar.replace("\"","&quot;");
                    valueWithoutUnexpectedChar = valueWithoutUnexpectedChar.replace("\'","&apos;");
                    valueWithoutUnexpectedChar = valueWithoutUnexpectedChar.replace("&","&amp;");
                    ret+= valueWithoutUnexpectedChar;
                ret+="</case>";
            }
            ret+="</line>";
        }
        ret+="</lines>";
        ret+="</frame>\n";
    }
    ret+="</listeItemTable>\n";

    ret+="<nodesGraph>";
    for(int i=0;i<timeline->getModeleTimeline()->getNodeGraphData()->size();i++){
        ret+="<frame>\n";

        std::vector<QString> *currentFrame = timeline->getModeleTimeline()->getNodeGraphData()->at(i);
        for(int j=0;j<currentFrame->size();j++){

            ret+="<color>";
            ret+=currentFrame->at(j);
            ret+="</color>\n";
        }

        ret+="</frame>\n";
    }
    ret+="</nodesGraph>\n";

    ret+="<transitionsGraph>";
    for(int i=0;i<timeline->getModeleTimeline()->getTransitionGraphData()->size();i++){
        ret+="<frame>\n";

        std::vector<QString> * currentFrame = timeline->getModeleTimeline()->getTransitionGraphData()->at(i);
        for(int j=0;j<currentFrame->size();j++){

            ret+="<color>";
            ret+=currentFrame->at(j);
            ret+="</color>\n";
        }

        ret+="</frame>\n";
    }
    ret+="</transitionsGraph>\n";


    ret +="</timeline>\n";
    return ret;
}