diff --git a/application/mainwindow.cpp b/application/mainwindow.cpp index faee5ec..8b4c6fc 100644 --- a/application/mainwindow.cpp +++ b/application/mainwindow.cpp @@ -63,3 +63,8 @@ void MainWindow::on_actionOpen_database_triggered() dialog.setWindowTitle(tr("Open Database")); Context::instance().openDb(dialog.getOpenFileName()); } + +void MainWindow::on_tabWidget_tabCloseRequested(int index) +{ + ui->tabWidget->removeTab(index); +} diff --git a/application/mainwindow.h b/application/mainwindow.h index a33e03b..af6786d 100644 --- a/application/mainwindow.h +++ b/application/mainwindow.h @@ -23,6 +23,8 @@ private slots: void on_actionOpen_database_triggered(); + void on_tabWidget_tabCloseRequested(int index); + private: Ui::MainWindow *ui; }; diff --git a/application/mainwindow.ui b/application/mainwindow.ui index 7552bc0..644d849 100644 --- a/application/mainwindow.ui +++ b/application/mainwindow.ui @@ -31,6 +31,9 @@ -1 + + true + @@ -41,7 +44,7 @@ 0 0 825 - 25 + 21 diff --git a/core/defaultformhandler.cpp b/core/defaultformhandler.cpp index 5bb21a2..1ce8aad 100644 --- a/core/defaultformhandler.cpp +++ b/core/defaultformhandler.cpp @@ -1,5 +1,9 @@ #include "defaultformhandler.h" +#include +#include +#include + DefaultFormHandler::DefaultFormHandler() { m_dialog = new FormDialog(); @@ -14,6 +18,7 @@ void DefaultFormHandler::showForm(IForm *formWidget) { m_dialog->setForm(formWidget); m_dialog->setModal(true); + m_dialog->move(QApplication::desktop()->screen()->rect().center() - m_dialog->rect().center()); m_dialog->show(); } diff --git a/core/formdialog.ui b/core/formdialog.ui index 26d74f9..faae3c5 100644 --- a/core/formdialog.ui +++ b/core/formdialog.ui @@ -2,6 +2,9 @@ FormDialog + + Qt::ApplicationModal + 0 @@ -11,7 +14,7 @@ - Dialog + Edit record diff --git a/core/users/tablemodel.cpp b/core/users/tablemodel.cpp index 233e886..5d68354 100644 --- a/core/users/tablemodel.cpp +++ b/core/users/tablemodel.cpp @@ -1,6 +1,6 @@ #include "tablemodel.h" -TableModel::TableModel(QObject *parent) :AutoTableModel(parent) +UsersTableModel::UsersTableModel(QObject *parent) :AutoTableModel(parent) { } diff --git a/core/users/tablemodel.h b/core/users/tablemodel.h index 5cf74f2..755bedb 100644 --- a/core/users/tablemodel.h +++ b/core/users/tablemodel.h @@ -5,11 +5,11 @@ #include "../data/core-data.h" #include "core-odb.hxx" -class TableModel : public AutoTableModel +class UsersTableModel : public AutoTableModel { Q_OBJECT public: - explicit TableModel(QObject *parent = NULL); + explicit UsersTableModel(QObject *parent = NULL); }; #endif // TABLEMODEL_H diff --git a/core/users/usersui.cpp b/core/users/usersui.cpp index 55be3c0..5212bf9 100644 --- a/core/users/usersui.cpp +++ b/core/users/usersui.cpp @@ -3,7 +3,7 @@ UsersUi::UsersUi(QWidget *parent) :GridForm(parent) { - setTableModel(new TableModel); + setTableModel(new UsersTableModel); } UsersUi::~UsersUi()