I’m trying to create a UI that has several buttons (on the left bottom), and when you click each of them, a different frame appears at the right side. I have achieved to be able to show/hide it, but I’m still not able to make it to be hidden from the beginning, do you have any idea of how to do this?
The other problem is about overlapping. It needs to change which frame is on top, but apparently this is not possible. So how can I bring a frame to the top of the others? Is there a way? unchecking many radiobuttons (I don’t know how), despite it is undesirable, would do the trick also
Note that I’m just working with QT Creator (I’m doing a widget in this case), so if you explain anything about actual coding, you’d have to explain it in the easiest and step-by-step… sorry about that
Thank you all so much!
There is a slot to bring a widget to the top – it’s called “raise”. You can trigger this slot just like you are triggering the setShown slot.
Setting something to invisible right from the beginning is a little trickier. What you need to do is to call setShown(false) on your frame just after it has been created. Normally we do this in code.
Usually, when you create a ui file, there should be an accompanying cpp and h file of the same name. So in your case you have a Raka.ui file, there should also be a Raka.h and Raka.cpp file. If you don’t have one you should go ahead and create them in QtCreator.
Your header file should look something like this:
And then your cpp file…
In your constructor you can do any kind of initialization you want. In this case we want to make “MyFrame” invisible, so we call setShown and pass false.
I hope that helps.