X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fviews%2Fdecoder_output%2FQHexView.cpp;h=586a5cdac373da49b36515b1903349c7500e1d5a;hb=b2b18d3aabf497666c3cff76d0c6663623539e36;hp=2289a07d509fd6bff90d5360b42b4a67a42df9ab;hpb=01ba5ed7e7094dead8002ee430d67bde106f8835;p=pulseview.git diff --git a/pv/views/decoder_output/QHexView.cpp b/pv/views/decoder_output/QHexView.cpp index 2289a07d..586a5cda 100644 --- a/pv/views/decoder_output/QHexView.cpp +++ b/pv/views/decoder_output/QHexView.cpp @@ -69,6 +69,8 @@ void QHexView::setData(QByteArray *data) data_ = data; cursorPos_ = 0; resetSelection(0); + + viewport()->update(); } void QHexView::showFromOffset(size_t offset) @@ -79,12 +81,16 @@ void QHexView::showFromOffset(size_t offset) int cursorY = cursorPos_ / (2 * BYTES_PER_LINE); verticalScrollBar() -> setValue(cursorY); } + + viewport()->update(); } void QHexView::clear() { verticalScrollBar()->setValue(0); data_ = nullptr; + + viewport()->update(); } QSize QHexView::getFullSize() const @@ -121,7 +127,7 @@ void QHexView::paintEvent(QPaintEvent *event) // Fill widget background painter.fillRect(event->rect(), palette().color(QPalette::Base)); - if (!data_) { + if (!data_ || (data_->size() == 0)) { painter.setPen(palette().color(QPalette::Text)); QString s = tr("No data available"); int x = (areaSize.width() - fontMetrics().boundingRect(s).width()) / 2;