]> sigrok.org Git - pulseview.git/commitdiff
QHexView: Also check for empty chunk list
authorSoeren Apel <redacted>
Sun, 1 Mar 2020 13:43:25 +0000 (14:43 +0100)
committerUwe Hermann <redacted>
Mon, 16 Mar 2020 22:36:50 +0000 (23:36 +0100)
pv/views/decoder_binary/QHexView.cpp

index ccd50f87bccc1291195d2b515a4ee70418e422f0..cdaf1b5d4ecba0d6c78055a5d85adfe3ccb81d22 100644 (file)
@@ -283,7 +283,7 @@ void QHexView::paintEvent(QPaintEvent *event)
        // Fill widget background
        painter.fillRect(event->rect(), palette().color(QPalette::Base));
 
-       if (!data_ || (data_size_ == 0)) {
+       if (!data_ || (data_size_ == 0) || (data_->chunks.empty())) {
                painter.setPen(palette().color(QPalette::Text));
                QString s = tr("No data available");
                int x = (areaSize.width() - fontMetrics().boundingRect(s).width()) / 2;