1 #include "historywindow.h"
3 HistoryWindow::HistoryWindow (QWidget *parent):QDialog (parent)
6 ui.historyTable->setRowCount (20);
7 ui.historyTable->setColumnCount (3);
10 QTableWidgetItem *item;
12 item= new QTableWidgetItem(tr("Action"));
13 ui.historyTable->setHorizontalHeaderItem(0, item);
15 item= new QTableWidgetItem(tr("Comment"));
16 ui.historyTable->setHorizontalHeaderItem(1, item);
18 item= new QTableWidgetItem(tr("Undo action"));
19 ui.historyTable->setHorizontalHeaderItem(2, item);
21 ui.historyTable->setSelectionBehavior (QAbstractItemView::SelectRows);
25 void HistoryWindow::update(SimpleSettings &set)
27 //int rows=set.readNumEntry("/history/undosTotal");
28 //ui.historyTable->setRowCount (rows);
31 for (i=0;i<= set.readNumEntry("/history/undosAvail",0); i++)
33 QTableWidgetItem *item;
35 item= new QTableWidgetItem(set.readEntry(QString("/history/step-%1/redoCommand").arg(i)));
36 ui.historyTable->setItem(i, 0, item);
38 item= new QTableWidgetItem(set.readEntry(QString("/history/step-%1/comment").arg(i)));
39 ui.historyTable->setItem(i, 1, item);
41 item=new QTableWidgetItem(set.readEntry(QString("/history/step-%1/undoCommand").arg(i)));
42 ui.historyTable->setItem(i, 2, item);
45 ui.historyTable->resizeColumnsToContents();