- library: check symbol->primary for escape sequences also

- GUI: error message GS1_MODE -> GS1 mode
- GUI: sequence window: fix initial clear button status
- GUI: make acceptable for macOS; add iconset for macOS, install
- manual: update macOS Homebrew install info; add README.macos
- GUI: export window: add no. of sequences to results label
This commit is contained in:
gitlost
2022-06-16 16:47:34 +01:00
parent a232dec4ff
commit 15b8024712
27 changed files with 530 additions and 290 deletions

View File

@ -1,5 +1,6 @@
# Copyright (C) 2008 by BogDan Vatra < bogdan@licentia.eu >
# Copyright (C) 2009-2021 Robin Stuart <rstuart114@gmail.com>
# Copyright (C) 2009-2022 Robin Stuart <rstuart114@gmail.com>
# SPDX-License-Identifier: GPL-3.0-or-later
# vim: set ts=4 sw=4 et :
project(zint-qt)
@ -23,7 +24,23 @@ endif()
# grpC16k.ui grpChannel.ui grpDBExtend.ui grpITF14.ui grpMSICheck.ui grpUPCA.ui
# grpC25.ui grpCodabar.ui grpDM.ui grpLOGMARS.ui grpPDF417.ui grpUPCEAN.ui
add_executable(${PROJECT_NAME} ${zint-qt_SRCS} resources.qrc)
if(APPLE)
# https://doc.qt.io/qt-5/appicon.html
set(MACOSX_BUNDLE_ICON_FILE zint-qt.icns)
set(APP_ICON_MACOSX "${CMAKE_CURRENT_SOURCE_DIR}/zint-qt.icns")
set_source_files_properties(${APP_ICON_MACOSX} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
add_executable(${PROJECT_NAME} MACOSX_BUNDLE ${zint-qt_SRCS} resources.qrc ${APP_ICON_MACOSX})
set_target_properties(${PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_BUNDLE_NAME "Zint Barcode Studio"
MACOSX_BUNDLE_BUNDLE_VERSION ${ZINT_VERSION}
MACOSX_BUNDLE_COPYRIGHT "Copyright © 2006-2022 Robin Stuart and others"
MACOSX_BUNDLE_GUI_IDENTIFIER "uk.org.zint.zint-qt"
MACOSX_BUNDLE_INFO_STRING "A free barcode generator"
MACOSX_BUNDLE_SHORT_VERSION_STRING ${ZINT_VERSION})
else()
add_executable(${PROJECT_NAME} ${zint-qt_SRCS} resources.qrc)
endif()
if(WIN32)
target_sources(${PROJECT_NAME} PRIVATE res/qtZint.rc)

View File

@ -1,6 +1,6 @@
/*
Zint Barcode Generator - the open source barcode generator
Copyright (C) 2009 - 2021 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2009-2022 Robin Stuart <rstuart114@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -16,7 +16,7 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/* vim: set ts=4 sw=4 et : */
/* SPDX-License-Identifier: GPL-3.0-or-later */
//#include <QDebug>
#include <QUiLoader>
@ -30,7 +30,7 @@
// Shorthand
#define QSL QStringLiteral
ExportWindow::ExportWindow(BarcodeItem *bc, const QString& output_data) : m_bc(bc), m_output_data(output_data)
ExportWindow::ExportWindow(BarcodeItem *bc, const QString& output_data) : m_bc(bc), m_output_data(output_data), m_lines(0)
{
setupUi(this);
QSettings settings;
@ -54,6 +54,14 @@ ExportWindow::ExportWindow(BarcodeItem *bc, const QString& output_data) : m_bc(b
connect(btnCancel, SIGNAL( clicked( bool )), SLOT(close()));
connect(btnOK, SIGNAL( clicked( bool )), SLOT(process()));
connect(btnDestPath, SIGNAL( clicked( bool )), SLOT(get_directory()));
m_dataList = m_output_data.split('\n');
m_lines = m_dataList.size();
if (m_lines && m_dataList[m_lines - 1].isEmpty()) {
m_lines--;
}
/*: %1 is number of sequences */
lblFeedback->setText(tr("Export Results (%1):").arg(m_lines));
}
ExportWindow::~ExportWindow()
@ -102,18 +110,12 @@ void ExportWindow::process()
txtFeedback->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor);
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
QStringList dataList = m_output_data.split('\n');
int lines = dataList.size();
if (lines && dataList[lines - 1].isEmpty()) {
lines--;
}
QString biggest;
bool needUrlEscape = false;
const int fileNameIdx = cmbFileName->currentIndex();
if (fileNameIdx == 1) {
biggest = QString::number(lines + 1);
biggest = QString::number(m_lines + 1);
} else {
needUrlEscape = m_output_data.contains(urlRE);
}
@ -145,8 +147,8 @@ void ExportWindow::process()
QStringList Feedback;
int successCount = 0, errorCount = 0;
for (int i = 0; i < lines; i++) {
const QString &dataString = dataList[i];
for (int i = 0; i < m_lines; i++) {
const QString &dataString = m_dataList[i];
QString fileName;
switch (fileNameIdx) {
case 0: /* Same as Data (URL Escaped) */
@ -227,3 +229,5 @@ void ExportWindow::process()
}
txtFeedback->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor);
}
/* vim: set ts=4 sw=4 et : */

View File

@ -1,6 +1,6 @@
/*
Zint Barcode Generator - the open source barcode generator
Copyright (C) 2009-2021 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2009-2022 Robin Stuart <rstuart114@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -16,10 +16,10 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/* vim: set ts=4 sw=4 et : */
/* SPDX-License-Identifier: GPL-3.0-or-later */
#ifndef EXPORTWINDOW_H
#define EXPORTWINDOW_H
#ifndef Z_EXPORTWINDOW_H
#define Z_EXPORTWINDOW_H
#include "ui_extExport.h"
#include "barcodeitem.h"
@ -39,6 +39,9 @@ private slots:
protected:
BarcodeItem *m_bc;
QString m_output_data;
QStringList m_dataList;
int m_lines;
};
/* vim: set ts=4 sw=4 et : */
#endif

15
frontend_qt/mac_icons.sh Executable file
View File

@ -0,0 +1,15 @@
#! /bin/bash
# Create icon set for macOS, requires "brew install librsvg"
mkdir MyIcon.iconset
rsvg-convert -h 16 -d 72 -p 72 images/scalable/zint-qt.svg > MyIcon.iconset/icon_16x16.png
rsvg-convert -h 32 -d 144 -p 144 images/scalable/zint-qt.svg > MyIcon.iconset/icon_16x16@2x.png
rsvg-convert -h 32 -d 72 -p 72 images/scalable/zint-qt.svg > MyIcon.iconset/icon_32x32.png
rsvg-convert -h 64 -d 144 -p 144 images/scalable/zint-qt.svg > MyIcon.iconset/icon_32x32@2x.png
rsvg-convert -h 128 -d 72 -p 72 images/scalable/zint-qt.svg > MyIcon.iconset/icon_128x128.png
rsvg-convert -h 256 -d 144 -p 144 images/scalable/zint-qt.svg > MyIcon.iconset/icon_128x128@2x.png
rsvg-convert -h 256 -d 72 -p 72 images/scalable/zint-qt.svg > MyIcon.iconset/icon_256x256.png
rsvg-convert -h 512 -d 144 -p 144 images/scalable/zint-qt.svg > MyIcon.iconset/icon_256x256@2x.png
rsvg-convert -h 512 -d 72 -p 72 images/scalable/zint-qt.svg > MyIcon.iconset/icon_512x512.png
rsvg-convert -h 1024 -d 144 -p 144 images/scalable/zint-qt.svg > MyIcon.iconset/icon_512x512@2x.png
iconutil -c icns MyIcon.iconset
# rm -R MyIcon.iconset

View File

@ -27,13 +27,10 @@
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<layout class="QVBoxLayout" name="verticalLayoutMain">
<layout class="QVBoxLayout" name="vLayoutMain">
<item>
<widget class="QGraphicsView" name="view">
<property name="minimumSize">
@ -78,14 +75,14 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="hLayoutMain">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<layout class="QVBoxLayout" name="vLayoutSymbology">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<layout class="QHBoxLayout" name="hLayoutSymbology">
<item>
<widget class="QLabel" name="lblSymbology">
<property name="toolTip">
@ -141,9 +138,6 @@
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="currentIndex">
<number>0</number>
</property>
@ -151,7 +145,7 @@
<attribute name="title">
<string>&amp;Data</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayoutTabData">
<layout class="QVBoxLayout" name="vLayoutTabData">
<item>
<widget class="QGroupBox" name="grpData">
<property name="sizePolicy">
@ -166,9 +160,9 @@
<property name="title">
<string>Data to Enc&amp;ode</string>
</property>
<layout class="QVBoxLayout" name="verticalLayoutData">
<layout class="QVBoxLayout" name="vLayoutData">
<item>
<layout class="QHBoxLayout" name="horizontalLayoutData">
<layout class="QHBoxLayout" name="hLayoutData">
<item>
<widget class="QLineEdit" name="txtData">
<property name="toolTip">
@ -215,7 +209,7 @@ or import from file</string>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="eciLayout">
<layout class="QHBoxLayout" name="hLayoutECI">
<item>
<widget class="QLabel" name="lblECI">
<property name="maximumSize">
@ -427,7 +421,7 @@ or import from file</string>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_eciLayout">
<spacer name="hSpacer_hLayoutECI">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -520,9 +514,9 @@ for this symbology to defaults</string>
<property name="title">
<string>GS1 Composite</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="vLayoutComposite">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="hLayoutComposite">
<item>
<widget class="QCheckBox" name="chkComposite">
<property name="toolTip">
@ -534,7 +528,7 @@ for this symbology to defaults</string>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<spacer name="hSpacer_hLayoutComposite">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -601,12 +595,12 @@ for this symbology to defaults</string>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="vertLayoutComponentData">
<layout class="QVBoxLayout" name="vLayoutComponentData">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item>
<layout class="QHBoxLayout" name="horzLayoutComponentDataLabel">
<layout class="QHBoxLayout" name="hLayoutComponentDataLabel">
<item>
<widget class="QLabel" name="lblComposite">
<property name="enabled">
@ -703,9 +697,9 @@ Extended Channel Interpretation (ECI)</string>
<property name="title">
<string>Additional ECI/Data Segments</string>
</property>
<layout class="QVBoxLayout" name="verticalLayoutSegs">
<layout class="QVBoxLayout" name="vLayoutSegs">
<item>
<layout class="QHBoxLayout" name="horizontalLayoutSeg1">
<layout class="QHBoxLayout" name="hlLayoutSeg1">
<item>
<widget class="QLabel" name="lblSeg1">
<property name="enabled">
@ -966,7 +960,7 @@ or import from file</string>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayoutSeg2">
<layout class="QHBoxLayout" name="hLayoutSeg2">
<item>
<widget class="QLabel" name="lblSeg2">
<property name="enabled">
@ -1227,7 +1221,7 @@ or import from file</string>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayoutSeg3">
<layout class="QHBoxLayout" name="hLayoutSeg3">
<item>
<widget class="QLabel" name="lblSeg3">
<property name="enabled">
@ -1491,7 +1485,7 @@ or import from file</string>
</widget>
</item>
<item>
<spacer name="vertSpacerData">
<spacer name="vSpacerData">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@ -1504,9 +1498,9 @@ or import from file</string>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="chksLayout">
<layout class="QHBoxLayout" name="hLayoutChks">
<item>
<spacer name="horizontalSpacer_chksLayout">
<spacer name="hSpacer_hLayoutChks">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -1606,11 +1600,11 @@ as delimiters for GS1 Application Identifiers
<attribute name="title">
<string>A&amp;ppearance</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<layout class="QVBoxLayout" name="vLayoutAppearance">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayoutAutoHeight">
<layout class="QHBoxLayout" name="hLayoutAutoHeight">
<item>
<widget class="QCheckBox" name="chkAutoHeight">
<property name="toolTip">
@ -1698,7 +1692,7 @@ and use standard height (if any) for default
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_8">
<widget class="QLabel" name="lblBorderWidth">
<property name="toolTip">
<string>Width of boundary bars or border in X-dimensions</string>
</property>
@ -1733,7 +1727,7 @@ and use standard height (if any) for default
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_9">
<widget class="QLabel" name="lblBorderType">
<property name="toolTip">
<string>Add border or box</string>
</property>

View File

@ -139,6 +139,53 @@ static const struct bstyle_item bstyle_items[] = {
{ QSL("VIN (Vehicle Identification Number)"), BARCODE_VIN },
};
#ifdef Q_OS_MACOS
/* Helper to make widgets look ok on macOS */
void MainWindow::mac_hack(QWidget *win)
{
if (!win) {
return;
}
QList<QWidget *> widgets = win->findChildren<QWidget *>();
for (int i = 0, cnt = widgets.size(); i < cnt; i++) {
widgets[i]->setAttribute(Qt::WA_MacNormalSize);
}
QList<QGroupBox *> grps = win->findChildren<QGroupBox *>();
for (int i = 0, cnt = grps.size(); i < cnt; i++) {
// TODO: top of groupbox too near to previous element - how to fix??
grps[i]->setAlignment(Qt::AlignHCenter); // Poor man's workaround for above
}
}
/* Helper to make data tab vertical layouts look ok on macOS */
void MainWindow::mac_hack_vLayouts(QWidget *win)
{
QList<QVBoxLayout *> vlayouts = win->findChildren<QVBoxLayout *>();
for (int i = 0, cnt = vlayouts.size(); i < cnt; i++) {
if (vlayouts[i]->objectName() == "vLayoutData" || vlayouts[i]->objectName() == "vLayoutComposite"
|| vlayouts[i]->objectName() == "vLayoutSegs") {
vlayouts[i]->setSpacing(0);
// If set spacing on QVBoxLayout then it seems its QHBoxLayout children inherit this so undo
QList<QHBoxLayout *> hlayouts = vlayouts[i]->findChildren<QHBoxLayout *>();
for (int j = 0, cnt = hlayouts.size(); j < cnt; j++) {
hlayouts[j]->setSpacing(8);
}
}
}
}
/* Helper to make status bars look ok on macOS */
void MainWindow::mac_hack_statusBars(QWidget *win, const char* name)
{
QList<QStatusBar *> sbars = name ? win->findChildren<QStatusBar *>(name) : win->findChildren<QStatusBar *>();
QColor bgColor = QGuiApplication::palette().window().color();
QString sbarSS = QSL("QStatusBar {background-color:") + bgColor.name() + QSL(";}");
for (int i = 0, cnt = sbars.size(); i < cnt; i++) {
sbars[i]->setStyleSheet(sbarSS);
}
}
#endif
MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags fl)
: QWidget(parent, fl), m_optionWidget(nullptr), m_symbology(0),
m_menu(nullptr),
@ -162,7 +209,23 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags fl)
setupUi(this);
view->setScene(scene);
restoreGeometry(settings.value(QSL("studio/window_geometry")).toByteArray());
QVariant saved_geometry = settings.value(QSL("studio/window_geometry"));
#ifdef Q_OS_MACOS
QApplication::setDesktopSettingsAware(false); // Makes group boxes use standard font (may do other stuff)
// Standard width 360 too narrow
if (saved_geometry.isNull()) {
// Seems this is necessary on macOS to get a reasonable initial height
setMinimumSize(QSize(460, (int) (QApplication::primaryScreen->availableSize().height() * 0.9f)));
} else {
setMinimumSize(QSize(460, 0));
}
mac_hack(this);
mac_hack_vLayouts(this);
mac_hack_statusBars(this, "statusBar");
#endif
restoreGeometry(saved_geometry.toByteArray());
m_fgcolor_geometry = settings.value(QSL("studio/fgcolor_geometry")).toByteArray();
m_bgcolor_geometry = settings.value(QSL("studio/bgcolor_geometry")).toByteArray();
@ -605,7 +668,7 @@ void MainWindow::factory_reset()
QMessageBox msgBox(QMessageBox::Question, tr("Factory Reset"),
tr("This will clear all saved data and reset all settings for all symbologies to defaults."),
QMessageBox::Yes | QMessageBox::No, this);
msgBox.setInformativeText(tr("Do you want to continue?"));
msgBox.setInformativeText(tr("Do you wish to continue?"));
msgBox.setDefaultButton(QMessageBox::Yes);
if (msgBox.exec() == QMessageBox::No) {
return;
@ -637,29 +700,41 @@ void MainWindow::about()
QMessageBox::about(this, tr("About Zint"),
/*: %1 is Zint version, %2 is Qt version */
tr("<h2>Zint Barcode Studio %1</h2>"
"<p>A free barcode generator</p>"
"<p>Instruction manual is available at the project homepage:<br>"
"<a href=\"http://www.zint.org.uk\">http://www.zint.org.uk</a>.</p>"
"<p>Copyright &copy; 2006-2022 Robin Stuart and others.<br>"
"Qt backend by BogDan Vatra.<br>"
"Released under GNU GPL 3.0 or later.</p>"
"<p>Qt version %2</p>"
"<p>\"QR Code\" is a Registered Trademark of Denso Corp.<br>"
"\"Telepen\" is a Registered Trademark of SB Electronics.<br>"
"\"Mailmark\" is a Registered Trademark of Royal Mail.</p>"
"<p>With thanks to Harald Oehlmann, Norbert Szab&oacute;, Robert Elliott, Milton Neal, "
"Git Lost, Alonso Schaich, Andre Maute and many others at Sourceforge.</p>"
"<p><table border=1><tr><td><small>Currently supported standards include:<br>"
"ISO/IEC 24778:2008, ANSI/AIM BC12-1998, EN 798:1996,<br>"
"AIM ISS-X-24 (1995), ISO/IEC 15417:2007, EN 12323:2005,<br>"
"ISO/IEC 16388:2007, ANSI/AIM BC6-2000, ANSI/AIM BC5-1995,<br>"
"AIM USS Code One (1994), ISO/IEC 16022:2006, ISO/IEC 21471:2019,<br>"
"ISO/IEC 15420:2009, AIMD014 (v 1.63) (2008), ISO/IEC 24723:2010,<br>"
"ISO/IEC 24724:2011, ISO/IEC 20830:2021, ISO/IEC 16390:2007,<br>"
"ISO/IEC 16023:2000, ISO/IEC 24728:2006, ISO/IEC 15438:2015,<br>"
"ISO/IEC 18004:2015, ISO/IEC 23941:2022, AIM ITS/04-023 (2022)"
"</small></td></tr></table></p>").arg(zint_version).arg(QT_VERSION_STR));
tr(
#ifdef Q_OS_MACOS
"<style>h2, p { font-size:11px; font-weight:normal; } td { font-size:8px; font-weight:normal; }</style>"
#endif
"<h2>Zint Barcode Studio %1</h2>"
"<p>A free barcode generator</p>"
"<p>Instruction manual is available at the project homepage:<br>"
"<a href=\"http://www.zint.org.uk\">http://www.zint.org.uk</a>.</p>"
"<p>Copyright &copy; 2006-2022 Robin Stuart and others.<br>"
"Qt backend by BogDan Vatra.<br>"
"Released under GNU GPL 3.0 or later.</p>"
"<p>Qt version %2</p>"
"<p>\"QR Code\" is a Registered Trademark of Denso Corp.<br>"
"\"Telepen\" is a Registered Trademark of SB Electronics.<br>"
"\"Mailmark\" is a Registered Trademark of Royal Mail.</p>"
"<p>With thanks to Harald Oehlmann, Norbert Szab&oacute;, Robert Elliott, Milton Neal, "
"Git Lost, Alonso Schaich, Andre Maute and many others at Sourceforge.</p>"
"<p><table border=1><tr><td>"
#ifndef Q_OS_MACOS
"<small>"
#endif
"Currently supported standards include:<br>"
"ISO/IEC 24778:2008, ANSI/AIM BC12-1998, EN 798:1996,<br>"
"AIM ISS-X-24 (1995), ISO/IEC 15417:2007, EN 12323:2005,<br>"
"ISO/IEC 16388:2007, ANSI/AIM BC6-2000, ANSI/AIM BC5-1995,<br>"
"AIM USS Code One (1994), ISO/IEC 16022:2006, ISO/IEC 21471:2019,<br>"
"ISO/IEC 15420:2009, AIMD014 (v 1.63) (2008), ISO/IEC 24723:2010,<br>"
"ISO/IEC 24724:2011, ISO/IEC 20830:2021, ISO/IEC 16390:2007,<br>"
"ISO/IEC 16023:2000, ISO/IEC 24728:2006, ISO/IEC 15438:2015,<br>"
"ISO/IEC 18004:2015, ISO/IEC 23941:2022, AIM ITS/04-023 (2022)"
#ifndef Q_OS_MACOS
"</small>"
#endif
"</td></tr></table></p>"
).arg(zint_version).arg(QT_VERSION_STR));
}
void MainWindow::help()
@ -741,6 +816,11 @@ void MainWindow::open_data_dialog_seg(const int seg_no)
QString originalText = seg_textbox->text();
bool originalChkEscape = chkEscape->isChecked();
DataWindow dlg(originalText, originalChkEscape, seg_no);
#ifdef Q_OS_MACOS
mac_hack_statusBars(&dlg);
#endif
connect(&dlg, SIGNAL(dataChanged(const QString&, bool, int)), this,
SLOT(on_dataChanged(const QString&, bool, int)));
(void) dlg.exec();
@ -840,6 +920,10 @@ void MainWindow::open_cli_dialog()
CLIWindow dlg(&m_bc, chkAutoHeight->isEnabled() && chkAutoHeight->isChecked(),
m_spnHeightPerRow && m_spnHeightPerRow->isEnabled() ? m_spnHeightPerRow->value() : 0.0);
#ifdef Q_OS_MACOS
mac_hack_statusBars(&dlg);
#endif
(void) dlg.exec();
}
@ -1909,9 +1993,14 @@ void MainWindow::change_options()
connect(get_widget(QSL("chkVINImportChar")), SIGNAL(toggled( bool )), SLOT(update_preview()));
} else {
m_optionWidget = nullptr;
load_sub_settings(settings, symbology);
}
#ifdef Q_OS_MACOS
mac_hack(m_optionWidget);
#endif
switch (symbology) {
case BARCODE_CODE128:
case BARCODE_EANX:

View File

@ -15,8 +15,8 @@
***************************************************************************/
/* SPDX-License-Identifier: GPL-3.0-or-later */
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#ifndef Z_MAINWINDOW_H
#define Z_MAINWINDOW_H
#include <QtGui>
#include <QGraphicsItem>
@ -42,6 +42,12 @@ public:
static QString get_zint_version(void);
#ifdef Q_OS_MACOS
static void mac_hack(QWidget *win);
static void mac_hack_vLayouts(QWidget *win);
static void mac_hack_statusBars(QWidget *win, const char *name = nullptr);
#endif
public slots:
void update_preview();
void change_options();
@ -125,9 +131,9 @@ protected:
QString getColorStr(const QColor color, bool alpha_always = false);
void setColorTxtBtn(const QColor color, QLineEdit *txt, QPushButton* btn);
void resizeEvent(QResizeEvent *event);
bool event(QEvent *event) override;
bool eventFilter(QObject *watched, QEvent *event);
virtual void resizeEvent(QResizeEvent *event) override;
virtual bool event(QEvent *event) override;
virtual bool eventFilter(QObject *watched, QEvent *event) override;
void combobox_item_enabled(QComboBox *comboBox, int index, bool enabled);
void upcean_addon_gap(const QString &comboBoxName, const QString &labelName, int base);

View File

@ -52,7 +52,7 @@ SequenceWindow::SequenceWindow(BarcodeItem *bc) : m_bc(bc)
QIcon clearIcon(QSL(":res/delete.svg"));
btnSeqClose->setIcon(closeIcon);
btnSeqClear->setIcon(clearIcon);
btnSeqClear->setEnabled(!txtSeqPreview->toPlainText().isEmpty());
check_generate();
connect(btnSeqClose, SIGNAL( clicked( bool )), SLOT(close()));
connect(btnSeqClear, SIGNAL( clicked( bool )), SLOT(clear_preview()));

BIN
frontend_qt/zint-qt.icns Normal file

Binary file not shown.