Mercurial > retraceit
comparison src/filterwidget.cpp @ 17:73efe717b944
Fix bug in csv model to allow changing headerdata
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 14 Apr 2015 18:55:55 +0200 |
parents | 315e6988952a |
children | e12284a222ba |
comparison
equal
deleted
inserted
replaced
16:6d5dd3ae2ad3 | 17:73efe717b944 |
---|---|
34 QString entry = newSource->headerData(i, Qt::Horizontal).toString(); | 34 QString entry = newSource->headerData(i, Qt::Horizontal).toString(); |
35 if (!entry.startsWith("#")) { | 35 if (!entry.startsWith("#")) { |
36 mCombo->addItem(entry); | 36 mCombo->addItem(entry); |
37 mColFilterMap.insert(addedItems++, i); | 37 mColFilterMap.insert(addedItems++, i); |
38 } else { | 38 } else { |
39 QString shortended = entry.remove(0,1); | 39 if (!newSource->setHeaderData(i, Qt::Horizontal, entry.remove(0,1), Qt::DisplayRole)) { |
40 // TODO this does not work as expected | 40 qDebug() << "Setting header data failed."; |
41 newSource->setHeaderData(i, Qt::Horizontal, shortended); | 41 } |
42 } | 42 } |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 void FilterWidget::filterChanged() { | 46 void FilterWidget::filterChanged() { |