src/job_editor_widget/jobpropertywidget.cpp

Go to the documentation of this file.
00001 
00002 
00003 #include <QTreeWidgetItem>
00004 #include <QDebug>
00005 
00006 #include "jobpropertywidget.h"
00007 
00008 JobPropertyWidget::JobPropertyWidget(QWidget *parent) : QTreeWidget(parent)
00009 {
00010     QTreeWidgetItem * item;
00011     QStringList labels;
00012     labels << "Variable" << "Valeur";
00013     setHeaderLabels(labels);
00014     setColumnCount(2);
00015 
00016     //walltime
00017     item = new QTreeWidgetItem(this);
00018     item->setText(0,"WallTime");
00019     item->setFlags(item->flags() | Qt::ItemIsEditable);
00020     qDebug() << SIGNAL(dataChanged(const QModelIndex &,const QModelIndex &));
00021     qDebug() << SLOT(onDataChanged(const QModelIndex &,const QModelIndex &));
00022     connect(item, SIGNAL(dataChanged(const QModelIndex &,const QModelIndex &)),
00023             this, SLOT(onDataChanged(const QModelIndex &,const QModelIndex &)));
00024     addTopLevelItem(item);
00025 
00026     //nodes
00027     item = new QTreeWidgetItem(this);
00028     item->setText(0,"Node");
00029     addTopLevelItem(item);
00030 }
00031 
00032 
00033 void JobPropertyWidget::onDataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight)
00034 {
00035     qDebug("data changed");
00036 }
00037 
00038 
00039 void JobPropertyWidget::setWalltime(const QString & walltime)
00040 {
00041     QTreeWidgetItem* item = itemAt(QPoint(1,1));
00042     //item->setText(1,walltime);
00043     item->setData(1,Qt::EditRole, QVariant(walltime));
00044 }
00045 
00046 void JobPropertyWidget::setNodes(const QString & nodes)
00047 {
00048 }

Generated on Mon Mar 16 18:46:05 2009 for QCJM by  doxygen 1.5.4