MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / paint

Method paint

app/src/UI/Widgets/Waterfall.cpp:753–786  ·  view source on GitHub ↗

* @brief Renders the spectrogram and composites it with the cached axis layer. */

Source from the content-addressed store, hash-verified

751 * @brief Renders the spectrogram and composites it with the cached axis layer.
752 */
753void Widgets::Waterfall::paint(QPainter* painter)
754{
755 if (!painter)
756 return;
757
758 painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
759 painter->setRenderHint(QPainter::Antialiasing, true);
760 painter->setRenderHint(QPainter::TextAntialiasing, true);
761
762 if (m_axisDirty)
763 renderAxisLayer();
764
765 const QRectF outerRect(0, 0, width(), height());
766 painter->fillRect(outerRect, m_outerBg);
767
768 const QRectF& plotRect = m_cachedPlotRect;
769 if (plotRect.isEmpty())
770 return;
771
772 painter->fillRect(plotRect, m_innerBg);
773
774 if (!m_image.isNull()) {
775 painter->save();
776 painter->setClipRect(plotRect);
777 drawHistoryImage(painter, plotRect);
778 painter->restore();
779 }
780
781 if (!m_axisLayer.isNull())
782 painter->drawImage(outerRect, m_axisLayer, QRectF(m_axisLayer.rect()));
783
784 if (m_cursorEnabled && m_cursorHovering)
785 drawCursor(painter, plotRect);
786}
787
788//--------------------------------------------------------------------------------------------------
789// Axis layer cache

Callers

nothing calls this directly

Calls 6

fillRectMethod · 0.80
isEmptyMethod · 0.80
saveMethod · 0.80
drawImageMethod · 0.80
rectMethod · 0.80
restoreMethod · 0.45

Tested by

no test coverage detected