I want to make a group box shown only when a radio button is selected.
I managed to do that by connecting the toggled(bool)
signal of the radio button to the setShown(bool)
slot of the group box.
The problem is that the radio button is initially deselected but the group box is initially shown so I have to select/deselect the radio button to make it disappear.
Is there any way I can make the group box initially invisible in Qt Creator Designer without having to do it in code?
相关问题
- QML: Cannot read property 'xxx' of undefin
- QTextEdit.find() doesn't work in Python
- QT Layouts, how to make widgets in horizontal layo
- QT GUI freezes even though Im running in separate
- QGraphicsView / QGraphicsScene size matching
相关文章
- ubuntu20.4中c#通过c++库调用python脚本
- Qt槽函数自动执行多遍
- Is there a non-java, cross platform way to launch
- How to get a settings storage path in a cross-plat
- Why doesn't valgrind detect a memory leak in m
- QTreeView remove decoration/expand button for all
- qt界面拥挤
- how do I correctly return values from pyqt to Java
You can try playing round with the Properties (look at setHidden), but it's much easier to do it in the code.
So you'd do:
That's the easiest way really, I've never had much luck with adding properties in Designer that Qt already uses.
You can't.
The
visible
property seems to be voluntarily removed from the property editor of Qt Designer and you can't add it back.You can add the property manually to the .ui file by adding the following XML block inside the node for the widget you want to hide:
But the widget won't be visible or movable when you reopen the interface with the designer. It will still appear in the widget hierarchy though.