From f5357e9917bcdfa7c905d8b0fcf4d24b4ca30a82 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 18 Nov 2018 11:06:41 +0100 Subject: [PATCH] PVS-Studio Analysis corrections for less serious issues --- plugins/channelrx/daemonsink/daemonsink.cpp | 5 +- .../daemonsink/daemonsinksettings.cpp | 1 + .../channelrx/demoddatv/datvconstellation.h | 8 +-- .../channelrx/demoddatv/leansdr/framework.h | 7 +- plugins/channelrx/demoddatv/leansdr/rs.h | 2 +- .../daemonsource/daemonsourcesettings.cpp | 1 + .../samplesink/sdrdaemonsink/udpsinkfec.cpp | 5 +- .../filesource/filesourcesettings.cpp | 2 +- qrtplib/rtcpcompoundpacketbuilder.h | 5 +- sdrbase/channel/sdrdaemondatareadqueue.cpp | 11 ++- sdrbase/channel/sdrdaemondatareadqueue.h | 12 ++-- sdrgui/gui/glspectrum.cpp | 28 ++------ sdrgui/gui/glspectrumgui.cpp | 2 +- sdrgui/gui/valuedial.cpp | 69 +++++++++++-------- sdrgui/gui/valuedialz.cpp | 49 +++++++------ 15 files changed, 103 insertions(+), 104 deletions(-) diff --git a/plugins/channelrx/daemonsink/daemonsink.cpp b/plugins/channelrx/daemonsink/daemonsink.cpp index 80313d68d..797e5b429 100644 --- a/plugins/channelrx/daemonsink/daemonsink.cpp +++ b/plugins/channelrx/daemonsink/daemonsink.cpp @@ -135,7 +135,10 @@ void DaemonSink::feed(const SampleVector::const_iterator& begin, const SampleVec superBlock.m_header.m_blockIndex = m_txBlockIndex; superBlock.m_header.m_sampleBytes = (SDR_RX_SAMP_SZ <= 16 ? 2 : 4); superBlock.m_header.m_sampleBits = SDR_RX_SAMP_SZ; - memcpy((void *) &superBlock.m_protectedBlock, (const void *) &metaData, sizeof(SDRDaemonMetaDataFEC)); + + SDRDaemonMetaDataFEC *destMeta = (SDRDaemonMetaDataFEC *) &superBlock.m_protectedBlock; + *destMeta = metaData; + //memcpy((void *) &superBlock.m_protectedBlock, (const void *) &metaData, sizeof(SDRDaemonMetaDataFEC)); if (!(metaData == m_currentMetaFEC)) { diff --git a/plugins/channelrx/daemonsink/daemonsinksettings.cpp b/plugins/channelrx/daemonsink/daemonsinksettings.cpp index 9b81702f0..1579bc80f 100644 --- a/plugins/channelrx/daemonsink/daemonsinksettings.cpp +++ b/plugins/channelrx/daemonsink/daemonsinksettings.cpp @@ -39,6 +39,7 @@ void DaemonSinkSettings::resetToDefaults() m_dataPort = 9090; m_rgbColor = QColor(140, 4, 4).rgb(); m_title = "Daemon sink"; + m_channelMarker = nullptr; } QByteArray DaemonSinkSettings::serialize() const diff --git a/plugins/channelrx/demoddatv/datvconstellation.h b/plugins/channelrx/demoddatv/datvconstellation.h index f3d21b32c..dc97744e8 100644 --- a/plugins/channelrx/demoddatv/datvconstellation.h +++ b/plugins/channelrx/demoddatv/datvconstellation.h @@ -69,12 +69,8 @@ template struct datvconstellation: runnable for (; p < pend; ++p) { - if (m_objDATVScreen != 0) - { - m_objDATVScreen->selectRow(256 * (p->re - xymin) / (xymax - xymin)); - m_objDATVScreen->setDataColor(256 - 256 * ((p->im - xymin) / (xymax - xymin)), 255, 0, 255); - } - + m_objDATVScreen->selectRow(256 * (p->re - xymin) / (xymax - xymin)); + m_objDATVScreen->setDataColor(256 - 256 * ((p->im - xymin) / (xymax - xymin)), 255, 0, 255); } if (cstln && (*cstln)) diff --git a/plugins/channelrx/demoddatv/leansdr/framework.h b/plugins/channelrx/demoddatv/leansdr/framework.h index f6abfd1e3..d894c74b5 100644 --- a/plugins/channelrx/demoddatv/leansdr/framework.h +++ b/plugins/channelrx/demoddatv/leansdr/framework.h @@ -2,6 +2,8 @@ #define LEANSDR_FRAMEWORK_H #include +#include + #include #include #include @@ -106,9 +108,10 @@ struct scheduler bool verbose, debug; scheduler() : - npipes(0), nrunnables(0), windows(NULL), verbose(false), debug( - false) + npipes(0), nrunnables(0), windows(nullptr), verbose(false), debug(false) { + std::fill(pipes, pipes + MAX_PIPES, nullptr); + std::fill(runnables, runnables + MAX_RUNNABLES, nullptr); } void add_pipe(pipebuf_common *p) diff --git a/plugins/channelrx/demoddatv/leansdr/rs.h b/plugins/channelrx/demoddatv/leansdr/rs.h index 0df614409..32e5c0a93 100644 --- a/plugins/channelrx/demoddatv/leansdr/rs.h +++ b/plugins/channelrx/demoddatv/leansdr/rs.h @@ -162,7 +162,7 @@ struct rs_engine { // TBD Avoid copying u8 p[204]; - memcpy(p, msg, 188); + memcpy(p, msg, 204); // was 188 but causing underflow (PVS https://www.viva64.com/en/w/v512/) memset(p + 188, 0, 16); // p = msg*X^16 #if DEBUG_RS diff --git a/plugins/channeltx/daemonsource/daemonsourcesettings.cpp b/plugins/channeltx/daemonsource/daemonsourcesettings.cpp index e55462390..ca0dafbe5 100644 --- a/plugins/channeltx/daemonsource/daemonsourcesettings.cpp +++ b/plugins/channeltx/daemonsource/daemonsourcesettings.cpp @@ -31,6 +31,7 @@ void DaemonSourceSettings::resetToDefaults() m_dataPort = 9090; m_rgbColor = QColor(140, 4, 4).rgb(); m_title = "Daemon source"; + m_channelMarker = nullptr; } QByteArray DaemonSourceSettings::serialize() const diff --git a/plugins/samplesink/sdrdaemonsink/udpsinkfec.cpp b/plugins/samplesink/sdrdaemonsink/udpsinkfec.cpp index 14b9ef820..1013f2bde 100644 --- a/plugins/samplesink/sdrdaemonsink/udpsinkfec.cpp +++ b/plugins/samplesink/sdrdaemonsink/udpsinkfec.cpp @@ -141,7 +141,10 @@ void UDPSinkFEC::write(const SampleVector::iterator& begin, uint32_t sampleChunk m_superBlock.m_header.m_blockIndex = m_txBlockIndex; m_superBlock.m_header.m_sampleBytes = (SDR_RX_SAMP_SZ <= 16 ? 2 : 4); m_superBlock.m_header.m_sampleBits = SDR_RX_SAMP_SZ; - memcpy((char *) &m_superBlock.m_protectedBlock, (const char *) &metaData, sizeof(SDRDaemonMetaDataFEC)); + + SDRDaemonMetaDataFEC *destMeta = (SDRDaemonMetaDataFEC *) &m_superBlock.m_protectedBlock; + *destMeta = metaData; + //memcpy((char *) &m_superBlock.m_protectedBlock, (const char *) &metaData, sizeof(SDRDaemonMetaDataFEC)); if (!(metaData == m_currentMetaFEC)) { diff --git a/plugins/samplesource/filesource/filesourcesettings.cpp b/plugins/samplesource/filesource/filesourcesettings.cpp index 950f1c1af..f8a6b370a 100644 --- a/plugins/samplesource/filesource/filesourcesettings.cpp +++ b/plugins/samplesource/filesource/filesourcesettings.cpp @@ -103,7 +103,7 @@ int FileSourceSettings::getAccelerationValue(int accelerationIndex) unsigned int v = accelerationIndex - 1; int m = pow(10.0, v/3 > m_accelerationMaxScale ? m_accelerationMaxScale : v/3); - int x; + int x = 1; if (v % 3 == 0) { x = 2; diff --git a/qrtplib/rtcpcompoundpacketbuilder.h b/qrtplib/rtcpcompoundpacketbuilder.h index 7daff9dc1..f105f9959 100644 --- a/qrtplib/rtcpcompoundpacketbuilder.h +++ b/qrtplib/rtcpcompoundpacketbuilder.h @@ -38,13 +38,15 @@ #define RTCPCOMPOUNDPACKETBUILDER_H +#include +#include + #include "rtpconfig.h" #include "rtcpcompoundpacket.h" #include "rtptimeutilities.h" #include "rtcpsdespacket.h" #include "rtperrors.h" #include "rtpendian.h" -#include #include "export.h" @@ -151,6 +153,7 @@ private: Report() { headerdata = (uint8_t *) headerdata32; + std::fill(&headerdata32[0], &headerdata32[0] + ((sizeof(uint32_t) + sizeof(RTCPSenderReport)) / sizeof(uint32_t)), 0U); isSR = false; headerlength = 0; } diff --git a/sdrbase/channel/sdrdaemondatareadqueue.cpp b/sdrbase/channel/sdrdaemondatareadqueue.cpp index 601a5f12a..a1fd28f48 100644 --- a/sdrbase/channel/sdrdaemondatareadqueue.cpp +++ b/sdrbase/channel/sdrdaemondatareadqueue.cpp @@ -130,14 +130,11 @@ void SDRDaemonDataReadQueue::readSample(Sample& s, bool scaleForTx) } else { - if (m_dataBlock) - { - delete m_dataBlock; - m_dataBlock = 0; + delete m_dataBlock; + m_dataBlock = 0; - if (length() == 0) { - qWarning("SDRDaemonDataReadQueue::readSample: try to pop new block but queue is empty"); - } + if (length() == 0) { + qWarning("SDRDaemonDataReadQueue::readSample: try to pop new block but queue is empty"); } if (length() > 0) diff --git a/sdrbase/channel/sdrdaemondatareadqueue.h b/sdrbase/channel/sdrdaemondatareadqueue.h index ce120f8d2..46645c33b 100644 --- a/sdrbase/channel/sdrdaemondatareadqueue.h +++ b/sdrbase/channel/sdrdaemondatareadqueue.h @@ -59,11 +59,7 @@ private: int samplebits = m_dataBlock->m_superBlocks[blockIndex].m_header.m_sampleBits; // I or Q sample size in bits int32_t iconv, qconv; - if (sizeof(Sample) == sampleSize) // generally 16->16 or 24->24 bits - { - s = *((Sample*) &(m_dataBlock->m_superBlocks[blockIndex].m_protectedBlock.buf[sampleIndex*sampleSize])); - } - else if ((sizeof(Sample) == 4) && (sampleSize == 8)) // generally 24->16 bits + if ((sizeof(Sample) == 4) && (sampleSize == 8)) // generally 24->16 bits { iconv = ((int32_t*) &(m_dataBlock->m_superBlocks[blockIndex].m_protectedBlock.buf[sampleIndex*sampleSize]))[0]; qconv = ((int32_t*) &(m_dataBlock->m_superBlocks[blockIndex].m_protectedBlock.buf[sampleIndex*sampleSize+4]))[0]; @@ -81,7 +77,11 @@ private: s.setReal(iconv); s.setImag(qconv); } - else + else if ((sampleSize == 4) || (sampleSize == 8)) // generally 16->16 or 24->24 bits + { + s = *((Sample*) &(m_dataBlock->m_superBlocks[blockIndex].m_protectedBlock.buf[sampleIndex*sampleSize])); + } + else // invalid size { s = Sample{0, 0}; } diff --git a/sdrgui/gui/glspectrum.cpp b/sdrgui/gui/glspectrum.cpp index f7d9767d4..52de69c5f 100644 --- a/sdrgui/gui/glspectrum.cpp +++ b/sdrgui/gui/glspectrum.cpp @@ -1561,18 +1561,9 @@ void GLSpectrum::applyChanges() m_waterfallBuffer = new QImage(m_fftSize, waterfallHeight, QImage::Format_ARGB32); - if(m_waterfallBuffer != 0) - { - m_waterfallBuffer->fill(qRgb(0x00, 0x00, 0x00)); - m_glShaderWaterfall.initTexture(*m_waterfallBuffer); - m_waterfallBufferPos = 0; - } - else - { - m_fftSize = 0; - m_changesPending = true; - return; - } + m_waterfallBuffer->fill(qRgb(0x00, 0x00, 0x00)); + m_glShaderWaterfall.initTexture(*m_waterfallBuffer); + m_waterfallBufferPos = 0; } if(fftSizeChanged) @@ -1588,17 +1579,8 @@ void GLSpectrum::applyChanges() m_histogramBuffer = new QImage(m_fftSize, 100, QImage::Format_RGB32); - if(m_histogramBuffer != 0) - { - m_histogramBuffer->fill(qRgb(0x00, 0x00, 0x00)); - m_glShaderHistogram.initTexture(*m_histogramBuffer, QOpenGLTexture::ClampToEdge); - } - else - { - m_fftSize = 0; - m_changesPending = true; - return; - } + m_histogramBuffer->fill(qRgb(0x00, 0x00, 0x00)); + m_glShaderHistogram.initTexture(*m_histogramBuffer, QOpenGLTexture::ClampToEdge); m_histogram = new quint8[100 * m_fftSize]; memset(m_histogram, 0x00, 100 * m_fftSize); diff --git a/sdrgui/gui/glspectrumgui.cpp b/sdrgui/gui/glspectrumgui.cpp index 808325521..64bf9b78f 100644 --- a/sdrgui/gui/glspectrumgui.cpp +++ b/sdrgui/gui/glspectrumgui.cpp @@ -499,7 +499,7 @@ int GLSpectrumGUI::getAveragingValue(int averagingIndex) const int v = averagingIndex - 1; int m = pow(10.0, v/3 > m_averagingMaxScale ? m_averagingMaxScale : v/3); - int x; + int x = 1; if (v % 3 == 0) { x = 2; diff --git a/sdrgui/gui/valuedial.cpp b/sdrgui/gui/valuedial.cpp index 4fc002cd7..1d1b359ec 100644 --- a/sdrgui/gui/valuedial.cpp +++ b/sdrgui/gui/valuedial.cpp @@ -182,13 +182,16 @@ void ValueDial::paintEvent(QPaintEvent*) painter.setPen(m_colorMapper.getBoundaryColor()); painter.setBrush(Qt::NoBrush); - for(int i = 1; i < m_numDigits + m_numDecimalPoints; i++) { + + for (int i = 1; i < m_numDigits + m_numDecimalPoints; i++) + { painter.setPen(m_colorMapper.getBoundaryColor()); painter.drawLine(1 + i * m_digitWidth, 1, 1 + i * m_digitWidth, height() - 1); painter.setPen(m_colorMapper.getBoundaryAlphaColor()); painter.drawLine(0 + i * m_digitWidth, 1, 0 + i * m_digitWidth, height() - 1); painter.drawLine(2 + i * m_digitWidth, 1, 2 + i * m_digitWidth, height() - 1); } + painter.setPen(m_colorMapper.getBoundaryAlphaColor()); painter.drawLine(1, 1, 1, height() - 1); painter.drawLine(width() - 2, 1, width() - 2, height() - 1); @@ -201,13 +204,15 @@ void ValueDial::paintEvent(QPaintEvent*) painter.drawLine(1, height() - 1, width() - 1, height() - 1); painter.drawLine(width() - 1, height() - 1, width() - 1, 0); - if(m_hightlightedDigit >= 0) { + if (m_hightlightedDigit >= 0) + { painter.setPen(Qt::NoPen); painter.setBrush(m_colorMapper.getHighlightColor()); painter.drawRect(2 + m_hightlightedDigit * m_digitWidth, 1, m_digitWidth - 1, height() - 1); } - if(m_animationState == 0) { + if (m_animationState == 0) + { for(int i = 0; i < m_text.length(); i++) { painter.setClipRect(1 + i * m_digitWidth, 1, m_digitWidth, m_digitHeight * 2); painter.setPen(m_colorMapper.getSecondaryForegroundColor()); @@ -224,31 +229,39 @@ void ValueDial::paintEvent(QPaintEvent*) painter.setBrush(m_colorMapper.getSecondaryForegroundColor()); painter.drawRect(4 + m_cursor * m_digitWidth, 1 + m_digitHeight * 1.5, m_digitWidth - 5, m_digitHeight / 6); } - } else { - if(m_animationState != 0) { - for(int i = 0; i < m_text.length(); i++) { - if(m_text[i] == m_textNew[i]) { - painter.setClipRect(1 + i * m_digitWidth, 1, m_digitWidth, m_digitHeight * 2); - painter.setPen(m_colorMapper.getSecondaryForegroundColor()); - painter.drawText(QRect(1 + i * m_digitWidth, m_digitHeight * 0.6, m_digitWidth, m_digitHeight), Qt::AlignCenter, m_text.mid(i, 1)); - if(m_text[i] != m_groupSeparator) { - painter.setPen(m_colorMapper.getForegroundColor()); - painter.drawText(QRect(1 + i * m_digitWidth, m_digitHeight * -0.7, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], true)); - painter.drawText(QRect(1 + i * m_digitWidth, m_digitHeight * 1.9, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], false)); - } - } else { - int h = m_digitHeight * 0.6 + m_digitHeight * m_animationState / 2.0; - painter.setClipRect(1 + i * m_digitWidth, 1, m_digitWidth, m_digitHeight * 2); - painter.setPen(m_colorMapper.getSecondaryForegroundColor()); - painter.drawText(QRect(1 + i * m_digitWidth, h, m_digitWidth, m_digitHeight), Qt::AlignCenter, m_text.mid(i, 1)); - if(m_text[i] != m_groupSeparator) { - painter.setPen(m_colorMapper.getForegroundColor()); - painter.drawText(QRect(1 + i * m_digitWidth, h + m_digitHeight * -0.7, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], true)); - painter.drawText(QRect(1 + i * m_digitWidth, h + m_digitHeight * 1.9, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], false)); - } - } - } - } + } + else + { + for (int i = 0; i < m_text.length(); i++) + { + if (m_text[i] == m_textNew[i]) + { + painter.setClipRect(1 + i * m_digitWidth, 1, m_digitWidth, m_digitHeight * 2); + painter.setPen(m_colorMapper.getSecondaryForegroundColor()); + painter.drawText(QRect(1 + i * m_digitWidth, m_digitHeight * 0.6, m_digitWidth, m_digitHeight), Qt::AlignCenter, m_text.mid(i, 1)); + + if (m_text[i] != m_groupSeparator) + { + painter.setPen(m_colorMapper.getForegroundColor()); + painter.drawText(QRect(1 + i * m_digitWidth, m_digitHeight * -0.7, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], true)); + painter.drawText(QRect(1 + i * m_digitWidth, m_digitHeight * 1.9, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], false)); + } + } + else + { + int h = m_digitHeight * 0.6 + m_digitHeight * m_animationState / 2.0; + painter.setClipRect(1 + i * m_digitWidth, 1, m_digitWidth, m_digitHeight * 2); + painter.setPen(m_colorMapper.getSecondaryForegroundColor()); + painter.drawText(QRect(1 + i * m_digitWidth, h, m_digitWidth, m_digitHeight), Qt::AlignCenter, m_text.mid(i, 1)); + + if (m_text[i] != m_groupSeparator) + { + painter.setPen(m_colorMapper.getForegroundColor()); + painter.drawText(QRect(1 + i * m_digitWidth, h + m_digitHeight * -0.7, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], true)); + painter.drawText(QRect(1 + i * m_digitWidth, h + m_digitHeight * 1.9, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], false)); + } + } + } } } diff --git a/sdrgui/gui/valuedialz.cpp b/sdrgui/gui/valuedialz.cpp index d8c74f342..52b706577 100644 --- a/sdrgui/gui/valuedialz.cpp +++ b/sdrgui/gui/valuedialz.cpp @@ -256,7 +256,7 @@ void ValueDialZ::paintEvent(QPaintEvent*) painter.setPen(m_colorMapper.getSecondaryForegroundColor()); painter.drawText(QRect(1 + i * m_digitWidth, m_digitHeight * 0.6, m_digitWidth, m_digitHeight), Qt::AlignCenter, m_text.mid(i, 1)); - if(m_text[i] != m_groupSeparator) + if (m_text[i] != m_groupSeparator) { painter.setPen(m_colorMapper.getForegroundColor()); painter.drawText(QRect(1 + i * m_digitWidth, m_digitHeight * -0.7, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], true)); @@ -275,36 +275,33 @@ void ValueDialZ::paintEvent(QPaintEvent*) } else { - if(m_animationState != 0) + for(int i = 0; i < m_text.length(); i++) { - for(int i = 0; i < m_text.length(); i++) + if (m_text[i] == m_textNew[i]) { - if(m_text[i] == m_textNew[i]) - { - painter.setClipRect(1 + i * m_digitWidth, 1, m_digitWidth, m_digitHeight * 2); - painter.setPen(m_colorMapper.getSecondaryForegroundColor()); - painter.drawText(QRect(1 + i * m_digitWidth, m_digitHeight * 0.6, m_digitWidth, m_digitHeight), Qt::AlignCenter, m_text.mid(i, 1)); + painter.setClipRect(1 + i * m_digitWidth, 1, m_digitWidth, m_digitHeight * 2); + painter.setPen(m_colorMapper.getSecondaryForegroundColor()); + painter.drawText(QRect(1 + i * m_digitWidth, m_digitHeight * 0.6, m_digitWidth, m_digitHeight), Qt::AlignCenter, m_text.mid(i, 1)); - if(m_text[i] != m_groupSeparator) - { - painter.setPen(m_colorMapper.getForegroundColor()); - painter.drawText(QRect(1 + i * m_digitWidth, m_digitHeight * -0.7, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], true)); - painter.drawText(QRect(1 + i * m_digitWidth, m_digitHeight * 1.9, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], false)); - } + if (m_text[i] != m_groupSeparator) + { + painter.setPen(m_colorMapper.getForegroundColor()); + painter.drawText(QRect(1 + i * m_digitWidth, m_digitHeight * -0.7, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], true)); + painter.drawText(QRect(1 + i * m_digitWidth, m_digitHeight * 1.9, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], false)); } - else - { - int h = m_digitHeight * 0.6 + m_digitHeight * m_animationState / 2.0; - painter.setClipRect(1 + i * m_digitWidth, 1, m_digitWidth, m_digitHeight * 2); - painter.setPen(m_colorMapper.getSecondaryForegroundColor()); - painter.drawText(QRect(1 + i * m_digitWidth, h, m_digitWidth, m_digitHeight), Qt::AlignCenter, m_text.mid(i, 1)); + } + else + { + int h = m_digitHeight * 0.6 + m_digitHeight * m_animationState / 2.0; + painter.setClipRect(1 + i * m_digitWidth, 1, m_digitWidth, m_digitHeight * 2); + painter.setPen(m_colorMapper.getSecondaryForegroundColor()); + painter.drawText(QRect(1 + i * m_digitWidth, h, m_digitWidth, m_digitHeight), Qt::AlignCenter, m_text.mid(i, 1)); - if(m_text[i] != m_groupSeparator) - { - painter.setPen(m_colorMapper.getForegroundColor()); - painter.drawText(QRect(1 + i * m_digitWidth, h + m_digitHeight * -0.7, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], true)); - painter.drawText(QRect(1 + i * m_digitWidth, h + m_digitHeight * 1.9, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], false)); - } + if (m_text[i] != m_groupSeparator) + { + painter.setPen(m_colorMapper.getForegroundColor()); + painter.drawText(QRect(1 + i * m_digitWidth, h + m_digitHeight * -0.7, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], true)); + painter.drawText(QRect(1 + i * m_digitWidth, h + m_digitHeight * 1.9, m_digitWidth, m_digitHeight), Qt::AlignCenter, digitNeigh(m_text[i], false)); } } }