From 376400e4b88ee4b6ca284a8dfce47c95921545fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 8 Apr 2018 14:15:33 +0200 Subject: Don't insert another column when statictable widget is not wider This makes static table widget to have only one column until it's wider then higher. --- qtmips_gui/statictable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qtmips_gui') diff --git a/qtmips_gui/statictable.cpp b/qtmips_gui/statictable.cpp index 594476b..c989491 100644 --- a/qtmips_gui/statictable.cpp +++ b/qtmips_gui/statictable.cpp @@ -148,7 +148,7 @@ int StaticTableLayout::real_row_height() { } int StaticTableLayout::layout_count_approx(const QRect &rect) const { - if (items.size() <= 0) + if (items.size() <= 0 || rect.width() < rect.height()) return 1; // Note: for some reason (probably optimalisation) when qlabel is not visible it reports 0 size. So we have to found at least one that is visible int vis = 0; -- cgit v1.2.3