mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-23 05:01:19 -05:00
Use a splitter between Group and Entry View.
This commit is contained in:
parent
621b367f45
commit
194a081bd7
@ -18,6 +18,7 @@
|
||||
#include "DatabaseWidget.h"
|
||||
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QSplitter>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user