Mercurial > retraceit
comparison src/metadataview.cpp @ 89:b8c7644a9d49
Add config settings to hide specific columns
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 19 Jun 2015 14:27:15 +0200 |
parents | 3916cb3c9105 |
children |
comparison
equal
deleted
inserted
replaced
88:3916cb3c9105 | 89:b8c7644a9d49 |
---|---|
93 return tr("Failed to parse file: '%1'").arg(filePath); | 93 return tr("Failed to parse file: '%1'").arg(filePath); |
94 } | 94 } |
95 | 95 |
96 mSortModel->setSourceModel(mCSVModel); | 96 mSortModel->setSourceModel(mCSVModel); |
97 qDebug() << "Parsed: " << mCSVModel->rowCount() << " rows."; | 97 qDebug() << "Parsed: " << mCSVModel->rowCount() << " rows."; |
98 mFilterWidget->headersChanged(); | |
99 hideCols(); | |
98 applyDefaultSort(); | 100 applyDefaultSort(); |
99 resizeColsToHeaders(); | 101 resizeColsToHeaders(); |
100 | 102 |
101 QSettings settings; | 103 QSettings settings; |
102 const QString displayDate = settings.value(DATE_COLUMN_KEY, DATE_COLUMN_DEFAULT).toString(); | 104 const QString displayDate = settings.value(DATE_COLUMN_KEY, DATE_COLUMN_DEFAULT).toString(); |
267 if (!mSortModel->setHeaderData(i, Qt::Horizontal, toolTip, Qt::ToolTipRole)) { | 269 if (!mSortModel->setHeaderData(i, Qt::Horizontal, toolTip, Qt::ToolTipRole)) { |
268 qDebug() << "Failed to set header data"; | 270 qDebug() << "Failed to set header data"; |
269 } | 271 } |
270 } | 272 } |
271 } | 273 } |
274 | |
275 void MetaDataView::hideCols() { | |
276 QSettings settings; | |
277 settings.beginGroup(HIDE_CONFIG_GROUP); | |
278 for (int i=0; i < mSortModel->columnCount(); i++) { | |
279 QString entry = mSortModel->headerData(i, Qt::Horizontal).toString(); | |
280 bool hidden = settings.value(entry, false).toBool(); | |
281 settings.setValue(entry, hidden); | |
282 mView->setColumnHidden(i, hidden); | |
283 } | |
284 } |