VS 2019 build fixed.

master
Josef Rokos 2 years ago
parent 7082648122
commit 46b2098ffc

@ -28,7 +28,9 @@ add_executable(prodejna
logindialog.ui logindialog.ui
mainwindow.cpp mainwindow.cpp
mainwindow.h mainwindow.h
mainwindow.ui) mainwindow.ui
shop.rc
)
target_link_libraries(prodejna target_link_libraries(prodejna
Qt::Core Qt::Core
@ -38,3 +40,8 @@ target_link_libraries(prodejna
Qt::Qml Qt::Qml
core core
) )
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set_property(TARGET prodejna PROPERTY WIN32_EXECUTABLE true)
endif()

@ -256,5 +256,5 @@ void MainWindow::on_actionAbout_Qt_triggered()
void MainWindow::on_actionAbout_triggered() void MainWindow::on_actionAbout_triggered()
{ {
QMessageBox::about(this, tr("About prodejna"), tr("Modular cash register software under GPL license.\n(C) 2015 - 2017 Josef Rokos, Zdenek Jonák")); QMessageBox::about(this, tr("About prodejna"), tr("Modular cash register software under GPL license.\n(C) 2015 - 2023 Josef Rokos, Zdenek Jonák"));
} }

@ -117,9 +117,9 @@
</spacer> </spacer>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="labelVersion">
<property name="text"> <property name="text">
<string>Prodejna 2.0</string> <string>Prodejna 3.0</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
@ -137,7 +137,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1000</width> <width>1000</width>
<height>42</height> <height>21</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">

@ -6,10 +6,6 @@
#include "campseller.h" #include "campseller.h"
#include <cmath> #include <cmath>
#ifdef _WIN32
double round(double value) { return value < 0 ? -std::floor(0.5 - value) : std::floor(0.5 + value); }
#endif
CampService::CampService() CampService::CampService()
{ {
m_pluginId = "CAMP"; m_pluginId = "CAMP";

@ -11,7 +11,6 @@
#include "../commodity_global.h" #include "../commodity_global.h"
#pragma db object
class CommodityData : public IShopItem class CommodityData : public IShopItem
{ {
Q_OBJECT Q_OBJECT

@ -15,7 +15,11 @@
#ifndef PLUGIN_ROOT #ifndef PLUGIN_ROOT
#ifdef _WIN32 #ifdef _WIN32
#ifdef QT_NO_DEBUG
#define PLUGIN_ROOT "/plugins"
#else
#define PLUGIN_ROOT "/../../plugins" #define PLUGIN_ROOT "/../../plugins"
#endif
#else #else
#define PLUGIN_ROOT "/../plugins" #define PLUGIN_ROOT "/../plugins"
#endif #endif
@ -23,7 +27,11 @@
#ifndef REPORT_ROOT #ifndef REPORT_ROOT
#ifdef _WIN32 #ifdef _WIN32
#ifdef QT_NO_DEBUG
#define REPORT_ROOT "/reports"
#else
#define REPORT_ROOT "/../../reports" #define REPORT_ROOT "/../../reports"
#endif
#else #else
#define REPORT_ROOT "/../reports" #define REPORT_ROOT "/../reports"
#endif #endif

@ -1,21 +1,5 @@
#include "exprevaluator.h" #include "exprevaluator.h"
#ifdef _MSC_VER
ExprEvaluator::ExprEvaluator()
{
m_operations["=="] = [](QVariant left, QVariant right) { return left == right; };
m_operations["!="] = [](QVariant left, QVariant right) { return left != right; };
m_operations["<"] = [](QVariant left, QVariant right) { return left < right; };
m_operations["<="] = [](QVariant left, QVariant right) { return left <= right; };
m_operations[">"] = [](QVariant left, QVariant right) { return left > right; };
m_operations[">="] = [](QVariant left, QVariant right) { return left >= right; };
m_operations["%"] = [](QVariant left, QVariant right) { return left.toString().contains(right.toString()); };
m_operations["||"] = [](QVariant left, QVariant right) { return left.toBool() || right.toBool(); };
m_operations["&&"] = [](QVariant left, QVariant right) { return left.toBool() && right.toBool(); };
m_caseSensitive = false;
}
#else
const QMap<QString, std::function<bool(QVariant, QVariant)> > ExprEvaluator::m_operations = { const QMap<QString, std::function<bool(QVariant, QVariant)> > ExprEvaluator::m_operations = {
{ "==", [](QVariant left, QVariant right) { return left == right; }}, { "==", [](QVariant left, QVariant right) { return left == right; }},
{ "!=", [](QVariant left, QVariant right) { return left != right; }}, { "!=", [](QVariant left, QVariant right) { return left != right; }},
@ -35,13 +19,6 @@ const QMap<QString, std::function<bool(QVariant, QVariant)> > ExprEvaluator::m_o
{ "&&", [](QVariant left, QVariant right) { return left.toBool() && right.toBool(); }} { "&&", [](QVariant left, QVariant right) { return left.toBool() && right.toBool(); }}
}; };
ExprEvaluator::ExprEvaluator()
{
m_caseSensitive = false;
}
#endif
bool ExprEvaluator::evaluate(QObject *object, const QString &exp) bool ExprEvaluator::evaluate(QObject *object, const QString &exp)
{ {
if (exp.contains("&&") && exp.contains("||")) if (exp.contains("&&") && exp.contains("||"))

@ -11,19 +11,15 @@
class CORESHARED_EXPORT ExprEvaluator class CORESHARED_EXPORT ExprEvaluator
{ {
public: public:
ExprEvaluator(); ExprEvaluator() = default;
bool evaluate(QObject *object, const QString &exp); bool evaluate(QObject *object, const QString &exp);
void setCaseSensitive(bool caseSensitive); void setCaseSensitive(bool caseSensitive);
private: private:
#ifdef _MSC_VER
QMap<QString, std::function<bool(QVariant, QVariant)> > m_operations;
#else
static const QMap<QString, std::function<bool(QVariant, QVariant)> > m_operations; static const QMap<QString, std::function<bool(QVariant, QVariant)> > m_operations;
#endif
bool m_caseSensitive; bool m_caseSensitive{false};
bool subEval(const QString &oper, const QString &expresion, QObject *object); bool subEval(const QString &oper, const QString &expresion, QObject *object);
void parseExpr(const QString &exp, QVariant &value, QString &oper, QVariant &condition, QObject *object); void parseExpr(const QString &exp, QVariant &value, QString &oper, QVariant &condition, QObject *object);

@ -1,5 +1,14 @@
#include "iservice.h" #include "iservice.h"
#ifdef _MSC_VER
QX_REGISTER_CPP_CORE(IService)
namespace qx {
template<> void register_class(QxClass<IService>&) {
}
}
#endif
IService::IService(QObject *parent) : QObject(parent) IService::IService(QObject *parent) : QObject(parent)
{ {
} }

@ -33,4 +33,8 @@ protected:
QString m_pluginId; QString m_pluginId;
}; };
#ifdef _MSC_VER
QX_REGISTER_HPP_CORE(IService, QObject, 0)
#endif
#endif // ISERVICE_H #endif // ISERVICE_H

@ -3,12 +3,13 @@
#include <QDialog> #include <QDialog>
#include "report.h" #include "report.h"
#include "../core_global.h"
namespace Ui { namespace Ui {
class ReportDialog; class ReportDialog;
} }
class ReportDialog : public QDialog class CORESHARED_EXPORT ReportDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT

@ -59,11 +59,11 @@ void ReceiptGenerator::print()
DWORD dwBytes; DWORD dwBytes;
BOOL bStatus = FALSE; BOOL bStatus = FALSE;
if (OpenPrinter((LPWSTR)printer.toStdWString().c_str(), &hPrinter, NULL)) if (OpenPrinter((LPWSTR)printer.toStdWString().c_str(), &hPrinter, nullptr))
{ {
docInfo.pDocName = L"Uctenka"; docInfo.pDocName = (LPWSTR)"Uctenka";
docInfo.pOutputFile = NULL; docInfo.pOutputFile = nullptr;
docInfo.pDatatype = L"RAW"; docInfo.pDatatype = (LPWSTR)"RAW";
dwJob = StartDocPrinter(hPrinter, 1, (LPBYTE)&docInfo); dwJob = StartDocPrinter(hPrinter, 1, (LPBYTE)&docInfo);
if (dwJob > 0) if (dwJob > 0)

Loading…
Cancel
Save