You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
566 B
C++
31 lines
566 B
C++
#include "defaultformhandler.h"
|
|
|
|
#include <QApplication>
|
|
#include <QScreen>
|
|
#include <QRect>
|
|
|
|
DefaultFormHandler::DefaultFormHandler()
|
|
{
|
|
m_dialog = new FormDialog();
|
|
}
|
|
|
|
DefaultFormHandler::~DefaultFormHandler()
|
|
{
|
|
delete m_dialog;
|
|
}
|
|
|
|
void DefaultFormHandler::showForm(IForm *formWidget)
|
|
{
|
|
formWidget->onShow();
|
|
m_dialog->setForm(formWidget);
|
|
m_dialog->setModal(true);
|
|
auto screen = m_dialog->screen();
|
|
|
|
if (screen) {
|
|
m_dialog->move(screen->availableGeometry().center() - m_dialog->rect().center());
|
|
}
|
|
|
|
m_dialog->show();
|
|
}
|
|
|