Convert QWidget back to QLayout
-
thanks for your reply. I've been layouting the widgets, and then I morph that layout into QWidget. after that I want that QWidget back to layout again, but it seems impossible. so I manage that I can group the widgets with morph into QGroupBox. It is newbie's issue, hehe
-
@mimamrafi said in Convert QWidget back to QLayout:
and then I morph that layout into QWidget.
after that I want that QWidget back to layout again
Again, sorry, but Morph into just does not do that. It does not morph layouts, only some
QWidget
type into some otherQWidget
type. See e.g. https://stackoverflow.com/questions/6533329/what-is-the-use-of-morph-into-in-qtThe practical use is to quickly convert widgets into other, similar widgets.
So I don't know how to answer. But I presume morphing is "one-way", I don't think you can "un-morph" back to what you started with, though not certain. It behoves you to keep a copy of the
.ui
file before you Morph into, in case you want to go back!I will say one other from your screenshot. From what I can see you have 8 identical lines/rows of (pretty complex) multiple widgets. If these are all individual widgets I suspect you will find it "inconvenient" when you come to address each of these in your code. I would be designing one of these as its own widget, and then either creating multiple copies dynamically at runtime or possibly using Designer's Promote to ... to make it possible to design a container widget with 8 of them. The top-level container might then be, say, a
QListWidget
to hold any number of rows of these.However, I'm afraid I am not offering to hold your hand through that. Maybe you will find that too complex at present and would prefer to continue with your single, "big" widget. If so feel free to ignore this suggestion :)