comparison src/metadataview.cpp @ 81:5923d569167b

Make Header tooltips configurable
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 18 Jun 2015 17:48:28 +0200
parents 016cbcb1a233
children 9a03703622b8
comparison
equal deleted inserted replaced
80:d6f3a31e505e 81:5923d569167b
107 } 107 }
108 if (mDateColIdx == -1) { 108 if (mDateColIdx == -1) {
109 qDebug() << "Failed to find displayDate column: " << displayDate; 109 qDebug() << "Failed to find displayDate column: " << displayDate;
110 mDateColIdx = DATE_COLUMN_FALLBACK_IDX; 110 mDateColIdx = DATE_COLUMN_FALLBACK_IDX;
111 } 111 }
112 setupHeaderTooltips();
112 return QString(); 113 return QString();
113 } 114 }
114 115
115 void MetaDataView::dataChanged() 116 void MetaDataView::dataChanged()
116 { 117 {
247 mView->horizontalHeader()->resizeSection(i, w); 248 mView->horizontalHeader()->resizeSection(i, w);
248 qDebug() << "Resizing " << i << " to: " << w; 249 qDebug() << "Resizing " << i << " to: " << w;
249 } 250 }
250 } 251 }
251 } 252 }
253
254 void MetaDataView::setupHeaderTooltips() {
255 QSettings settings;
256 settings.beginGroup(TOOLTIP_CONFIG_GROUP);
257 for (int i=0; i < mSortModel->columnCount(); i++) {
258 QString entry = mSortModel->headerData(i, Qt::Horizontal).toString();
259 QString toolTip = settings.value(entry).toString();
260 settings.setValue(entry, toolTip);
261 if (!mSortModel->setHeaderData(i, Qt::Horizontal, toolTip, Qt::ToolTipRole)) {
262 qDebug() << "Failed to set header data";
263 }
264 }
265 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)