diff --git a/CMakeLists.txt b/CMakeLists.txt index fa8e0b1f..e9571c2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,6 +115,7 @@ elseif($ENV{CMAKE_PREFIX_PATH} MATCHES "6[.][0-9][.][0-9]") find_package(Qt6Xml) if(Qt6Widgets_FOUND AND Qt6Gui_FOUND AND Qt6UiTools_FOUND AND Qt6Xml_FOUND) + add_subdirectory(backend_qt) add_subdirectory(frontend_qt) else() message(STATUS "Could NOT find Qt6") @@ -127,6 +128,7 @@ else() find_package(Qt5Xml) if(Qt5Widgets_FOUND AND Qt5Gui_FOUND AND Qt5UiTools_FOUND AND Qt5Xml_FOUND) + add_subdirectory(backend_qt) add_subdirectory(frontend_qt) else() message(STATUS "Could NOT find Qt5") diff --git a/backend_qt/CMakeLists.txt b/backend_qt/CMakeLists.txt new file mode 100644 index 00000000..170849b5 --- /dev/null +++ b/backend_qt/CMakeLists.txt @@ -0,0 +1,33 @@ +# Copyright (C) 2008 by BogDan Vatra < bogdan@licentia.eu > +# Copyright (C) 2009-2021 Robin Stuart +# vim: set ts=4 sw=4 et : + +project(QZint) + +include_directories(BEFORE "${CMAKE_SOURCE_DIR}/backend") + +set(QZint_SRCS qzint.cpp) + +if(USE_QT6) + qt6_wrap_cpp(QZint_SRCS qzint.h) +else() + qt5_wrap_cpp(QZint_SRCS qzint.h) +endif() + +add_library(QZint STATIC ${QZint_SRCS}) + +set_target_properties(QZint PROPERTIES SOVERSION "${ZINT_VERSION_MAJOR}.${ZINT_VERSION_MINOR}" + VERSION ${ZINT_VERSION}) + +add_dependencies(QZint zint) + +link_directories("${CMAKE_BINARY_DIR}/backend") + +if(USE_QT6) + target_link_libraries(QZint zint Qt6::Widgets Qt6::Gui) +else() + target_link_libraries(QZint zint Qt5::Widgets Qt5::Gui) +endif() + +install(TARGETS QZint ${INSTALL_TARGETS_DEFAULT_ARGS}) +install(FILES qzint.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel) diff --git a/backend_qt/backend_qt.pro b/backend_qt/backend_qt.pro new file mode 100644 index 00000000..f5166912 --- /dev/null +++ b/backend_qt/backend_qt.pro @@ -0,0 +1,131 @@ +TEMPLATE = lib + +# My qt is configured for static build: +# http://qt-project.org/wiki/Build_Standalone_Qt_Application_for_Windows +CONFIG += staticlib + +# for dynamic build enable this: +#CONFIG += dll + +macx{ + CONFIG -= dll + CONFIG += lib_bundle +} + +TARGET = QtZint + +INCLUDEPATH += ../backend + +#EDIT THIS !!!! +DEFINES += ZINT_VERSION="\\\"2.9.1.9\\\"" + +!contains(DEFINES, NO_PNG) { + INCLUDEPATH += ../../lpng + INCLUDEPATH += ../../zlib +} + +HEADERS += ../backend/aztec.h \ + ../backend/big5.h \ + ../backend/bmp.h \ + ../backend/channel_precalcs.h \ + ../backend/code1.h \ + ../backend/code128.h \ + ../backend/code49.h \ + ../backend/common.h \ + ../backend/composite.h \ + ../backend/dmatrix.h \ + ../backend/eci.h \ + ../backend/eci_sb.h \ + ../backend/emf.h \ + ../backend/font.h \ + ../backend/gb18030.h \ + ../backend/gb2312.h \ + ../backend/general_field.h \ + ../backend/gridmtx.h \ + ../backend/gs1.h \ + ../backend/gs1_lint.h \ + ../backend/hanxin.h \ + ../backend/iso3166.h \ + ../backend/iso4217.h \ + ../backend/ksx1001.h \ + ../backend/large.h \ + ../backend/maxicode.h \ + ../backend/ms_stdint.h \ + ../backend/output.h \ + ../backend/pcx.h \ + ../backend/pdf417.h \ + ../backend/qr.h \ + ../backend/reedsol.h \ + ../backend/reedsol_logs.h \ + ../backend/rss.h \ + ../backend/sjis.h \ + ../backend/stdint_msvc.h \ + ../backend/tif.h \ + ../backend/tif_lzw.h \ + ../backend/zfiletypes.h \ + ../backend/zintconfig.h \ + ../backend/zint.h \ + qzint.h + +SOURCES += ../backend/2of5.c \ + ../backend/auspost.c \ + ../backend/aztec.c \ + ../backend/bmp.c \ + ../backend/codablock.c \ + ../backend/code.c \ + ../backend/code1.c \ + ../backend/code128.c \ + ../backend/code16k.c \ + ../backend/code49.c \ + ../backend/common.c \ + ../backend/composite.c \ + ../backend/dmatrix.c \ + ../backend/dotcode.c \ + ../backend/eci.c \ + ../backend/emf.c \ + ../backend/gb18030.c \ + ../backend/gb2312.c \ + ../backend/general_field.c \ + ../backend/gif.c \ + ../backend/gridmtx.c \ + ../backend/gs1.c \ + ../backend/hanxin.c \ + ../backend/imail.c \ + ../backend/large.c \ + ../backend/library.c \ + ../backend/mailmark.c \ + ../backend/maxicode.c \ + ../backend/medical.c \ + ../backend/output.c \ + ../backend/pcx.c \ + ../backend/pdf417.c \ + ../backend/plessey.c \ + ../backend/png.c \ + ../backend/postal.c \ + ../backend/ps.c \ + ../backend/qr.c \ + ../backend/raster.c \ + ../backend/reedsol.c \ + ../backend/rss.c \ + ../backend/sjis.c \ + ../backend/svg.c \ + ../backend/telepen.c \ + ../backend/tif.c \ + ../backend/ultra.c \ + ../backend/upcean.c \ + ../backend/vector.c \ + ../backend/dllversion.c \ + qzint.cpp + +VERSION = 2.9.1.9 + +#DESTDIR = . + +#include.path = $$[ZINT_INSTALL_HEADERS] +include.path = inst/include +include.files = ../backend/zint.h qzint.h + +#target.path = $$[ZINT_INSTALL_LIBS] +target.path = inst/lib + +INSTALLS += target include diff --git a/backend_qt/backend_qt_zintdll.pro b/backend_qt/backend_qt_zintdll.pro new file mode 100644 index 00000000..82ff054a --- /dev/null +++ b/backend_qt/backend_qt_zintdll.pro @@ -0,0 +1,13 @@ +TEMPLATE = lib + +CONFIG += staticlib + +TARGET = QtZintDLL + +INCLUDEPATH += ../backend + +LIBS += -L"../win32/Release" -lzint + +HEADERS += qzint.h + +SOURCES += qzint.cpp diff --git a/backend_qt/backend_vc8.pro b/backend_qt/backend_vc8.pro new file mode 100644 index 00000000..360ca518 --- /dev/null +++ b/backend_qt/backend_vc8.pro @@ -0,0 +1,97 @@ +win32 { + TEMPLATE = vclib + CONFIG += staticlib debug-and-release +} + +TARGET = QtZint2 +VERSION = 2.9.1.9 + +QMAKE_CFLAGS += /TP /wd4018 /wd4244 /wd4305 +QMAKE_CXXFLAGS += /TP /wd4018 /wd4244 /wd4305 + +INCLUDEPATH += ../backend d:\\opt\\include + +DEFINES += _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS ZINT_VERSION=\\\"$$VERSION\\\" include="" + +!contains(DEFINES, NO_PNG) { + SOURCES += ../backend/png.c +} + +HEADERS += ../backend/aztec.h \ + ../backend/bmp.h \ + ../backend/channel_precalcs.h \ + ../backend/code1.h \ + ../backend/code128.h \ + ../backend/code49.h \ + ../backend/common.h \ + ../backend/composite.h \ + ../backend/dmatrix.h \ + ../backend/eci.h \ + ../backend/emf.h \ + ../backend/font.h \ + ../backend/gb18030.h \ + ../backend/gb2312.h \ + ../backend/general_field.h \ + ../backend/gridmtx.h \ + ../backend/gs1.h \ + ../backend/hanxin.h \ + ../backend/large.h \ + ../backend/maxicode.h \ + ../backend/ms_stdint.h \ + ../backend/output.h \ + ../backend/pcx.h \ + ../backend/pdf417.h \ + ../backend/qr.h \ + ../backend/reedsol.h \ + ../backend/rss.h \ + ../backend/sjis.h \ + ../backend/tif.h \ + ../backend/zint.h \ + qzint.h + +SOURCES += ../backend/2of5.c \ + ../backend/auspost.c \ + ../backend/aztec.c \ + ../backend/bmp.c \ + ../backend/codablock.c \ + ../backend/code.c \ + ../backend/code1.c \ + ../backend/code128.c \ + ../backend/code16k.c \ + ../backend/code49.c \ + ../backend/common.c \ + ../backend/composite.c \ + ../backend/dmatrix.c \ + ../backend/dotcode.c \ + ../backend/eci.c \ + ../backend/emf.c \ + ../backend/gb18030.c \ + ../backend/gb2312.c \ + ../backend/gridmtx.c \ + ../backend/general_field.c \ + ../backend/gif.c \ + ../backend/gs1.c \ + ../backend/hanxin.c \ + ../backend/imail.c \ + ../backend/large.c \ + ../backend/library.c \ + ../backend/mailmark.c \ + ../backend/maxicode.c \ + ../backend/medical.c \ + ../backend/output.c \ + ../backend/pcx.c \ + ../backend/pdf417.c \ + ../backend/plessey.c \ + ../backend/postal.c \ + ../backend/ps.c \ + ../backend/qr.c \ + ../backend/raster.c \ + ../backend/reedsol.c \ + ../backend/rss.c \ + ../backend/svg.c \ + ../backend/telepen.c \ + ../backend/tif.c \ + ../backend/ultra.c \ + ../backend/upcean.c \ + ../backend/vector.c \ + qzint.cpp diff --git a/frontend_qt/qzint.cpp b/backend_qt/qzint.cpp similarity index 97% rename from frontend_qt/qzint.cpp rename to backend_qt/qzint.cpp index 2f39c5f1..ac4e0d63 100644 --- a/frontend_qt/qzint.cpp +++ b/backend_qt/qzint.cpp @@ -341,6 +341,15 @@ namespace Zint { m_debug = debug; } + /* Legacy */ + void QZint::setWidth(int width) { setOption1(width); } + int QZint::width() const { return m_option_1; } + void QZint::setSecurityLevel(int securityLevel) { setOption2(securityLevel); } + int QZint::securityLevel() const { return m_option_2; } + void QZint::setPdf417CodeWords(int /*pdf417CodeWords*/) {} + int QZint::pdf417CodeWords() const { return 0; } + void QZint::setHideText(bool hide) { setShowText(!hide); } + bool QZint::hasHRT(int symbology) const { return ZBarcode_Cap(symbology ? symbology : m_symbol, ZINT_CAP_HRT); } diff --git a/frontend_qt/qzint.h b/backend_qt/qzint.h similarity index 93% rename from frontend_qt/qzint.h rename to backend_qt/qzint.h index c591cdcc..aa8580d0 100644 --- a/frontend_qt/qzint.h +++ b/backend_qt/qzint.h @@ -105,6 +105,15 @@ public: void setDebug(bool debug); + /* Legacy */ + void setWidth(int width); /* option_1 */ + int width() const; + void setSecurityLevel(int securityLevel); /* option_2 */ + int securityLevel() const; + void setPdf417CodeWords(int pdf417CodeWords); /* no op */ + int pdf417CodeWords() const; + void setHideText(bool hide); /* setShowText(!hide) */ + bool hasHRT(int symbology = 0) const; bool isExtendable(int symbology = 0) const; bool supportsECI(int symbology = 0) const; diff --git a/cmake/modules/FindZint.cmake b/cmake/modules/FindZint.cmake index 41c38328..6cf47563 100644 --- a/cmake/modules/FindZint.cmake +++ b/cmake/modules/FindZint.cmake @@ -1,5 +1,5 @@ -# - Find Zint -# Find the native Zint includes and library +# - Find Zint and QZint +# Find the native Zint and QZint includes and library # # ZINT_INCLUDE_DIR - where to find zint.h, etc. # ZINT_LIBRARIES - List of libraries when using zint. @@ -19,7 +19,7 @@ FIND_PATH(ZINT_INCLUDE_DIR zint.h) FIND_LIBRARY(ZINT_LIBRARY NAMES zint ) -# handle the QUIETLY and REQUIRED arguments and set ZINT_FOUND to TRUE if +# handle the QUIETLY and REQUIRED arguments and set ZINT_FOUND to TRUE if # all listed variables are TRUE INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Zint DEFAULT_MSG ZINT_LIBRARY ZINT_INCLUDE_DIR) @@ -31,3 +31,27 @@ ELSE(ZINT_FOUND) ENDIF(ZINT_FOUND) MARK_AS_ADVANCED( ZINT_LIBRARY ZINT_INCLUDE_DIR ) + +################### FIND QZINT ###################### + +IF (QZINT_INCLUDE_DIR) + # Already in cache, be silent + SET(QZINT_FIND_QUIETLY TRUE) +ENDIF (QZINT_INCLUDE_DIR) + +FIND_PATH(QZINT_INCLUDE_DIR qzint.h) + +FIND_LIBRARY(QZINT_LIBRARY NAMES QZint ) + +# handle the QUIETLY and REQUIRED arguments and set QZINT_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(QZint DEFAULT_MSG QZINT_LIBRARY QZINT_INCLUDE_DIR) + +IF(QZINT_FOUND) + SET( QZINT_LIBRARIES ${QZINT_LIBRARY} ) +ELSE(QZINT_FOUND) + SET( QZINT_LIBRARIES ) +ENDIF(QZINT_FOUND) + +MARK_AS_ADVANCED( QZINT_LIBRARY QZINT_INCLUDE_DIR ) diff --git a/frontend_qt/CMakeLists.txt b/frontend_qt/CMakeLists.txt index b884a93b..35456024 100644 --- a/frontend_qt/CMakeLists.txt +++ b/frontend_qt/CMakeLists.txt @@ -1,18 +1,19 @@ -# (c) 2008 by BogDan Vatra < bogdan@licentia.eu > +# Copyright (C) 2008 by BogDan Vatra < bogdan@licentia.eu > +# Copyright (C) 2009-2021 Robin Stuart # vim: set ts=4 sw=4 et : project(zint-qt) -include_directories(BEFORE "${CMAKE_SOURCE_DIR}/backend") +include_directories(BEFORE "${CMAKE_SOURCE_DIR}/backend" "${CMAKE_SOURCE_DIR}/backend_qt") -set(zint-qt_SRCS barcodeitem.cpp main.cpp mainwindow.cpp datawindow.cpp sequencewindow.cpp exportwindow.cpp qzint.cpp) +set(zint-qt_SRCS barcodeitem.cpp main.cpp mainwindow.cpp datawindow.cpp sequencewindow.cpp exportwindow.cpp) if(USE_QT6) - qt6_wrap_cpp(zint-qt_SRCS mainwindow.h datawindow.h sequencewindow.h exportwindow.h qzint.h) + qt6_wrap_cpp(zint-qt_SRCS mainwindow.h datawindow.h sequencewindow.h exportwindow.h) qt6_wrap_ui(zint-qt_SRCS mainWindow.ui extData.ui extSequence.ui extExport.ui) qt6_add_resources(zint-qt_SRCS resources.qrc) else() - qt5_wrap_cpp(zint-qt_SRCS mainwindow.h datawindow.h sequencewindow.h exportwindow.h qzint.h) + qt5_wrap_cpp(zint-qt_SRCS mainwindow.h datawindow.h sequencewindow.h exportwindow.h) qt5_wrap_ui(zint-qt_SRCS mainWindow.ui extData.ui extSequence.ui extExport.ui) qt5_add_resources(zint-qt_SRCS resources.qrc) endif() @@ -23,14 +24,14 @@ endif() # grpC25.ui grpCodablockF.ui grpDotCode.ui grpMicroPDF.ui grpRMQR.ui add_executable(zint-qt ${zint-qt_SRCS}) -add_dependencies(zint-qt zint) +add_dependencies(zint-qt zint QZint) -link_directories( "${CMAKE_BINARY_DIR}/backend" ) +link_directories("${CMAKE_BINARY_DIR}/backend" "${CMAKE_BINARY_DIR}/backend_qt") if(USE_QT6) - target_link_libraries(zint-qt zint Qt6::UiTools Qt6::Xml Qt6::Gui Qt6::Core) + target_link_libraries(zint-qt zint QZint Qt6::UiTools Qt6::Xml Qt6::Gui Qt6::Core) else() - target_link_libraries(zint-qt zint Qt5::UiTools Qt5::Xml Qt5::Gui Qt5::Core) + target_link_libraries(zint-qt zint QZint Qt5::UiTools Qt5::Xml Qt5::Gui Qt5::Core) endif() install(TARGETS zint-qt DESTINATION "${BIN_INSTALL_DIR}" RUNTIME) diff --git a/frontend_qt/barcodeitem.cpp b/frontend_qt/barcodeitem.cpp index 5bb34480..170c3e42 100644 --- a/frontend_qt/barcodeitem.cpp +++ b/frontend_qt/barcodeitem.cpp @@ -13,16 +13,17 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ +/* vim: set ts=4 sw=4 et : */ #include #include "barcodeitem.h" BarcodeItem::BarcodeItem() - : QGraphicsItem() + : QGraphicsItem() { - w=693; - h=378; // Default widget size when created - ar = Zint::QZint::AspectRatioMode::IgnoreAspectRatio; + w = 693; + h = 378; // Default widget size when created + ar = Zint::QZint::AspectRatioMode::IgnoreAspectRatio; } BarcodeItem::~BarcodeItem() @@ -36,12 +37,12 @@ void BarcodeItem::setSize(int width, int height) { QRectF BarcodeItem::boundingRect() const { - return QRectF(0, 0, w, h); + return QRectF(0, 0, w, h); } -void BarcodeItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/) +void BarcodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/) { - bc.render(*painter,boundingRect(),ar); + bc.render(*painter, boundingRect(), ar); } diff --git a/frontend_qt/barcodeitem.h b/frontend_qt/barcodeitem.h index 0e1ce907..bde5ab17 100644 --- a/frontend_qt/barcodeitem.h +++ b/frontend_qt/barcodeitem.h @@ -13,12 +13,13 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ +/* vim: set ts=4 sw=4 et : */ #ifndef BARCODEITEM_H #define BARCODEITEM_H #include -#include "qzint.h" +#include /** @author BogDan Vatra @@ -27,18 +28,18 @@ class BarcodeItem : public QGraphicsItem { public: - BarcodeItem(); - ~BarcodeItem(); - void setSize(int width, int height); - QRectF boundingRect() const; - void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); + BarcodeItem(); + ~BarcodeItem(); + void setSize(int width, int height); + QRectF boundingRect() const; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); private: - int w, h; + int w, h; public: - mutable Zint::QZint bc; - Zint::QZint::AspectRatioMode ar; + mutable Zint::QZint bc; + Zint::QZint::AspectRatioMode ar; }; #endif diff --git a/frontend_qt/frontend_qt.pro b/frontend_qt/frontend_qt.pro index 147cc5d4..24b9a174 100644 --- a/frontend_qt/frontend_qt.pro +++ b/frontend_qt/frontend_qt.pro @@ -3,6 +3,7 @@ TARGET = qtZint DEPENDPATH += . debug release INCLUDEPATH += . INCLUDEPATH += ../backend +INCLUDEPATH += ../backend_qt !contains(DEFINES, NO_PNG) { INCLUDEPATH += ../../lpng INCLUDEPATH += ../../zlib @@ -17,46 +18,7 @@ HEADERS += barcodeitem.h \ datawindow.h \ exportwindow.h \ mainwindow.h \ - sequencewindow.h \ - qzint.h \ - ..\backend\aztec.h \ - ..\backend\big5.h \ - ..\backend\bmp.h \ - ..\backend\channel_precalcs.h \ - ..\backend\code1.h \ - ..\backend\code128.h \ - ..\backend\code49.h \ - ..\backend\common.h \ - ..\backend\composite.h \ - ..\backend\dmatrix.h \ - ..\backend\eci.h \ - ..\backend\eci_sb.h \ - ..\backend\emf.h \ - ..\backend\font.h \ - ..\backend\gb18030.h \ - ..\backend\gb2312.h \ - ..\backend\general_field.h \ - ..\backend\gridmtx.h \ - ..\backend\gs1.h \ - ..\backend\hanxin.h \ - ..\backend\ksx1001.h \ - ..\backend\large.h \ - ..\backend\maxicode.h \ - ..\backend\ms_stdint.h \ - ..\backend\output.h \ - ..\backend\pcx.h \ - ..\backend\pdf417.h \ - ..\backend\qr.h \ - ..\backend\reedsol.h \ - ..\backend\reedsol_logs.h \ - ..\backend\rss.h \ - ..\backend\sjis.h \ - ..\backend\stdint_msvc.h \ - ..\backend\tif.h \ - ..\backend\tif_lzw.h \ - ..\backend\zfiletypes.h \ - ..\backend\zint.h \ - ..\backend\zintconfig.h \ + sequencewindow.h FORMS += extData.ui \ extExport.ui \ @@ -70,8 +32,8 @@ FORMS += extData.ui \ grpC49.ui \ grpChannel.ui \ grpCodabar.ui \ - grpCodeOne.ui \ grpCodablockF.ui \ + grpCodeOne.ui \ grpDAFT.ui \ grpDBExtend.ui \ grpDM.ui \ @@ -86,6 +48,7 @@ FORMS += extData.ui \ grpPDF417.ui \ grpQR.ui \ grpRMQR.ui \ + grpUltra.ui \ grpUPCA.ui \ grpUPCEAN.ui \ grpVIN.ui \ @@ -96,56 +59,7 @@ SOURCES += barcodeitem.cpp \ exportwindow.cpp \ main.cpp \ mainwindow.cpp \ - sequencewindow.cpp \ - qzint.cpp \ - ..\backend\2of5.c \ - ..\backend\auspost.c \ - ..\backend\aztec.c \ - ..\backend\bmp.c \ - ..\backend\codablock.c \ - ..\backend\code.c \ - ..\backend\code1.c \ - ..\backend\code128.c \ - ..\backend\code16k.c \ - ..\backend\code49.c \ - ..\backend\common.c \ - ..\backend\composite.c \ - ..\backend\dllversion.c \ - ..\backend\dmatrix.c \ - ..\backend\dotcode.c \ - ..\backend\eci.c \ - ..\backend\emf.c \ - ..\backend\gb18030.c \ - ..\backend\gb2312.c \ - ..\backend\general_field.c \ - ..\backend\gif.c \ - ..\backend\gridmtx.c \ - ..\backend\gs1.c \ - ..\backend\hanxin.c \ - ..\backend\imail.c \ - ..\backend\large.c \ - ..\backend\library.c \ - ..\backend\mailmark.c \ - ..\backend\maxicode.c \ - ..\backend\medical.c \ - ..\backend\output.c \ - ..\backend\pcx.c \ - ..\backend\pdf417.c \ - ..\backend\plessey.c \ - ..\backend\png.c \ - ..\backend\postal.c \ - ..\backend\ps.c \ - ..\backend\qr.c \ - ..\backend\raster.c \ - ..\backend\reedsol.c \ - ..\backend\rss.c \ - ..\backend\sjis.c \ - ..\backend\svg.c \ - ..\backend\telepen.c \ - ..\backend\tif.c \ - ..\backend\ultra.c \ - ..\backend\upcean.c \ - ..\backend\vector.c + sequencewindow.cpp TRANSLATIONS = frontend_de.ts @@ -158,10 +72,10 @@ CONFIG += static CONFIG += warn_on thread qt -INCLUDEPATH += ../backend - +LIBS += -lQtZint +QMAKE_LIBDIR += ../backend_qt/release LIBS += -lQt5Core -QMAKE_LIBDIR += C:/qt/5.15.1static/lib +QMAKE_LIBDIR += C:/qt/5.15.2static/lib !contains(DEFINES, NO_PNG) { # Win diff --git a/frontend_qt/frontend_qt_zintdll.pro b/frontend_qt/frontend_qt_zintdll.pro index 851f1726..1c68dcb0 100644 --- a/frontend_qt/frontend_qt_zintdll.pro +++ b/frontend_qt/frontend_qt_zintdll.pro @@ -8,8 +8,7 @@ HEADERS += barcodeitem.h \ datawindow.h \ exportwindow.h \ mainwindow.h \ - sequencewindow.h \ - qzint.h + sequencewindow.h FORMS += extData.ui \ extExport.ui \ @@ -39,6 +38,7 @@ FORMS += extData.ui \ grpPDF417.ui \ grpQR.ui \ grpRMQR.ui \ + grpUltra.ui \ grpUPCA.ui \ grpUPCEAN.ui \ grpVIN.ui \ @@ -49,14 +49,14 @@ SOURCES += barcodeitem.cpp \ exportwindow.cpp \ main.cpp \ mainwindow.cpp \ - sequencewindow.cpp \ - qzint.cpp - + sequencewindow.cpp + RESOURCES += resources.qrc RC_FILE += res/qtZint.rc -INCLUDEPATH += ../backend +INCLUDEPATH += ../backend_qt ../backend -LIBS += -lzint +LIBS += -lQtZintDLL -lzint +QMAKE_LIBDIR += ../backend_qt/release QMAKE_LIBDIR += ../win32/Release diff --git a/frontend_qt/howto_build_qzint_using_msvs2015.txt b/frontend_qt/howto_build_qzint_using_msvs2015.txt index afec89c1..4b8d6f1a 100644 --- a/frontend_qt/howto_build_qzint_using_msvs2015.txt +++ b/frontend_qt/howto_build_qzint_using_msvs2015.txt @@ -1,23 +1,24 @@ Harald Oehlmann -2020-01-05 +2021-06-24 How to build qzint.exe using: -- QT 5.15.0 source package -- MS Visual Studio 2015 (VC12) +- QT 5.15.2 source package +- MS Visual Studio 2015 (VC14) Build static Qt: --------------- - Go to: https://www.qt.io/offline-installers - Download the zip "Qt 5.15.x source packages" (nearly 1 GB): - http://download.qt.io/official_releases/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.zip -- Unzip to C:\qt resulting in having the source in c:\qt\qt-everywhere-src-5.15.0 -- Install Python (ActivePython-3.7.4.0000-win64-x64-e0b99d60.msi) and make it available within the path. + http://download.qt.io/official_releases/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.zip +- Unzip to C:\qt resulting in having the source in c:\qt\qt-everywhere-src-5.15.2 +- Install Python (https://www.python.org/downloads/windows/) and make it available within the path. - Start the VS2015 x86 native console by the start menu entry: Visual Studio 2015\Visual Studio Tools\Windows Desktop Command Prompts\VS2015 x86 Native Tools-Eingabeaufforderung + ("Eingabeaufforderung" = "Command Prompt") -- cd C:\qt\qt-everywhere-src-5.15.0 -- configure.bat -static -release -prefix c:\qt\5.15.0static -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-openssl -opensource -confirm-license -make libs -nomake tools -nomake examples -nomake tests -mp +- cd C:\qt\qt-everywhere-src-5.15.2 +- configure.bat -static -release -prefix c:\qt\5.15.2static -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-openssl -opensource -confirm-license -make libs -nomake tools -nomake examples -nomake tests -mp One may set another destination folder after the -prefix option. Attention, the upper command is one long line. - nmake @@ -45,22 +46,31 @@ Build targets "Release Library" for zlib and libpng. Build zint: ----------- - Start in the start menu: "VS2015 x86 Native Tools-Eingabeaufforderung" -- set QTDIR=C:\Qt\5.15.0static -- set PATH=C:\Qt\5.15.0static\bin;%PATH% +- set QTDIR=C:\Qt\5.15.2static +- set PATH=C:\Qt\5.15.2static\bin;%PATH% - set QMAKESPEC=win32-msvc - cd $ZH -- cd frontend_qt + +Note: if "rc.exe" not available, install a Windows Kit and update PATH (e.g.): +- set "PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86;%PATH%" + +- cd backend_qt +- qmake backend_qt.pro +- nmake clean +- nmake release + +- cd ..\frontend_qt - qmake frontend_qt.pro - nmake clean - nmake release - -> qzint.exe is in the release folder + -> qtZint.exe is in the release folder Note: For me, qt5core.lib was not found in the last step. I only found the solution to add: -QMAKE_LIBDIR += C:/qt/5.15.0static/lib +QMAKE_LIBDIR += C:/qt/5.15.2static/lib into frontend_qt.pro -There is for sure a better solution. \ No newline at end of file +There is for sure a better solution. diff --git a/tools/update_version.php b/tools/update_version.php index bb6c4769..cb8be72b 100644 --- a/tools/update_version.php +++ b/tools/update_version.php @@ -205,6 +205,15 @@ rc_replace($data_dirname . 'frontend/zint.rc', $rc_str); version_replace(1, $data_dirname . 'frontend/Makefile.mingw', '/^ZINT_VERSION:=-DZINT_VERSION=/', '/[0-9.]+/', $v_str); +// backend_qt/backend_vc8.pro + +version_replace(1, $data_dirname . 'backend_qt/backend_vc8.pro', '/^VERSION[ \t]*=/', '/[0-9.]+/', $v_str); +- +// backend_qt/backend_qt.pro + +version_replace(1, $data_dirname . 'backend_qt/backend_qt.pro', '/ZINT_VERSION="/', '/[0-9.]+/', $v_str); +version_replace(1, $data_dirname . 'backend_qt/backend_qt.pro', '/^VERSION[ \t]*=/', '/[0-9.]+/', $v_str); + // frontend_qt/res/qtZint.rc rc_replace($data_dirname . 'frontend_qt/res/qtZint.rc', $rc_str); @@ -221,6 +230,10 @@ version_replace(2, $data_dirname . 'win32/zint.vcxproj', '/ZINT_VERSION="/', '/Z rc_replace($data_dirname . 'win32/zint_cmdline_vc6/zint.rc', $rc_str); +// win32/zint_cmdline_vc6/zint_cmdline_vc6.dsp + +version_replace(2, $data_dirname . 'win32/zint_cmdline_vc6/zint_cmdline_vc6.dsp', '/ZINT_VERSION="/', '/ZINT_VERSION="\\\\"[0-9.]+\\\\""/', 'ZINT_VERSION="\\"' . $v_str . '\\""'); + // win32/vs2008/libzint.vcproj version_replace(3, $data_dirname . 'win32/vs2008/libzint.vcproj', '/ZINT_VERSION="/', '/"[0-9.]+/', '"' . $v_str); diff --git a/win32/README b/win32/README index b6efb7cb..81a7a565 100644 --- a/win32/README +++ b/win32/README @@ -67,7 +67,17 @@ may differ): set "PATH=C:\Qt\5.14.2\msvc2017\bin;%PATH%" -Then build Zint Studio "qtZint.exe": +Next build the Zint backend Qt library "QtZintDLL.lib": + + cd zint\backend_qt + + qmake backend_qt_zintdll.pro + nmake clean + nmake release + + cd ..\.. + +Then Zint Studio "qtZint.exe": cd zint\frontend_qt @@ -275,6 +285,7 @@ This creates: zint/build/backend/libzint.dll zint/build/frontend/zint.exe +zint/build/backend_qt/libQZint.lib zint/build/frontend_qt/zint-qt.exe The Zint command line tool "zint.exe" and Zint Studio "zint-qt.exe" need diff --git a/win32/zint_cmdline_vc6/zint_cmdline_vc6.dsp b/win32/zint_cmdline_vc6/zint_cmdline_vc6.dsp index f8b37631..0cc6f51a 100644 --- a/win32/zint_cmdline_vc6/zint_cmdline_vc6.dsp +++ b/win32/zint_cmdline_vc6/zint_cmdline_vc6.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\backend" /I "..\..\..\zlib" /I "..\..\..\lpng" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /D ZINT_VERSION="\"2.6.7\"" /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\backend" /I "..\..\..\zlib" /I "..\..\..\lpng" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /D ZINT_VERSION="\"2.9.1.9\"" /c # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe @@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\backend" /I "..\..\..\lpng" /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "NO_PNG" /D "DEBUG" /YX /FD /GZ /D ZINT_VERSION="\"2.6\"" /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\backend" /I "..\..\..\lpng" /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "NO_PNG" /D "DEBUG" /YX /FD /GZ /D ZINT_VERSION="\"2.9.1.9\"" /c # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe