pineapple-pictures/metadatadialog.cpp

42 lines
907 B
C++
Raw Normal View History

2020-10-30 13:06:46 +08:00
#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);
}