- 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.
print
Josef Rokos 9 years ago
parent a6d795ec87
commit 989c8fdac3

@ -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);
}

@ -23,6 +23,8 @@ private slots:
void on_actionOpen_database_triggered();
void on_tabWidget_tabCloseRequested(int index);
private:
Ui::MainWindow *ui;
};

@ -31,6 +31,9 @@
<property name="currentIndex">
<number>-1</number>
</property>
<property name="tabsClosable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
@ -41,7 +44,7 @@
<x>0</x>
<y>0</y>
<width>825</width>
<height>25</height>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">

@ -1,5 +1,9 @@
#include "defaultformhandler.h"
#include <QApplication>
#include <QDesktopWidget>
#include <QRect>
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();
}

@ -2,6 +2,9 @@
<ui version="4.0">
<class>FormDialog</class>
<widget class="QDialog" name="FormDialog">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
@ -11,7 +14,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>Edit record</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">

@ -1,6 +1,6 @@
#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 "core-odb.hxx"
class TableModel : public AutoTableModel<User>
class UsersTableModel : public AutoTableModel<User>
{
Q_OBJECT
public:
explicit TableModel(QObject *parent = NULL);
explicit UsersTableModel(QObject *parent = NULL);
};
#endif // TABLEMODEL_H

@ -3,7 +3,7 @@
UsersUi::UsersUi(QWidget *parent) :GridForm<User>(parent)
{
setTableModel(new TableModel);
setTableModel(new UsersTableModel);
}
UsersUi::~UsersUi()

Loading…
Cancel
Save