summaryrefslogtreecommitdiff
path: root/grc
diff options
context:
space:
mode:
authorChristophe Seguinot <christophe.seguinot@univ-lille.fr>2021-02-20 22:58:27 +0100
committermormj <34754695+mormj@users.noreply.github.com>2021-03-10 09:11:19 -0500
commit9a25928a621081fae49b81ed4b2eb221cded9d1b (patch)
treea73a8ebd9afcb5de50b992dd3547d6dfdf3bd84a /grc
parent8ba9c53d8ec95c9453cb92ab81a19bde9b03c719 (diff)
grc: order blocks with GUI Hint first
Signed-off-by: Christophe Seguinot <christophe.seguinot@univ-lille.fr>
Diffstat (limited to 'grc')
-rw-r--r--grc/core/generator/top_block.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/grc/core/generator/top_block.py b/grc/core/generator/top_block.py
index 6653bc7ae0..02f6990a94 100644
--- a/grc/core/generator/top_block.py
+++ b/grc/core/generator/top_block.py
@@ -196,6 +196,18 @@ class TopBlockGenerator(object):
]
blocks = expr_utils.sort_objects(blocks, operator.attrgetter('name'), _get_block_sort_text)
+
+ # Ordering blocks : blocks with GUI Hint must be processed first to avoid PyQT5 superposing blocks
+ for block in blocks:
+ try:
+ block.without_gui_hint = (block.params['gui_hint'].get_value()=='')
+ except KeyError:
+ # No gui hint
+ block.without_gui_hint = True
+ pass
+
+ blocks = sorted(blocks, key=lambda block: block.without_gui_hint)
+
blocks_make = []
for block in blocks:
make = block.templates.render('make')