Restore backend_qt - static only now; qzint: legacy support for renamed methods

This commit is contained in:
gitlost 2021-06-24 18:31:08 +01:00
parent 70801d8932
commit 54947fb435
17 changed files with 415 additions and 146 deletions

View File

@ -115,6 +115,7 @@ elseif($ENV{CMAKE_PREFIX_PATH} MATCHES "6[.][0-9][.][0-9]")
find_package(Qt6Xml) find_package(Qt6Xml)
if(Qt6Widgets_FOUND AND Qt6Gui_FOUND AND Qt6UiTools_FOUND AND Qt6Xml_FOUND) if(Qt6Widgets_FOUND AND Qt6Gui_FOUND AND Qt6UiTools_FOUND AND Qt6Xml_FOUND)
add_subdirectory(backend_qt)
add_subdirectory(frontend_qt) add_subdirectory(frontend_qt)
else() else()
message(STATUS "Could NOT find Qt6") message(STATUS "Could NOT find Qt6")
@ -127,6 +128,7 @@ else()
find_package(Qt5Xml) find_package(Qt5Xml)
if(Qt5Widgets_FOUND AND Qt5Gui_FOUND AND Qt5UiTools_FOUND AND Qt5Xml_FOUND) if(Qt5Widgets_FOUND AND Qt5Gui_FOUND AND Qt5UiTools_FOUND AND Qt5Xml_FOUND)
add_subdirectory(backend_qt)
add_subdirectory(frontend_qt) add_subdirectory(frontend_qt)
else() else()
message(STATUS "Could NOT find Qt5") message(STATUS "Could NOT find Qt5")

33
backend_qt/CMakeLists.txt Normal file
View File

@ -0,0 +1,33 @@
# Copyright (C) 2008 by BogDan Vatra < bogdan@licentia.eu >
# Copyright (C) 2009-2021 Robin Stuart <rstuart114@gmail.com>
# 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)

131
backend_qt/backend_qt.pro Normal file
View File

@ -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

View File

@ -0,0 +1,13 @@
TEMPLATE = lib
CONFIG += staticlib
TARGET = QtZintDLL
INCLUDEPATH += ../backend
LIBS += -L"../win32/Release" -lzint
HEADERS += qzint.h
SOURCES += qzint.cpp

View File

@ -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

View File

@ -341,6 +341,15 @@ namespace Zint {
m_debug = debug; 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 { bool QZint::hasHRT(int symbology) const {
return ZBarcode_Cap(symbology ? symbology : m_symbol, ZINT_CAP_HRT); return ZBarcode_Cap(symbology ? symbology : m_symbol, ZINT_CAP_HRT);
} }

View File

@ -105,6 +105,15 @@ public:
void setDebug(bool debug); 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 hasHRT(int symbology = 0) const;
bool isExtendable(int symbology = 0) const; bool isExtendable(int symbology = 0) const;
bool supportsECI(int symbology = 0) const; bool supportsECI(int symbology = 0) const;

View File

@ -1,5 +1,5 @@
# - Find Zint # - Find Zint and QZint
# Find the native Zint includes and library # Find the native Zint and QZint includes and library
# #
# ZINT_INCLUDE_DIR - where to find zint.h, etc. # ZINT_INCLUDE_DIR - where to find zint.h, etc.
# ZINT_LIBRARIES - List of libraries when using zint. # ZINT_LIBRARIES - List of libraries when using zint.
@ -31,3 +31,27 @@ ELSE(ZINT_FOUND)
ENDIF(ZINT_FOUND) ENDIF(ZINT_FOUND)
MARK_AS_ADVANCED( ZINT_LIBRARY ZINT_INCLUDE_DIR ) 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 )

View File

@ -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 <rstuart114@gmail.com>
# vim: set ts=4 sw=4 et : # vim: set ts=4 sw=4 et :
project(zint-qt) 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) 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_wrap_ui(zint-qt_SRCS mainWindow.ui extData.ui extSequence.ui extExport.ui)
qt6_add_resources(zint-qt_SRCS resources.qrc) qt6_add_resources(zint-qt_SRCS resources.qrc)
else() 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_wrap_ui(zint-qt_SRCS mainWindow.ui extData.ui extSequence.ui extExport.ui)
qt5_add_resources(zint-qt_SRCS resources.qrc) qt5_add_resources(zint-qt_SRCS resources.qrc)
endif() endif()
@ -23,14 +24,14 @@ endif()
# grpC25.ui grpCodablockF.ui grpDotCode.ui grpMicroPDF.ui grpRMQR.ui # grpC25.ui grpCodablockF.ui grpDotCode.ui grpMicroPDF.ui grpRMQR.ui
add_executable(zint-qt ${zint-qt_SRCS}) 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) 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() 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() endif()
install(TARGETS zint-qt DESTINATION "${BIN_INSTALL_DIR}" RUNTIME) install(TARGETS zint-qt DESTINATION "${BIN_INSTALL_DIR}" RUNTIME)

View File

@ -13,6 +13,7 @@
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. * * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/ ***************************************************************************/
/* vim: set ts=4 sw=4 et : */
#include <QDebug> #include <QDebug>
#include "barcodeitem.h" #include "barcodeitem.h"
@ -20,8 +21,8 @@
BarcodeItem::BarcodeItem() BarcodeItem::BarcodeItem()
: QGraphicsItem() : QGraphicsItem()
{ {
w=693; w = 693;
h=378; // Default widget size when created h = 378; // Default widget size when created
ar = Zint::QZint::AspectRatioMode::IgnoreAspectRatio; ar = Zint::QZint::AspectRatioMode::IgnoreAspectRatio;
} }
@ -39,9 +40,9 @@ 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);
} }

View File

@ -13,12 +13,13 @@
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. * * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/ ***************************************************************************/
/* vim: set ts=4 sw=4 et : */
#ifndef BARCODEITEM_H #ifndef BARCODEITEM_H
#define BARCODEITEM_H #define BARCODEITEM_H
#include <QGraphicsItem> #include <QGraphicsItem>
#include "qzint.h" #include <qzint.h>
/** /**
@author BogDan Vatra <taipan@licentia.eu> @author BogDan Vatra <taipan@licentia.eu>
@ -31,7 +32,7 @@ public:
~BarcodeItem(); ~BarcodeItem();
void setSize(int width, int height); void setSize(int width, int height);
QRectF boundingRect() const; QRectF boundingRect() const;
void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
private: private:
int w, h; int w, h;

View File

@ -3,6 +3,7 @@ TARGET = qtZint
DEPENDPATH += . debug release DEPENDPATH += . debug release
INCLUDEPATH += . INCLUDEPATH += .
INCLUDEPATH += ../backend INCLUDEPATH += ../backend
INCLUDEPATH += ../backend_qt
!contains(DEFINES, NO_PNG) { !contains(DEFINES, NO_PNG) {
INCLUDEPATH += ../../lpng INCLUDEPATH += ../../lpng
INCLUDEPATH += ../../zlib INCLUDEPATH += ../../zlib
@ -17,46 +18,7 @@ HEADERS += barcodeitem.h \
datawindow.h \ datawindow.h \
exportwindow.h \ exportwindow.h \
mainwindow.h \ mainwindow.h \
sequencewindow.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 \
FORMS += extData.ui \ FORMS += extData.ui \
extExport.ui \ extExport.ui \
@ -70,8 +32,8 @@ FORMS += extData.ui \
grpC49.ui \ grpC49.ui \
grpChannel.ui \ grpChannel.ui \
grpCodabar.ui \ grpCodabar.ui \
grpCodeOne.ui \
grpCodablockF.ui \ grpCodablockF.ui \
grpCodeOne.ui \
grpDAFT.ui \ grpDAFT.ui \
grpDBExtend.ui \ grpDBExtend.ui \
grpDM.ui \ grpDM.ui \
@ -86,6 +48,7 @@ FORMS += extData.ui \
grpPDF417.ui \ grpPDF417.ui \
grpQR.ui \ grpQR.ui \
grpRMQR.ui \ grpRMQR.ui \
grpUltra.ui \
grpUPCA.ui \ grpUPCA.ui \
grpUPCEAN.ui \ grpUPCEAN.ui \
grpVIN.ui \ grpVIN.ui \
@ -96,56 +59,7 @@ SOURCES += barcodeitem.cpp \
exportwindow.cpp \ exportwindow.cpp \
main.cpp \ main.cpp \
mainwindow.cpp \ mainwindow.cpp \
sequencewindow.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
TRANSLATIONS = frontend_de.ts TRANSLATIONS = frontend_de.ts
@ -158,10 +72,10 @@ CONFIG += static
CONFIG += warn_on thread qt CONFIG += warn_on thread qt
INCLUDEPATH += ../backend LIBS += -lQtZint
QMAKE_LIBDIR += ../backend_qt/release
LIBS += -lQt5Core LIBS += -lQt5Core
QMAKE_LIBDIR += C:/qt/5.15.1static/lib QMAKE_LIBDIR += C:/qt/5.15.2static/lib
!contains(DEFINES, NO_PNG) { !contains(DEFINES, NO_PNG) {
# Win # Win

View File

@ -8,8 +8,7 @@ HEADERS += barcodeitem.h \
datawindow.h \ datawindow.h \
exportwindow.h \ exportwindow.h \
mainwindow.h \ mainwindow.h \
sequencewindow.h \ sequencewindow.h
qzint.h
FORMS += extData.ui \ FORMS += extData.ui \
extExport.ui \ extExport.ui \
@ -39,6 +38,7 @@ FORMS += extData.ui \
grpPDF417.ui \ grpPDF417.ui \
grpQR.ui \ grpQR.ui \
grpRMQR.ui \ grpRMQR.ui \
grpUltra.ui \
grpUPCA.ui \ grpUPCA.ui \
grpUPCEAN.ui \ grpUPCEAN.ui \
grpVIN.ui \ grpVIN.ui \
@ -49,14 +49,14 @@ SOURCES += barcodeitem.cpp \
exportwindow.cpp \ exportwindow.cpp \
main.cpp \ main.cpp \
mainwindow.cpp \ mainwindow.cpp \
sequencewindow.cpp \ sequencewindow.cpp
qzint.cpp
RESOURCES += resources.qrc RESOURCES += resources.qrc
RC_FILE += res/qtZint.rc 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 QMAKE_LIBDIR += ../win32/Release

View File

@ -1,23 +1,24 @@
Harald Oehlmann Harald Oehlmann
2020-01-05 2021-06-24
How to build qzint.exe using: How to build qzint.exe using:
- QT 5.15.0 source package - QT 5.15.2 source package
- MS Visual Studio 2015 (VC12) - MS Visual Studio 2015 (VC14)
Build static Qt: Build static Qt:
--------------- ---------------
- Go to: https://www.qt.io/offline-installers - Go to: https://www.qt.io/offline-installers
- Download the zip "Qt 5.15.x source packages" (nearly 1 GB): - 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 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.0 - Unzip to C:\qt resulting in having the source in c:\qt\qt-everywhere-src-5.15.2
- Install Python (ActivePython-3.7.4.0000-win64-x64-e0b99d60.msi) and make it available within the path. - 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: - 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 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 - cd C:\qt\qt-everywhere-src-5.15.2
- 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 - 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. One may set another destination folder after the -prefix option.
Attention, the upper command is one long line. Attention, the upper command is one long line.
- nmake - nmake
@ -45,21 +46,30 @@ Build targets "Release Library" for zlib and libpng.
Build zint: Build zint:
----------- -----------
- Start in the start menu: "VS2015 x86 Native Tools-Eingabeaufforderung" - Start in the start menu: "VS2015 x86 Native Tools-Eingabeaufforderung"
- set QTDIR=C:\Qt\5.15.0static - set QTDIR=C:\Qt\5.15.2static
- set PATH=C:\Qt\5.15.0static\bin;%PATH% - set PATH=C:\Qt\5.15.2static\bin;%PATH%
- set QMAKESPEC=win32-msvc - set QMAKESPEC=win32-msvc
- cd $ZH - 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 - qmake frontend_qt.pro
- nmake clean - nmake clean
- nmake release - nmake release
-> qzint.exe is in the release folder -> qtZint.exe is in the release folder
Note: Note:
For me, qt5core.lib was not found in the last step. For me, qt5core.lib was not found in the last step.
I only found the solution to add: 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 into frontend_qt.pro

View File

@ -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); 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 // frontend_qt/res/qtZint.rc
rc_replace($data_dirname . 'frontend_qt/res/qtZint.rc', $rc_str); 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); 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 // win32/vs2008/libzint.vcproj
version_replace(3, $data_dirname . 'win32/vs2008/libzint.vcproj', '/ZINT_VERSION=&quot;/', '/&quot;[0-9.]+/', '&quot;' . $v_str); version_replace(3, $data_dirname . 'win32/vs2008/libzint.vcproj', '/ZINT_VERSION=&quot;/', '/&quot;[0-9.]+/', '&quot;' . $v_str);

View File

@ -67,7 +67,17 @@ may differ):
set "PATH=C:\Qt\5.14.2\msvc2017\bin;%PATH%" 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 cd zint\frontend_qt
@ -275,6 +285,7 @@ This creates:
zint/build/backend/libzint.dll zint/build/backend/libzint.dll
zint/build/frontend/zint.exe zint/build/frontend/zint.exe
zint/build/backend_qt/libQZint.lib
zint/build/frontend_qt/zint-qt.exe zint/build/frontend_qt/zint-qt.exe
The Zint command line tool "zint.exe" and Zint Studio "zint-qt.exe" need The Zint command line tool "zint.exe" and Zint Studio "zint-qt.exe" need

View File

@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # 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 BASE RSC /l 0x407 /d "NDEBUG"
# ADD RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
@ -66,7 +66,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # 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 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 BASE RSC /l 0x407 /d "_DEBUG"
# ADD RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe