From 7aa00f1b1e6fdeff5d13a7e4ef66e102750bc0ad Mon Sep 17 00:00:00 2001 From: Zdenek Jonak Date: Tue, 28 Mar 2017 21:02:38 +0200 Subject: [PATCH] Fixed build on linux --- application/application.pro | 22 ++++++++++++++++++++++ core/reporting/reportviewer.cpp | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/application/application.pro b/application/application.pro index 8d608ac..6f1117f 100644 --- a/application/application.pro +++ b/application/application.pro @@ -37,8 +37,30 @@ FORMS += mainwindow.ui \ logindialog.ui +unix{ + ARCH_TYPE = unix + macx{ + ARCH_TYPE = macx + } + linux{ + !contains(QT_ARCH, x86_64){ + ARCH_TYPE = linux32 + }else{ + ARCH_TYPE = linux64 + } + } +} + unix { QMAKE_CXXFLAGS += -Wno-unknown-pragmas + + CONFIG(debug, debug|release) { + LIBS += -L$$PWD/../../LimeReport/build/$${QT_VERSION}/$${ARCH_TYPE}/debug/lib/ -llimereport -lQtZint + #QMAKE_CXXFLAGS += -Wl,-rpath-link,$$PWD/../../LimeReport/build/$${QT_VERSION}/$${ARCH_TYPE}/debug/lib/ + } else { + LIBS += -L$$PWD/../../LimeReport/build/$${QT_VERSION}/$${ARCH_TYPE}/release/lib/ -llimereport -lQtZint + #QMAKE_CXXFLAGS += -Wl,-rpath-link,$$PWD/../../LimeReport/build/$${QT_VERSION}/$${ARCH_TYPE}/release/lib/ + } } win32 { diff --git a/core/reporting/reportviewer.cpp b/core/reporting/reportviewer.cpp index 8666c33..49a2fb1 100644 --- a/core/reporting/reportviewer.cpp +++ b/core/reporting/reportviewer.cpp @@ -28,7 +28,8 @@ void ReportViewer::setReport(ReportPtr report) QFile file(reportPath); file.open(QFile::ReadOnly); - m_report->loadFromByteArray(&file.readAll()); + QByteArray data = file.readAll(); + m_report->loadFromByteArray(&data); m_report->setReportFileName(reportPath); m_report->dataManager()->setReportVariable("dbPath", Context::instance().settings()->value("db/path", "").toString()); }