enumerator(0).keyCount();i++) {
bstyle->addItem(metaObject()->enumerator(0).key(i));
bstyle->setItemText(i,bstyle_text[i]);
}
- bstyle->setCurrentIndex(10);
+ bstyle->setCurrentIndex(settings.value("studio/symbology", 10).toInt());
change_options();
+ scene->addItem(&m_bc);
update_preview();
- view->scene()->addItem(&m_bc);
connect(bstyle, SIGNAL(currentIndexChanged( int )), SLOT(change_options()));
connect(bstyle, SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(heightb, SIGNAL(valueChanged( int )), SLOT(update_preview()));
@@ -136,6 +152,21 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags fl)
MainWindow::~MainWindow()
{
+ QSettings settings;
+
+ settings.setValue("studio/symbology", bstyle->currentIndex());
+ settings.setValue("studio/ink/red", m_fgcolor.red());
+ settings.setValue("studio/ink/green", m_fgcolor.green());
+ settings.setValue("studio/ink/blue", m_fgcolor.blue());
+ settings.setValue("studio/paper/red", m_bgcolor.red());
+ settings.setValue("studio/paper/green", m_bgcolor.green());
+ settings.setValue("studio/paper/blue", m_bgcolor.blue());
+}
+
+void MainWindow::resizeEvent(QResizeEvent* event)
+{
+ QWidget::resizeEvent(event);
+ update_preview();
}
void MainWindow::reset_view()
@@ -172,13 +203,14 @@ bool MainWindow::save()
void MainWindow::about()
{
QMessageBox::about(this, tr("About Zint"),
- tr("Zint Barcode Studio 2.5.1
"
+ tr("Zint Barcode Studio 2.5.1
"
"A free barcode generator"
"
Instruction manual is available from Sourceforge:"
"
http://www.sourceforge.net/projects/zint"
"
Copyright © 2006-2016 Robin Stuart.
"
- "Qt4 code by BogDan Vatra, MS Windows port by \"tgotic\".
"
- "With thanks to Norbert Szabó, Robert Elliott,"
+ "Qt back end by BogDan Vatra, MS Windows port by \"tgotic\"."
+ "
Qt version " QT_VERSION_STR
+ "
With thanks to Norbert Szabó, Robert Elliott, "
"Harald Oehlmann and many others at Sourceforge."
"
Released under the GNU General Public License ver. 3 or later.
"
"\"QR Code\" is a Registered Trademark of Denso Corp.
"
@@ -189,7 +221,8 @@ void MainWindow::about()
"ISO/IEC 16388:2007, ISO/IEC 18004:2006, ISO/IEC 24723:2010,
"
"ISO/IEC 24724:2011, ISO/IEC 24728:2006, ISO/IEC 24778:2008,
"
"ANSI-HIBC 2.3-2009, ANSI/AIM BC6-2000, ANSI/AIM BC12-1998,
"
- "AIMD014 (v 1.63), USPS-B-3200"
+ "AIMD014 (v 1.63), USPS-B-3200"
+
));
}
@@ -583,8 +616,10 @@ void MainWindow::maxi_primary()
void MainWindow::update_preview()
{
- QString error;
- m_bc.ar=(Zint::QZint::AspectRatioMode)1;
+ int width = view->geometry().width();
+ int height = view->geometry().height();
+
+ //m_bc.ar=(Zint::QZint::AspectRatioMode)1;
if(chkComposite->isChecked() == true) {
m_bc.bc.setPrimaryMessage(txtData->text());
m_bc.bc.setText(txtComposite->toPlainText());
@@ -595,9 +630,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()))
{
@@ -880,7 +915,8 @@ void MainWindow::update_preview()
m_bc.bc.setWhitespace(spnWhitespace->value());
m_bc.bc.setFgColor(m_fgcolor);
m_bc.bc.setBgColor(m_bgcolor);
+ m_bc.setSize(width - 10, height - 10);
m_bc.update();
- view->scene()->update();
+ scene->setSceneRect(0, 0, width - 10, height - 10);
+ scene->update();
}
-
diff --git a/frontend_qt4/mainwindow.h b/frontend_qt/mainwindow.h
similarity index 94%
rename from frontend_qt4/mainwindow.h
rename to frontend_qt/mainwindow.h
index 2374980c..82af4b1c 100644
--- a/frontend_qt4/mainwindow.h
+++ b/frontend_qt/mainwindow.h
@@ -20,6 +20,7 @@
#include
#include
#include
+#include
#include "ui_mainWindow.h"
#include "barcodeitem.h"
@@ -105,7 +106,7 @@ public:
};
public:
- MainWindow(QWidget* parent = 0, Qt::WFlags fl = 0);
+ MainWindow(QWidget* parent = 0, Qt::WindowFlags fl = 0);
~MainWindow();
@@ -119,6 +120,9 @@ public slots:
void maxi_primary();
void change_print_scale();
+protected:
+ void resizeEvent(QResizeEvent *event);
+
private slots:
bool save();
void about();
@@ -134,6 +138,7 @@ private:
QColor m_fgcolor,m_bgcolor;
BarcodeItem m_bc;
QWidget *m_optionWidget;
+ QGraphicsScene *scene;
/* QMenu *fileMenu;
QMenu *helpMenu;
QAction *saveAct;
diff --git a/frontend_qt4/res/qtZint.rc b/frontend_qt/res/qtZint.rc
similarity index 100%
rename from frontend_qt4/res/qtZint.rc
rename to frontend_qt/res/qtZint.rc
diff --git a/frontend_qt4/res/zint.ico b/frontend_qt/res/zint.ico
similarity index 100%
rename from frontend_qt4/res/zint.ico
rename to frontend_qt/res/zint.ico
diff --git a/frontend_qt4/resources.qrc b/frontend_qt/resources.qrc
similarity index 100%
rename from frontend_qt4/resources.qrc
rename to frontend_qt/resources.qrc
diff --git a/frontend_qt4/sequencewindow.cpp b/frontend_qt/sequencewindow.cpp
similarity index 99%
rename from frontend_qt4/sequencewindow.cpp
rename to frontend_qt/sequencewindow.cpp
index e0f7c5b9..f285e775 100644
--- a/frontend_qt4/sequencewindow.cpp
+++ b/frontend_qt/sequencewindow.cpp
@@ -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) {
diff --git a/frontend_qt4/sequencewindow.h b/frontend_qt/sequencewindow.h
similarity index 100%
rename from frontend_qt4/sequencewindow.h
rename to frontend_qt/sequencewindow.h
diff --git a/frontend_qt4/howto_build_qzint_using_msvs9.txt b/frontend_qt4/howto_build_qzint_using_msvs9.txt
deleted file mode 100644
index 7c21f4d7..00000000
--- a/frontend_qt4/howto_build_qzint_using_msvs9.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-Harald Oehlmann
-2016-02-28
-
-How to build qzint.exe using:
-- QT 4
-- MS Visual Studio 2008 (VC9)
-
-Folder structure:
-- zint source files in $ZH
- -> this file is in $ZH\frontend_qt4
-- png1620.zip unzipped in $ZH\..\lpng
- -> $ZH\..\lpng\png.h exists
-- zlib128.zip inzipped in folder $ZH\..\zlib
- -> $ZH\..\zlib\zlib.h exists
-
-Prepare qt for static build
-
-- Start "Visual Studio 2008 Command Line" (or execute "%VS90COMNTOOLS%vsvars32.bat" )
-- cd c:\qt\4.8.6
-- configure -static -release -qt-zlib -qt-libpng -qt-libjpeg
-- nmake
- -> took around 2 hours for me
-
-Build pnglib and zlib
-- cd $ZH\..\lpng\projects
-- copy visual71 visual71_converted_to_9
-- Start Visual Studio 2..8 (CV9)
-- open Project: $ZH\..\lpng\projects\visualc71_converted_to_9\libpng.sln
-- convert it as proposed by the IDE (no backup, we have made a copy before)
-- select "LIB Release" configuration
-- go to project "libpng" and open project options (ALT-F7)
-- On the left, select "C/C++->Code generation"
-- On the right change "Run time library" from "Multi-Treaded (/MT)" to "Multithread-DLL (/MD)"
-- also do the upper steps for the project "zlib" (change /MT to /MD)
-- Build libpng and zlib project using the Buildall menu entry
- -> this compiles png in the static lib:
- lpng\projects\visualc71_converted_to_9\Win32_LIB_Release\libpng.lib
- and zlib into the static lib
- lpng\projects\visualc71_converted_to_9\Win32_LIB_Release\zlib\zlib.lib
-
-Build zint
-
-- Start "Visual Studio 2008 Command Line" (or execute "%VS90COMNTOOLS%vsvars32.bat" )
-- C:\Qt\4.8.6\bin\qtvars.bat
-- cd $ZH
-- cd backend_qt4
-- qmake backend_qt4.pro
-- nmake clean
-- nmake release
-
-- cd ..\frontend_qt4
-- qmake frontend_qt4.pro
-- nmake clean
-- nmake release
- -> qzint.exe is in the release folder
diff --git a/frontend_qt4/images/.directory b/frontend_qt4/images/.directory
deleted file mode 100644
index 773296a4..00000000
--- a/frontend_qt4/images/.directory
+++ /dev/null
@@ -1,3 +0,0 @@
-[Dolphin]
-ShowPreview=true
-Timestamp=2010,5,29,7,36,6
diff --git a/frontend_qt4/res/.directory b/frontend_qt4/res/.directory
deleted file mode 100644
index 1450a1d7..00000000
--- a/frontend_qt4/res/.directory
+++ /dev/null
@@ -1,3 +0,0 @@
-[Dolphin]
-ShowPreview=true
-Timestamp=2010,5,29,7,59,30