Mercurial > retraceit
comparison src/libqxt/qxtcsvmodel.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 | 7a2637c3eb83 |
children | 0c05958d254c |
comparison
equal
deleted
inserted
replaced
16:6d5dd3ae2ad3 | 17:73efe717b944 |
---|---|
263 \reimp | 263 \reimp |
264 */ | 264 */ |
265 bool QxtCsvModel::setHeaderData(int section, Qt::Orientation orientation, const QVariant& value, int role) | 265 bool QxtCsvModel::setHeaderData(int section, Qt::Orientation orientation, const QVariant& value, int role) |
266 { | 266 { |
267 if(orientation != Qt::Horizontal) return false; // We don't support the vertical header | 267 if(orientation != Qt::Horizontal) return false; // We don't support the vertical header |
268 if(role != Qt::DisplayRole || role != Qt::EditRole) return false; // We don't support any other roles | 268 if(role != Qt::DisplayRole && role != Qt::EditRole) return false; // We don't support any other roles |
269 if(section < 0) return false; // Bogus input | 269 if(section < 0) return false; // Bogus input |
270 while(section > qxt_d().header.size()) { | 270 while(section > qxt_d().header.size()) { |
271 qxt_d().header << QString(); | 271 qxt_d().header << QString(); |
272 } | 272 } |
273 qxt_d().header[section] = value.toString(); | 273 qxt_d().header[section] = value.toString(); |