Added postregister plugin.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
#include "postregistergrid.h"
|
||||
#include <QHBoxLayout>
|
||||
#include <QToolButton>
|
||||
|
||||
#include "postregister-odb.hxx"
|
||||
#include "importdialog.h"
|
||||
|
||||
PostRegisterGrid::PostRegisterGrid(QWidget *parent)
|
||||
:GridForm<PostData>(parent)
|
||||
{
|
||||
setTableModel(new AutoTableModel<PostData>());
|
||||
QHBoxLayout *tbLayout = qobject_cast<QHBoxLayout*>(this->toolbar()->layout());
|
||||
|
||||
if (tbLayout != NULL)
|
||||
{
|
||||
QToolButton *btnImport = new QToolButton(this->toolbar());
|
||||
btnImport->setIcon(QIcon(":/icons/import.svg"));
|
||||
btnImport->setAutoRaise(true);
|
||||
btnImport->setIconSize(QSize(24, 24));
|
||||
btnImport->setToolTip(tr("Import"));
|
||||
tbLayout->insertWidget(tbLayout->count() - 1, btnImport);
|
||||
|
||||
connect(btnImport, &QToolButton::clicked, [this](){
|
||||
ImportDialog *dlg = new ImportDialog(this);
|
||||
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
dlg->show();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
bool PostRegisterGrid::canAddRecord()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PostRegisterGrid::canEditRecord()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PostRegisterGrid::canDeleteRecord()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user