VS 2019 build fixed.
This commit is contained in:
@@ -28,7 +28,9 @@ add_executable(prodejna
|
||||
logindialog.ui
|
||||
mainwindow.cpp
|
||||
mainwindow.h
|
||||
mainwindow.ui)
|
||||
mainwindow.ui
|
||||
shop.rc
|
||||
)
|
||||
|
||||
target_link_libraries(prodejna
|
||||
Qt::Core
|
||||
@@ -37,4 +39,9 @@ target_link_libraries(prodejna
|
||||
Qt::Sql
|
||||
Qt::Qml
|
||||
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()
|
||||
{
|
||||
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>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<widget class="QLabel" name="labelVersion">
|
||||
<property name="text">
|
||||
<string>Prodejna 2.0</string>
|
||||
<string>Prodejna 3.0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
@@ -137,7 +137,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1000</width>
|
||||
<height>42</height>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
#include "campseller.h"
|
||||
#include <cmath>
|
||||
|
||||
#ifdef _WIN32
|
||||
double round(double value) { return value < 0 ? -std::floor(0.5 - value) : std::floor(0.5 + value); }
|
||||
#endif
|
||||
|
||||
CampService::CampService()
|
||||
{
|
||||
m_pluginId = "CAMP";
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include "../commodity_global.h"
|
||||
|
||||
#pragma db object
|
||||
class CommodityData : public IShopItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
+10
-2
@@ -15,7 +15,11 @@
|
||||
|
||||
#ifndef PLUGIN_ROOT
|
||||
#ifdef _WIN32
|
||||
#define PLUGIN_ROOT "/../../plugins"
|
||||
#ifdef QT_NO_DEBUG
|
||||
#define PLUGIN_ROOT "/plugins"
|
||||
#else
|
||||
#define PLUGIN_ROOT "/../../plugins"
|
||||
#endif
|
||||
#else
|
||||
#define PLUGIN_ROOT "/../plugins"
|
||||
#endif
|
||||
@@ -23,7 +27,11 @@
|
||||
|
||||
#ifndef REPORT_ROOT
|
||||
#ifdef _WIN32
|
||||
#define REPORT_ROOT "/../../reports"
|
||||
#ifdef QT_NO_DEBUG
|
||||
#define REPORT_ROOT "/reports"
|
||||
#else
|
||||
#define REPORT_ROOT "/../../reports"
|
||||
#endif
|
||||
#else
|
||||
#define REPORT_ROOT "/../reports"
|
||||
#endif
|
||||
|
||||
@@ -1,21 +1,5 @@
|
||||
#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 = {
|
||||
{ "==", [](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(); }}
|
||||
};
|
||||
|
||||
ExprEvaluator::ExprEvaluator()
|
||||
{
|
||||
m_caseSensitive = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool ExprEvaluator::evaluate(QObject *object, const QString &exp)
|
||||
{
|
||||
if (exp.contains("&&") && exp.contains("||"))
|
||||
|
||||
@@ -11,19 +11,15 @@
|
||||
class CORESHARED_EXPORT ExprEvaluator
|
||||
{
|
||||
public:
|
||||
ExprEvaluator();
|
||||
ExprEvaluator() = default;
|
||||
|
||||
bool evaluate(QObject *object, const QString &exp);
|
||||
void setCaseSensitive(bool caseSensitive);
|
||||
|
||||
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;
|
||||
#endif
|
||||
|
||||
bool m_caseSensitive;
|
||||
bool m_caseSensitive{false};
|
||||
|
||||
bool subEval(const QString &oper, const QString &expresion, QObject *object);
|
||||
void parseExpr(const QString &exp, QVariant &value, QString &oper, QVariant &condition, QObject *object);
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
#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)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -33,4 +33,8 @@ protected:
|
||||
QString m_pluginId;
|
||||
};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
QX_REGISTER_HPP_CORE(IService, QObject, 0)
|
||||
#endif
|
||||
|
||||
#endif // ISERVICE_H
|
||||
|
||||
@@ -3,12 +3,13 @@
|
||||
|
||||
#include <QDialog>
|
||||
#include "report.h"
|
||||
#include "../core_global.h"
|
||||
|
||||
namespace Ui {
|
||||
class ReportDialog;
|
||||
}
|
||||
|
||||
class ReportDialog : public QDialog
|
||||
class CORESHARED_EXPORT ReportDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -59,11 +59,11 @@ void ReceiptGenerator::print()
|
||||
DWORD dwBytes;
|
||||
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.pOutputFile = NULL;
|
||||
docInfo.pDatatype = L"RAW";
|
||||
docInfo.pDocName = (LPWSTR)"Uctenka";
|
||||
docInfo.pOutputFile = nullptr;
|
||||
docInfo.pDatatype = (LPWSTR)"RAW";
|
||||
|
||||
dwJob = StartDocPrinter(hPrinter, 1, (LPBYTE)&docInfo);
|
||||
if (dwJob > 0)
|
||||
|
||||
Reference in New Issue
Block a user