- Users table model renamed to UsersTableModel- causes linker conflict
with class TableModel in accomodation plugin. - Edit record dialog is now screen centered. - Plugin tabs in application main window are now closable.
This commit is contained in:
@@ -63,3 +63,8 @@ void MainWindow::on_actionOpen_database_triggered()
|
|||||||
dialog.setWindowTitle(tr("Open Database"));
|
dialog.setWindowTitle(tr("Open Database"));
|
||||||
Context::instance().openDb(dialog.getOpenFileName());
|
Context::instance().openDb(dialog.getOpenFileName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_tabWidget_tabCloseRequested(int index)
|
||||||
|
{
|
||||||
|
ui->tabWidget->removeTab(index);
|
||||||
|
}
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ private slots:
|
|||||||
|
|
||||||
void on_actionOpen_database_triggered();
|
void on_actionOpen_database_triggered();
|
||||||
|
|
||||||
|
void on_tabWidget_tabCloseRequested(int index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -31,6 +31,9 @@
|
|||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>-1</number>
|
<number>-1</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="tabsClosable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -41,7 +44,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>825</width>
|
<width>825</width>
|
||||||
<height>25</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuFile">
|
<widget class="QMenu" name="menuFile">
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
#include "defaultformhandler.h"
|
#include "defaultformhandler.h"
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QDesktopWidget>
|
||||||
|
#include <QRect>
|
||||||
|
|
||||||
DefaultFormHandler::DefaultFormHandler()
|
DefaultFormHandler::DefaultFormHandler()
|
||||||
{
|
{
|
||||||
m_dialog = new FormDialog();
|
m_dialog = new FormDialog();
|
||||||
@@ -14,6 +18,7 @@ void DefaultFormHandler::showForm(IForm *formWidget)
|
|||||||
{
|
{
|
||||||
m_dialog->setForm(formWidget);
|
m_dialog->setForm(formWidget);
|
||||||
m_dialog->setModal(true);
|
m_dialog->setModal(true);
|
||||||
|
m_dialog->move(QApplication::desktop()->screen()->rect().center() - m_dialog->rect().center());
|
||||||
m_dialog->show();
|
m_dialog->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -2,6 +2,9 @@
|
|||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>FormDialog</class>
|
<class>FormDialog</class>
|
||||||
<widget class="QDialog" name="FormDialog">
|
<widget class="QDialog" name="FormDialog">
|
||||||
|
<property name="windowModality">
|
||||||
|
<enum>Qt::ApplicationModal</enum>
|
||||||
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -11,7 +14,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Dialog</string>
|
<string>Edit record</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "tablemodel.h"
|
#include "tablemodel.h"
|
||||||
|
|
||||||
TableModel::TableModel(QObject *parent) :AutoTableModel<User>(parent)
|
UsersTableModel::UsersTableModel(QObject *parent) :AutoTableModel<User>(parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
#include "../data/core-data.h"
|
#include "../data/core-data.h"
|
||||||
#include "core-odb.hxx"
|
#include "core-odb.hxx"
|
||||||
|
|
||||||
class TableModel : public AutoTableModel<User>
|
class UsersTableModel : public AutoTableModel<User>
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit TableModel(QObject *parent = NULL);
|
explicit UsersTableModel(QObject *parent = NULL);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TABLEMODEL_H
|
#endif // TABLEMODEL_H
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
UsersUi::UsersUi(QWidget *parent) :GridForm<User>(parent)
|
UsersUi::UsersUi(QWidget *parent) :GridForm<User>(parent)
|
||||||
{
|
{
|
||||||
setTableModel(new TableModel);
|
setTableModel(new UsersTableModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
UsersUi::~UsersUi()
|
UsersUi::~UsersUi()
|
||||||
|
|||||||
Reference in New Issue
Block a user