comparison widgets/CSVFormatDialog.cpp @ 674:d8bd193ad17d

Abbreviate very long text elements in csv file format dialog
author Chris Cannam
date Mon, 04 Nov 2013 15:48:05 +0000
parents c9d6cf9c51c8
children 1a0dfcbffaf1
comparison
equal deleted inserted replaced
673:b5d3dea6d869 674:d8bd193ad17d
15 15
16 #include "CSVFormatDialog.h" 16 #include "CSVFormatDialog.h"
17 17
18 #include "layer/LayerFactory.h" 18 #include "layer/LayerFactory.h"
19 19
20 #include "TextAbbrev.h"
21
20 #include <QFrame> 22 #include <QFrame>
21 #include <QGridLayout> 23 #include <QGridLayout>
22 #include <QPushButton> 24 #include <QPushButton>
23 #include <QHBoxLayout> 25 #include <QHBoxLayout>
24 #include <QVBoxLayout> 26 #include <QVBoxLayout>
94 cpc->setCurrentIndex(int(m_format.getColumnPurpose(i))); 96 cpc->setCurrentIndex(int(m_format.getColumnPurpose(i)));
95 97
96 for (int j = 0; j < example.size() && j < 6; ++j) { 98 for (int j = 0; j < example.size() && j < 6; ++j) {
97 QLabel *label = new QLabel; 99 QLabel *label = new QLabel;
98 label->setTextFormat(Qt::PlainText); 100 label->setTextFormat(Qt::PlainText);
99 label->setText(example[j][i]); 101 QString text = TextAbbrev::abbreviate(example[j][i], 35);
102 label->setText(text);
100 label->setFont(fp); 103 label->setFont(fp);
101 label->setPalette(palette); 104 label->setPalette(palette);
102 label->setIndent(8); 105 label->setIndent(8);
103 exampleLayout->addWidget(label, j+1, i); 106 exampleLayout->addWidget(label, j+1, i);
104 } 107 }