From 78867bb76bf70f3b906d1a1a96edd45a88674c44 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Thu, 18 Dec 2014 12:57:42 +0100 Subject: [PATCH] Space table widget appropriately for Qt < 5.3 Works this way at least with 5.2 from Ubuntu 14.04 Note: this is a backup commit before replacing the whole thing by QLabel + HTML just in case we want to get back to this implementation one day --- src/gui/widgets/BasicBlockWidget.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/BasicBlockWidget.cxx b/src/gui/widgets/BasicBlockWidget.cxx index 7b33fe0..94e0758 100644 --- a/src/gui/widgets/BasicBlockWidget.cxx +++ b/src/gui/widgets/BasicBlockWidget.cxx @@ -6,6 +6,8 @@ BasicBlockWidget::BasicBlockWidget(const QString& name, BasicBlock * block) next[0] = NULL; next[1] = NULL; _widget.move(5, 20); _widget.setGridStyle(Qt::NoPen); + _widget.setShowGrid(false); + _widget.setWordWrap(false); _widget.setMinimumHeight(_widget.rowHeight(0) + 10); _widget.setMaximumHeight(20); _widget.resizeColumnToContents(0); @@ -51,14 +53,14 @@ void BasicBlockWidget::addItem(uint8_t* bytes, size_t num_bytes, _widget.columnWidth(0) + _widget.columnWidth(1) + _widget.columnWidth(2) + - 2; + 5; _widget.setMinimumWidth(column_width); - _widget.setMinimumHeight(_widget.rowHeight(0) * (_widget.rowCount()) + 2); - _widget.setMaximumHeight(_widget.rowHeight(0) * (_widget.rowCount()) + 2); + _widget.setMinimumHeight((1 + _widget.rowHeight(0)) * (_widget.rowCount()) + 2); + _widget.setMaximumHeight((1 + _widget.rowHeight(0)) * (_widget.rowCount()) + 2); - height = _widget.rowHeight(0) * (_widget.rowCount()) + 25; + height = (1 + _widget.rowHeight(0)) * (_widget.rowCount()) + 25; width = column_width + 10; if (width < 270) width = 270; } -- 2.39.2