summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Colberg <peter@colberg.org>2015-12-30 22:46:53 -0500
committerPeter Colberg <peter@colberg.org>2015-12-30 22:46:53 -0500
commitc0d7e4ae89989d9882152cca4e539dec01d23f13 (patch)
tree58511dfd68e2b812b9da7cd76f144a40fbe9ee67
parent420f9b5fcffe2da63613ac8595a96831d952f5eb (diff)
downloadtwinkle-c0d7e4ae89989d9882152cca4e539dec01d23f13.tar
twinkle-c0d7e4ae89989d9882152cca4e539dec01d23f13.tar.gz
twinkle-c0d7e4ae89989d9882152cca4e539dec01d23f13.tar.lz
twinkle-c0d7e4ae89989d9882152cca4e539dec01d23f13.tar.xz
twinkle-c0d7e4ae89989d9882152cca4e539dec01d23f13.zip
historyform: Resize columns to contents
Automatically resize columns based on entry text widths.
-rw-r--r--src/gui/historyform.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/historyform.cpp b/src/gui/historyform.cpp
index e836d73..1466110 100644
--- a/src/gui/historyform.cpp
+++ b/src/gui/historyform.cpp
@@ -79,8 +79,11 @@ void HistoryForm::init()
m_model->setHorizontalHeaderLabels(QStringList() << tr("Time") << tr("In/Out") << tr("From/To") << tr("Subject") << tr("Status"));
historyListView->horizontalHeader()->setSortIndicator(HISTCOL_TIMESTAMP, Qt::DescendingOrder);
- historyListView->setColumnWidth(HISTCOL_FROMTO, 200);
- historyListView->setColumnWidth(HISTCOL_SUBJECT, 200);
+#if QT_VERSION >= 0x050000
+ historyListView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
+#else
+ historyListView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
+#endif
inCheckBox->setChecked(true);
outCheckBox->setChecked(true);