mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-23 13:11:12 -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 "DatabaseWidget.h"
|
||||||
|
|
||||||
#include <QtGui/QHBoxLayout>
|
#include <QtGui/QHBoxLayout>
|
||||||
|
#include <QtGui/QSplitter>
|
||||||
|
|
||||||
#include "EntryView.h"
|
#include "EntryView.h"
|
||||||
#include "GroupView.h"
|
#include "GroupView.h"
|
||||||
@ -25,13 +26,17 @@
|
|||||||
DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent)
|
DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
m_groupView = new GroupView(db);
|
QLayout* layout = new QHBoxLayout(this);
|
||||||
m_entryView = new EntryView();
|
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*)));
|
connect(m_groupView, SIGNAL(groupChanged(Group*)), m_entryView, SLOT(setGroup(Group*)));
|
||||||
|
|
||||||
QHBoxLayout* layout = new QHBoxLayout();
|
splitter->addWidget(m_groupView);
|
||||||
layout->addWidget(m_groupView);
|
splitter->addWidget(m_entryView);
|
||||||
layout->addWidget(m_entryView);
|
|
||||||
|
layout->addWidget(splitter);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,9 @@ EntryView::EntryView(QWidget* parent)
|
|||||||
{
|
{
|
||||||
m_model = new EntryModel(this);
|
m_model = new EntryModel(this);
|
||||||
QTreeView::setModel(m_model);
|
QTreeView::setModel(m_model);
|
||||||
|
|
||||||
|
setUniformRowHeights(true);
|
||||||
|
setRootIsDecorated(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntryView::setGroup(Group* group)
|
void EntryView::setGroup(Group* group)
|
||||||
|
@ -29,6 +29,8 @@ GroupView::GroupView(Database* db, QWidget* parent) : QTreeView(parent)
|
|||||||
setHeaderHidden(true);
|
setHeaderHidden(true);
|
||||||
|
|
||||||
connect(this, SIGNAL(clicked(const QModelIndex&)), SLOT(emitGroupChanged(const QModelIndex&)));
|
connect(this, SIGNAL(clicked(const QModelIndex&)), SLOT(emitGroupChanged(const QModelIndex&)));
|
||||||
|
|
||||||
|
setUniformRowHeights(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupView::expandedChanged(const QModelIndex& index)
|
void GroupView::expandedChanged(const QModelIndex& index)
|
||||||
|
Loading…
Reference in New Issue
Block a user