Update to Qt5

This commit is contained in:
Robin Stuart 2016-12-11 15:29:06 +00:00
parent ca88e089ea
commit 0f9a326398
55 changed files with 58 additions and 56 deletions

View File

@ -62,21 +62,28 @@ ENDIF(APPLE)
add_subdirectory(backend)
add_subdirectory(frontend)
find_package(Qt4)
find_package(Qt5Widgets)
find_package(Qt5Gui)
find_package(Qt5UiTools)
if (QT4_FOUND)
set( QT_USE_QTGUI TRUE )
set( QT_USE_QTUITOOLS TRUE )
set( QT_USE_QTXML TRUE )
include( ${QT_USE_FILE} )
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${QT_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
add_subdirectory(backend_qt4)
add_subdirectory(frontend_qt4)
endif(QT4_FOUND)
if (Qt5Widgets_FOUND)
if (Qt5Gui_FOUND)
if (Qt5UiTools_FOUND)
set( QT_USE_QTGUI TRUE )
set( QT_USE_QTUITOOLS TRUE )
set( QT_USE_QTXML TRUE )
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${Qt5Widgets_INCLUDES}
${Qt5Gui_INCLUDES}
${Qt5UiTools_INCLUDES}
${CMAKE_CURRENT_BINARY_DIR}
)
add_subdirectory(backend_qt)
add_subdirectory(frontend_qt)
endif(Qt5UiTools_FOUND)
endif(Qt5Gui_FOUND)
endif(Qt5Widgets_FOUND)
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"

View File

@ -15,8 +15,7 @@ add_dependencies(QZint zint)
link_directories( "${CMAKE_BINARY_DIR}/backend" )
target_link_libraries(QZint zint ${QT_QTGUI_LIBRARY}
${QT_QTCORE_LIBRARY} )
target_link_libraries(QZint zint Qt5::Widgets Qt5::Gui )
install(TARGETS QZint ${INSTALL_TARGETS_DEFAULT_ARGS} )
install(FILES qzint.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)

View File

@ -40,7 +40,7 @@ namespace Zint {
m_input_mode = UNICODE_MODE;
m_scale = 1.0;
m_option_3 = 0;
m_hidetext = FALSE;
m_hidetext = 0;
m_dot_size = 4.0 / 5.0;
}
@ -75,7 +75,7 @@ namespace Zint {
m_zintSymbol->option_3 = m_option_3;
}
QByteArray bstr = m_text.toUtf8();
QByteArray pstr = m_primaryMessage.left(99).toAscii();
QByteArray pstr = m_primaryMessage.left(99).toLatin1();
strcpy(m_zintSymbol->primary, pstr.data());
int error = ZBarcode_Encode(m_zintSymbol, (unsigned char*) bstr.data(), bstr.length());
if (error > ZINT_WARN_INVALID_OPTION)
@ -258,12 +258,12 @@ namespace Zint {
}
m_zintSymbol->scale = m_scale;
QByteArray bstr = m_text.toUtf8();
QByteArray pstr = m_primaryMessage.left(99).toAscii();
QByteArray fstr = filename.left(255).toAscii();
QByteArray pstr = m_primaryMessage.left(99).toLatin1();
QByteArray fstr = filename.left(255).toLatin1();
strcpy(m_zintSymbol->primary, pstr.data());
strcpy(m_zintSymbol->outfile, fstr.data());
QByteArray fgcol = fg_colour_hash.right(6).toAscii();
QByteArray bgcol = bg_colour_hash.right(6).toAscii();
QByteArray fgcol = fg_colour_hash.right(6).toLatin1();
QByteArray bgcol = bg_colour_hash.right(6).toLatin1();
strcpy(m_zintSymbol->fgcolour, fgcol.data());
strcpy(m_zintSymbol->bgcolour, bgcol.data());
int error = ZBarcode_Encode(m_zintSymbol, (unsigned char*) bstr.data(), bstr.length());

View File

@ -2,25 +2,24 @@
project(zint-qt)
include_directories(BEFORE "${CMAKE_SOURCE_DIR}/backend" "${CMAKE_SOURCE_DIR}/backend_qt4")
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)
QT4_WRAP_CPP(zint-qt_SRCS mainwindow.h datawindow.h sequencewindow.h exportwindow.h)
QT5_WRAP_CPP(zint-qt_SRCS mainwindow.h datawindow.h sequencewindow.h exportwindow.h)
QT4_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)
# grpAztec.ui grpC39.ui grpDM.ui grpMSICheck.ui
# grpC128.ui grpChannel.ui grpMicroPDF.ui grpPDF417.ui
# grpC16k.ui grpCodablock.ui grpMQR.ui grpQR.ui
# grpMaxicode.ui)
QT4_ADD_RESOURCES(zint-qt_SRCS resources.qrc)
QT5_ADD_RESOURCES(zint-qt_SRCS resources.qrc)
add_executable(zint-qt ${zint-qt_SRCS})
add_dependencies(zint-qt QZint zint)
link_directories( "${CMAKE_BINARY_DIR}/backend" "${CMAKE_BINARY_DIR}/backend_qt4" )
link_directories( "${CMAKE_BINARY_DIR}/backend" "${CMAKE_BINARY_DIR}/backend_qt" )
target_link_libraries(zint-qt zint QZint ${QT_QTUITOOLS_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTGUI_LIBRARY}
${QT_QTCORE_LIBRARY} )
target_link_libraries(zint-qt zint QZint Qt5::UiTools ${QT_QTXML_LIBRARY} Qt5::Gui Qt5::Core )
install(TARGETS zint-qt DESTINATION "${BIN_INSTALL_DIR}" RUNTIME)

View File

@ -103,7 +103,7 @@ void ExportWindow::process()
for(m = 0; m < dataString.length(); m++) {
name_qchar = dataString[m];
name_char = name_qchar.toAscii();
name_char = name_qchar.toLatin1();
switch(name_char) {
case '\\': url_escaped += "%5C"; break;
@ -141,8 +141,8 @@ void ExportWindow::process()
}
break;
}
barcode->bc.setText(dataString.toAscii().data());
barcode->bc.save_to_file(fileName.toAscii().data());
barcode->bc.setText(dataString.toLatin1().data());
barcode->bc.save_to_file(fileName.toLatin1().data());
inputpos += datalen + 1;
}
close();

View File

@ -1,12 +1,9 @@
######################################################################
# Automatically generated by qmake (2.01a) sub 29. kol 22:15:57 2009
######################################################################
TEMPLATE = app
TARGET = qtZint
DEPENDPATH += . debug release
INCLUDEPATH += .
QT += gui
QT += uitools
# Input
HEADERS += barcodeitem.h \
@ -37,7 +34,7 @@ FORMS += extData.ui \
grpQR.ui \
grpHX.ui \
mainWindow.ui \
grpDotCode.ui
grpDotCode.ui
SOURCES += barcodeitem.cpp \
datawindow.cpp \
@ -57,12 +54,13 @@ CONFIG += warn_on thread qt uitools
INCLUDEPATH += ../backend_qt4 ../backend
LIBS += -lqtzint -lQtCore
LIBS += -lQZint -lQtCore
QMAKE_LIBDIR += ../backend_qt4/release
!contains(DEFINES, NO_PNG) {
LIBS += -llibpng -lzlib
QMAKE_LIBDIR+=../../lpng\projects\visualc71_converted_to_9\Win32_LIB_Release ../../lpng\projects\visualc71_converted_to_9\Win32_LIB_Release\zlib
LIBS += -lpng -zlib
QMAKE_LIBDIR += /usr/local/lib /usr/lib/x86_64-linux-gnu/
# QMAKE_LIBDIR+=../../lpng\projects\visualc71_converted_to_9\Win32_LIB_Release ../../lpng\projects\visualc71_converted_to_9\Win32_LIB_Release\zlib
# LIBS += -llibpng16 -lzlib1
# QMAKE_LIBDIR+=../../lpng\projects\visualc71_converted_to_9\Win32_DLL_Release ../../lpng\projects\visualc71_converted_to_9\Win32_DLL_Release\zlib
}

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 458 B

After

Width:  |  Height:  |  Size: 458 B

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -20,13 +20,16 @@
#include <QColorDialog>
#include <QUiLoader>
#include <QFile>
#include <QRadioButton>
#include <QFileDialog>
#include <QMessageBox>
#include "mainwindow.h"
#include "datawindow.h"
#include "sequencewindow.h"
#include <stdio.h>
MainWindow::MainWindow(QWidget* parent, Qt::WFlags fl)
MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
: QWidget(parent, fl),m_optionWidget(0)
{
@ -172,13 +175,14 @@ bool MainWindow::save()
void MainWindow::about()
{
QMessageBox::about(this, tr("About Zint"),
tr("<h2>Zint Barcode Studio 2.5.1</h2>"
tr("<h2>Zint Barcode Studio 2.5.1</h2>"
"<p>A free barcode generator"
"<p>Instruction manual is available from Sourceforge:"
"<p>http://www.sourceforge.net/projects/zint"
"<p>Copyright &copy; 2006-2016 Robin Stuart.<br>"
"Qt4 code by BogDan Vatra, MS Windows port by \"tgotic\".<br>"
"With thanks to Norbert Szab&oacute;, Robert Elliott,"
"Qt back end by BogDan Vatra, MS Windows port by \"tgotic\"."
"<p>Qt version " QT_VERSION_STR
"<p>With thanks to Norbert Szab&oacute;, Robert Elliott, "
"Harald Oehlmann and many others at Sourceforge."
"<p>Released under the GNU General Public License ver. 3 or later.<br>"
"\"QR Code\" is a Registered Trademark of Denso Corp.<br>"
@ -189,7 +193,8 @@ void MainWindow::about()
"ISO/IEC 16388:2007, ISO/IEC 18004:2006, ISO/IEC 24723:2010,<br>"
"ISO/IEC 24724:2011, ISO/IEC 24728:2006, ISO/IEC 24778:2008,<br>"
"ANSI-HIBC 2.3-2009, ANSI/AIM BC6-2000, ANSI/AIM BC12-1998,<br>"
"AIMD014 (v 1.63), USPS-B-3200</small></td></tr></table>"
"AIMD014 (v 1.63), USPS-B-3200</small></td></tr></table>"
));
}
@ -595,9 +600,9 @@ void MainWindow::update_preview()
m_bc.bc.setSecurityLevel(0);
m_bc.bc.setWidth(0);
m_bc.bc.setInputMode(UNICODE_MODE);
m_bc.bc.setHideText(FALSE);
m_bc.bc.setHideText(0);
if(chkHRTHide->isChecked() == false) {
m_bc.bc.setHideText(TRUE);
m_bc.bc.setHideText(1);
}
switch(metaObject()->enumerator(0).value(bstyle->currentIndex()))
{

View File

@ -105,7 +105,7 @@ public:
};
public:
MainWindow(QWidget* parent = 0, Qt::WFlags fl = 0);
MainWindow(QWidget* parent = 0, Qt::WindowFlags fl = 0);
~MainWindow();

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -73,7 +73,7 @@ QString SequenceWindow::apply_format(QString raw_number)
for(i = format_len; i > 0; i--) {
format_qchar = format[i - 1];
format_char = format_qchar.toAscii();
format_char = format_qchar.toLatin1();
switch(format_char) {
case '#':
if (inpos > 0) {

View File

@ -1,3 +0,0 @@
[Dolphin]
ShowPreview=true
Timestamp=2010,5,29,7,36,6

View File

@ -1,3 +0,0 @@
[Dolphin]
ShowPreview=true
Timestamp=2010,5,29,7,59,30