Build system changed to Cmake, ORM changed to QxORM, Qt6 compatibility.
This commit is contained in:
+10
-6
@@ -1,6 +1,7 @@
|
||||
#include "mainwindow.h"
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
//#include <QDesktopWidget>
|
||||
#include <QSharedPointer>
|
||||
#include <QTranslator>
|
||||
#include <QLibraryInfo>
|
||||
#include <QMessageBox>
|
||||
@@ -17,7 +18,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (!a.lock())
|
||||
{
|
||||
QMessageBox::warning(NULL, "Prodejna is running", "Prodejna is allready running. Only one instance can be started.");
|
||||
QMessageBox::warning(nullptr, "Prodejna is running", "Prodejna is allready running. Only one instance can be started.");
|
||||
return -42;
|
||||
}
|
||||
|
||||
@@ -34,16 +35,19 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
QTranslator qtTranslator;
|
||||
qtTranslator.load("qt_" + QLocale::system().name(),
|
||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
if (qtTranslator.load("qt_" + QLocale::system().name(),
|
||||
QLibraryInfo::path(QLibraryInfo::TranslationsPath))) {
|
||||
qDebug() << "Cannot load translation";
|
||||
}
|
||||
a.installTranslator(&qtTranslator);
|
||||
|
||||
QTranslator myappTranslator;
|
||||
myappTranslator.load(":/translations/prodejna_" + QLocale::system().name());
|
||||
if (myappTranslator.load(":/translations/prodejna_" + QLocale::system().name())) {
|
||||
qDebug() << "Cannot load translation";
|
||||
}
|
||||
a.installTranslator(&myappTranslator);
|
||||
|
||||
MainWindow w;
|
||||
w.move(QApplication::desktop()->screen()->rect().center() - w.rect().center());
|
||||
w.showMaximized();
|
||||
|
||||
return a.exec();
|
||||
|
||||
Reference in New Issue
Block a user