42 lines
909 B
C++
42 lines
909 B
C++
|
#include "metadatadialog.h"
|
||
|
|
||
|
#include <QDialogButtonBox>
|
||
|
#include <QTreeView>
|
||
|
#include <QVBoxLayout>
|
||
|
|
||
|
#include "metadatamodel.h"
|
||
|
|
||
|
MetadataDialog::MetadataDialog(QWidget *parent)
|
||
|
: QDialog(parent)
|
||
|
, m_treeView(new QTreeView(this))
|
||
|
{
|
||
|
// m_treeView->setRootIsDecorated(false);
|
||
|
m_treeView->setIndentation(0);
|
||
|
|
||
|
setWindowTitle(tr("Image Metadata"));
|
||
|
|
||
|
QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
|
||
|
|
||
|
setLayout(new QVBoxLayout);
|
||
|
layout()->addWidget(m_treeView);
|
||
|
layout()->addWidget(buttonBox);
|
||
|
|
||
|
connect(buttonBox, &QDialogButtonBox::close, this, &QDialog::close);
|
||
|
}
|
||
|
|
||
|
MetadataDialog::~MetadataDialog()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
void MetadataDialog::setMetadataModel(MetadataModel * model)
|
||
|
{
|
||
|
m_treeView->setModel(model);
|
||
|
m_treeView->expandAll();
|
||
|
}
|
||
|
|
||
|
QSize MetadataDialog::sizeHint() const
|
||
|
{
|
||
|
return QSize(520, 350);
|
||
|
}
|