From 3e51476d8757752ccfa908d54b4f2425d908c839 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 22 May 2013 14:25:37 -0300 Subject: Removed unused debug, and set the correct data on the delegates. Signed-off-by: Tomaz Canabrava --- qt-ui/modeldelegates.cpp | 1 - qt-ui/models.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index 0164deedc..c05e59ea8 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -54,7 +54,6 @@ QWidget* TankInfoDelegate::createEditor(QWidget* parent, const QStyleOptionViewI QComboBox *comboDelegate = new QComboBox(parent); TankInfoModel *model = new TankInfoModel; QString data = index.model()->data(index, Qt::DisplayRole).toString(); - qDebug() << "Tentando pegar " << data; comboDelegate->setModel(model); int i; for(i = 0; i < model->rowCount(); i++){ diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 360058dfd..78763d11b 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -66,7 +66,7 @@ QVariant CylindersModel::data(const QModelIndex& index, int role) const cylinder_t *cyl = ¤t->cylinder[index.row()]; - if (role == Qt::DisplayRole) { + if (role == Qt::DisplayRole || role==Qt::EditRole) { switch(index.column()) { case TYPE: ret = QString(cyl->type.description); @@ -261,7 +261,7 @@ QVariant WeightModel::data(const QModelIndex& index, int role) const weightsystem_t *ws = ¤t_dive->weightsystem[index.row()]; - if (role == Qt::DisplayRole) { + if (role == Qt::DisplayRole || role == Qt::EditRole) { switch(index.column()) { case TYPE: ret = QString(ws->description); -- cgit v1.2.3-70-g09d2