From 194a081bd7ef2e622e49c4f24b7c2721c023812c Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Tue, 24 Aug 2010 23:06:35 +0200 Subject: [PATCH] Use a splitter between Group and Entry View. --- src/gui/DatabaseWidget.cpp | 15 ++++++++++----- src/gui/EntryView.cpp | 3 +++ src/gui/GroupView.cpp | 2 ++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index be432f105..aecd7a3d7 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -18,6 +18,7 @@ #include "DatabaseWidget.h" #include +#include #include "EntryView.h" #include "GroupView.h" @@ -25,13 +26,17 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent) : QWidget(parent) { - m_groupView = new GroupView(db); - m_entryView = new EntryView(); + QLayout* layout = new QHBoxLayout(this); + QSplitter* splitter = new QSplitter(this); + + m_groupView = new GroupView(db, splitter); + m_entryView = new EntryView(splitter); connect(m_groupView, SIGNAL(groupChanged(Group*)), m_entryView, SLOT(setGroup(Group*))); - QHBoxLayout* layout = new QHBoxLayout(); - layout->addWidget(m_groupView); - layout->addWidget(m_entryView); + splitter->addWidget(m_groupView); + splitter->addWidget(m_entryView); + + layout->addWidget(splitter); setLayout(layout); } diff --git a/src/gui/EntryView.cpp b/src/gui/EntryView.cpp index 3cc1addea..141aca700 100644 --- a/src/gui/EntryView.cpp +++ b/src/gui/EntryView.cpp @@ -24,6 +24,9 @@ EntryView::EntryView(QWidget* parent) { m_model = new EntryModel(this); QTreeView::setModel(m_model); + + setUniformRowHeights(true); + setRootIsDecorated(false); } void EntryView::setGroup(Group* group) diff --git a/src/gui/GroupView.cpp b/src/gui/GroupView.cpp index d0f39877b..d0f112836 100644 --- a/src/gui/GroupView.cpp +++ b/src/gui/GroupView.cpp @@ -29,6 +29,8 @@ GroupView::GroupView(Database* db, QWidget* parent) : QTreeView(parent) setHeaderHidden(true); connect(this, SIGNAL(clicked(const QModelIndex&)), SLOT(emitGroupChanged(const QModelIndex&))); + + setUniformRowHeights(true); } void GroupView::expandedChanged(const QModelIndex& index)