mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
CSV Import UI: Prettifications, hide headers, code cleanup.
Just a few cleanups. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
11fc888cdc
commit
c4b7ed5444
2 changed files with 13 additions and 6 deletions
|
@ -204,7 +204,6 @@ ColumnNameResult::ColumnNameResult(QObject *parent) : QAbstractTableModel(parent
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColumnNameResult::swapValues(int firstIndex, int secondIndex) {
|
void ColumnNameResult::swapValues(int firstIndex, int secondIndex) {
|
||||||
qDebug() << firstIndex << secondIndex;
|
|
||||||
QString one = columnNames[firstIndex];
|
QString one = columnNames[firstIndex];
|
||||||
QString two = columnNames[secondIndex];
|
QString two = columnNames[secondIndex];
|
||||||
setData(index(0, firstIndex), QVariant(two), Qt::EditRole);
|
setData(index(0, firstIndex), QVariant(two), Qt::EditRole);
|
||||||
|
@ -304,11 +303,8 @@ void ColumnDropCSVView::mousePressEvent(QMouseEvent *press)
|
||||||
QObject *target = drag->target();
|
QObject *target = drag->target();
|
||||||
if (target->objectName() == "qt_scrollarea_viewport")
|
if (target->objectName() == "qt_scrollarea_viewport")
|
||||||
target = target->parent();
|
target = target->parent();
|
||||||
|
if (target != drag->source())
|
||||||
|
|
||||||
if (target != drag->source()) {
|
|
||||||
model()->setData(atClick, QString());
|
model()->setData(atClick, QString());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,7 +331,6 @@ DiveLogImportDialog::DiveLogImportDialog(QStringList fn, QWidget *parent) : QDia
|
||||||
ui->avaliableColumns->setItemDelegate(new TagDragDelegate(ui->avaliableColumns));
|
ui->avaliableColumns->setItemDelegate(new TagDragDelegate(ui->avaliableColumns));
|
||||||
resultModel = new ColumnNameResult(this);
|
resultModel = new ColumnNameResult(this);
|
||||||
ui->tableView->setModel(resultModel);
|
ui->tableView->setModel(resultModel);
|
||||||
|
|
||||||
loadFileContents();
|
loadFileContents();
|
||||||
|
|
||||||
/* manually import CSV file */
|
/* manually import CSV file */
|
||||||
|
|
|
@ -125,6 +125,18 @@
|
||||||
<height>200</height>
|
<height>200</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<attribute name="horizontalHeaderVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="horizontalHeaderHighlightSections">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="verticalHeaderVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="verticalHeaderHighlightSections">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue