Build system changed to Cmake, ORM changed to QxORM, Qt6 compatibility.
This commit is contained in:
+15
-13
@@ -6,7 +6,7 @@
|
||||
#include <QHeaderView>
|
||||
#include <QLayout>
|
||||
#include <QToolButton>
|
||||
#include <QDesktopWidget>
|
||||
//#include <QDesktopWidget>
|
||||
|
||||
#include "autoform.h"
|
||||
#include "autotablemodel.h"
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
filterWidget()->layout()->addWidget(m_filterUi);
|
||||
}
|
||||
|
||||
virtual ~GridForm()
|
||||
~GridForm() override
|
||||
{
|
||||
if (m_form != NULL && m_form->parent() == NULL)
|
||||
{
|
||||
@@ -84,13 +84,13 @@ public:
|
||||
m_formHandler = handler;
|
||||
}
|
||||
|
||||
virtual void setTranslations(const QMap<QString, QString> &translations) {
|
||||
void setTranslations(const QMap<QString, QString> &translations) override {
|
||||
Q_ASSERT(m_tableModel != NULL);
|
||||
m_tableModel->setTranslations(translations);
|
||||
}
|
||||
|
||||
public slots:
|
||||
bool fillData() {
|
||||
bool fillData() override {
|
||||
if (m_tableModel == NULL) {
|
||||
Q_ASSERT(false);
|
||||
return false;
|
||||
@@ -131,13 +131,13 @@ private:
|
||||
|
||||
Service<T> *service() {
|
||||
IPlugin *plugin = Context::instance().plugin(pluginId());
|
||||
if (plugin == NULL) {
|
||||
if (plugin == nullptr) {
|
||||
Q_ASSERT(false);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Service<T> *service = plugin->service<T>();
|
||||
if (service == NULL) {
|
||||
if (service == nullptr) {
|
||||
Q_ASSERT(false);
|
||||
return NULL;
|
||||
}
|
||||
@@ -176,14 +176,14 @@ private slots:
|
||||
|
||||
// IGridForm interface
|
||||
protected:
|
||||
virtual void handleNewRecord() override
|
||||
void handleNewRecord() override
|
||||
{
|
||||
if (!checkPermAdd())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_form == NULL)
|
||||
if (m_form == nullptr)
|
||||
{
|
||||
Q_ASSERT(false);
|
||||
return;
|
||||
@@ -194,20 +194,22 @@ protected:
|
||||
m_formHandler->showForm(m_form);
|
||||
}
|
||||
|
||||
virtual void handleEditRecord() override
|
||||
void handleEditRecord() override
|
||||
{
|
||||
if (!checkPermEdit())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_form == NULL || m_tableModel == NULL || tableView()->currentIndex().row() < 0)
|
||||
if (m_form == nullptr || m_tableModel == nullptr || tableView()->currentIndex().row() < 0)
|
||||
{
|
||||
Q_ASSERT(false);
|
||||
return;
|
||||
}
|
||||
|
||||
form()->setEntity(m_tableModel->itemFromIndex(tableView()->currentIndex()));
|
||||
auto entity = m_tableModel->itemFromIndex(tableView()->currentIndex());
|
||||
service()->load(entity);
|
||||
form()->setEntity(entity);
|
||||
form()->setNewRec(false);
|
||||
m_formHandler->showForm(m_form);
|
||||
}
|
||||
@@ -278,7 +280,7 @@ protected:
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual int currentRecordId()
|
||||
int currentRecordId() override
|
||||
{
|
||||
if (tableView()->currentIndex().isValid())
|
||||
{
|
||||
@@ -340,7 +342,7 @@ protected:
|
||||
importer.setSeparator(dlg->separator());
|
||||
|
||||
ImportProgress *progress = new ImportProgress();
|
||||
progress->move(QApplication::desktop()->screen()->rect().center() - progress->rect().center());
|
||||
//progress->move(QApplication::desktop()->screen()->rect().center() - progress->rect().center());
|
||||
progress->setWindowModality(Qt::ApplicationModal);
|
||||
progress->show();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user