2026年6月22日 :大量更新
This commit is contained in:
@@ -44,11 +44,6 @@ BarcodeEditor::BarcodeEditor(QWidget *parent) :
|
||||
ui(new Ui::BarcodeEditor)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
if (m_sysPara == nullptr) {
|
||||
m_sysPara = SysPara::ins();
|
||||
}
|
||||
|
||||
applyStyleSheet();
|
||||
|
||||
m_dateFormatEditor = new DateFormatEditor();
|
||||
@@ -264,7 +259,7 @@ void BarcodeEditor::applyCounterConfigToSysPara()
|
||||
m_sysPara->para.cnt1RepeateValue = cnt.counter1.repeatValue;
|
||||
m_sysPara->para.cnt1StepValue = cnt.counter1.stepValue;
|
||||
m_sysPara->para.cnt1CurrValue = cnt.counter1.currValue;
|
||||
m_sysPara->status.cnt1CurrentValueInitDoneFlag = !cnt.counter1.editCurrValue;
|
||||
m_sysPara->status.cnt1CurrentValueInitDoneFlag = cnt.counter1.editCurrValue;
|
||||
|
||||
if(cnt.counter1.eleEyeIncEn)
|
||||
m_sysPara->para.eleEyeClearCntInSynMode = (m_sysPara->para.eleEyeClearCntInSynMode | 0x10); // CNT1 +1
|
||||
@@ -278,7 +273,7 @@ void BarcodeEditor::applyCounterConfigToSysPara()
|
||||
m_sysPara->para.cnt2RepeateValue = cnt.counter2.repeatValue;
|
||||
m_sysPara->para.cnt2StepValue = cnt.counter2.stepValue;
|
||||
m_sysPara->para.cnt2CurrValue = cnt.counter2.currValue;
|
||||
m_sysPara->status.cnt2CurrentValueInitDoneFlag = !cnt.counter2.editCurrValue;
|
||||
m_sysPara->status.cnt2CurrentValueInitDoneFlag = cnt.counter2.editCurrValue;
|
||||
|
||||
if(cnt.counter2.eleEyeIncEn)
|
||||
m_sysPara->para.eleEyeClearCntInSynMode = (m_sysPara->para.eleEyeClearCntInSynMode | 0x20); // CNT2 +1
|
||||
|
||||
@@ -419,17 +419,17 @@ QString ItemUtils::generateTxtFromDateItemModel(const DateItemModel &model, cons
|
||||
QString ItemUtils::generateTxtFromBarcodeViewModel(const BarcodeViewModel &vm, const std::array<int, 2> counterValues, const QDateTime &time)
|
||||
{
|
||||
QString txt = vm.contentPattern;
|
||||
auto pos = vm.contentPattern.indexOf("{t}");
|
||||
auto pos = txt.indexOf("{t}");
|
||||
if(pos != -1) {
|
||||
txt.replace(pos, 3, generateTxtFromDateItemModel(vm.dateViewModel, time));
|
||||
txt = txt.replace(pos, 3, generateTxtFromDateItemModel(vm.dateViewModel, time));
|
||||
}
|
||||
|
||||
pos = vm.contentPattern.indexOf("{c}");
|
||||
pos = txt.indexOf("{c}");
|
||||
if(pos != -1) {
|
||||
auto cntValue = vm.counterViewModel.counterType == COUNTER_TYPE_1 ? counterValues[0] : counterValues[1];
|
||||
auto valueStr = QString("%1").arg(cntValue, 10, QChar('0'));;
|
||||
auto valueStr = QString("%1").arg(cntValue, 8, 10, QLatin1Char('0'));
|
||||
valueStr = valueStr.right(vm.counterViewModel.digitalNum);
|
||||
txt.replace(pos, 3, valueStr);
|
||||
txt = txt.replace(pos, 3, valueStr);
|
||||
}
|
||||
|
||||
return txt;
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
<height>550</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>800</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "piccodeitem.h"
|
||||
#include "ItemCommon.h"
|
||||
#include <QDebug>
|
||||
#include "LogInfo.h"
|
||||
|
||||
PicCodeItem::PicCodeItem(QGraphicsItem *parent, QGraphicsScene *scene, const SourceType type)
|
||||
:PicTextItem(parent, scene, type),
|
||||
@@ -55,7 +56,9 @@ bool PicCodeItem::updateVariants(const QVector<int> counters)
|
||||
return false;
|
||||
}
|
||||
m_currCounterValues = counters;
|
||||
return updateVariants();
|
||||
auto b = updateVariants();
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
QImage PicCodeItem::itemImage()
|
||||
|
||||
@@ -265,6 +265,13 @@ void PicTextItem::setAttrs(const QXmlStreamAttributes &attrs)
|
||||
setCustomFont(fontFamilyRef.toString());
|
||||
}
|
||||
|
||||
qDebug() << "Text item properties: \r\n"
|
||||
<< "\t direction: " << direction()
|
||||
<< "\t boldMultiple: " << boldMultiple()
|
||||
<< "\t colorReversal: " << colorReversal()
|
||||
<< "\t letterSpace: " << letterSpace()
|
||||
<< "\t fontFamily: " << font().family();
|
||||
|
||||
setCustomAttrs(attrs);
|
||||
}
|
||||
|
||||
@@ -427,9 +434,17 @@ void PicTextItem::letterSpaceChanged()
|
||||
|
||||
QImage PicTextItem::strToImage(const QString &str)
|
||||
{
|
||||
if(str.isEmpty())
|
||||
return QImage();
|
||||
|
||||
QPainter painter;
|
||||
QFontMetrics fm(font());
|
||||
QImage img(fm.horizontalAdvance(str), fm.height(), QImage::Format_ARGB32);
|
||||
qDebug() << "strToImage: letterSpace: " << letterSpace();
|
||||
|
||||
if(letterSpace() == 2) {
|
||||
qDebug() << "Break point";
|
||||
}
|
||||
|
||||
QRgb txtColor = colorReversal() ? 0xffffffff : 0xff000000;
|
||||
QRgb bgColor = colorReversal() ? 0xff000000 : 0x00000000;
|
||||
|
||||
Reference in New Issue
Block a user