55 #include <QLibraryInfo>
56 #include <QMessageLogger>
57 #include <QStaticStringData>
58 #include <QStringData>
59 #include <QStringDataPtr>
60 #include <QTranslator>
64 #include "../vmisc/def.h"
65 #include "../vmisc/logging.h"
69 :QApplication(argc, argv),
73 qtTranslator(nullptr),
74 qtxmlTranslator(nullptr),
75 qtBaseTranslator(nullptr),
76 appTranslator(nullptr),
77 pmsTranslator(nullptr),
81 currentScene(nullptr),
89 #if defined(V_NO_ASSERT)
92 rules += QLatin1String(
"qt.network.ssl.warning=false\n");
94 rules += QLatin1String(
"qt.network.ssl.critical=false\n"
95 "qt.network.ssl.fatal=false\n");
101 QLoggingCategory::setFilterRules(rules);
104 setAttribute(Qt::AA_UseHighDpiPixmaps);
106 connect(
this, &QApplication::aboutToQuit,
this, [
this]()
128 return QStringLiteral(
":/i18n/");
269 if (locale.isEmpty())
271 qDebug()<<
"Locale is empty.";
274 qDebug()<<
"Checked locale:"<<locale;
284 #if defined(Q_OS_WIN) || defined(Q_OS_MAC)
289 qtTranslator->load(
"qt_" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
290 qtxmlTranslator->load(
"qtxmlpatterns_" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
291 qtBaseTranslator->load(
"qtbase_" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
QWidget * mainWindow
mainWindow pointer to main window. Usefull if need create modal dialog. Without pointer to main windo...
bool openingPattern
openingPattern true when we opening pattern. If something will be wrong in formula this help understa...
void setCurrentDocument(VAbstractPattern *doc)
QPointer< QTranslator > qtBaseTranslator
void setMainWindow(QWidget *value)
const Unit * patternUnitP() const
VMainGraphicsView * sceneView
void setPatternUnit(const Unit &patternUnit)
MeasurementsType _patternType
void setCurrentScene(QGraphicsScene **value)
virtual ~VAbstractApplication() Q_DECL_OVERRIDE
QWidget * getMainWindow() const
double fromPixel(double pix) const
VCommonSettings * settings
settings pointer to settings. Help hide constructor creation settings. Make make code more readable.
QGraphicsScene ** currentScene
bool getOpeningPattern() const
QPointer< QTranslator > pmsTranslator
QUndoStack * getUndoStack() const
VContainer * getCurrentData() const
QPointer< QTranslator > appTranslator
virtual void InitTrVars()=0
QPointer< QTranslator > qtTranslator
QString translationsPath(const QString &locale=QString()) const
translationsPath return path to the root directory that contains QM files.
QPointer< QTranslator > qtxmlTranslator
double toPixel(double val) const
void loadTranslations(const QString &locale)
VCommonSettings * Settings()
getSettings hide settings constructor.
MeasurementsType patternType() const
void setPatternType(const MeasurementsType &patternType)
VMainGraphicsView * getSceneView() const
VAbstractPattern * getCurrentDocument() const
void setSceneView(VMainGraphicsView *value)
void setCurrentData(VContainer *data)
QGraphicsScene * getCurrentScene() const
VAbstractApplication(int &argc, char **argv)
The VContainer class container of all variables.
The VMainGraphicsView class main scene view.
double ToPixel(double val, const Unit &unit)
double FromPixel(double pix, const Unit &unit)