Designing in QtCreator.
-
When your UI gets too cramped a good solution is to use the "outliner" the window on top of the properties on the left that shows a tree of all UI elements, you can use it to select elements as well as to drag and drop elements onto other elements like you do in the UI editor.
I wouldn't recommend organizing different panels into separate widgets because that will make accessing different UI elements harder, you have to create a bunch of extra signals and slots and such. There is absolutely no point in doing so unless you plan to reuse those "panels" - if not, it just adds inconvenience, more typing, more connections. Do not make modular something you don't need to be a module, and you can still access every item through the ui pointer directly.
-
Hi,
Thanks for your reply.
Actually my main window consists of many UI elements.
So while designing I am unable to locate that element which I want to edit/design/modify as there are many elements on top of each other.
What I want to know is while editing a particular element is there any way that can hide all other elements? -
[quote author="Ketan Shah" date="1358329825"]Hi,
Thanks for your reply.
Actually my main window consists of many UI elements.
So while designing I am unable to locate that element which I want to edit/design/modify as there are many elements on top of each other.[/quote]Could you post a screenshot of what you mean? I find it hard to visualise your problem.
[quote author="Ketan Shah" date="1358329825"]What I want to know is while editing a particular element is there any way that can hide all other elements?[/quote]
Not as far as I know...
-
Hello!
I think you can do it with "foreach":http://doc.qt.digia.com/qt/containers.html#the-foreach-keyword, looking for all widgets except the current one, and calling ->hide() on every other. Maybe something like
@foreach (QWidget *widget, QApplication::topLevelWidgets())
{
if (!wigdet->hasFocus())
widget->hide();
}@Hope it helps.
Regards
-
Mmmm sorry, you want to do it before execution? I agree with goblincoding, the most similar thing to that is to disable every widget, but they aren't hidden.
-
!http://s13.postimage.org/4mrrvmjxz/test.pnghttp://(Test)!
I have uploaded the screenshot of my Ui file, please check it.
The Ui file consists of 3 groupboxes, each groupbox contains some elements.
The problem is when I want to modify/redesign GroupBox1, I am not able to see it.
So my question is how can I hide GroupBox and GroupBox2, when I want to redesign GroupBox1? The same goes for other elements too.
Hope now my question is clear. -
OK, now it all makes sense. Your problem is that you aren't making use of Qt's layout system. Have a look at the "widgets and layouts":https://qt-project.org/doc/qt-4.8/widgets-and-layouts.html documentation and pay special attention to "layout management":https://qt-project.org/doc/qt-4.8/layout.html
That should help you solve your problem :)
EDIT: If you really want to have widgets "on top of each other", have a look at "QStackedWidget":https://qt-project.org/doc/qt-4.8/qstackedwidget.html
-
Or even "QStackedLayout":http://qt-project.org/doc/qt-4.8/qstackedlayout.html.
-
Hi,
Thanks @goblincoding and @pke62 for your replies. It worked.
But now I have one more problem while using QStackedWidget.
How can I hide the borders of QStackedWidget that appears on all the four sides of it? -
If I understand you correctly, it sounds as if you still aren't using layouts correctly, please see "this previous post":https://qt-project.org/forums/viewthread/23776/#110704 for links to more information.
-
[quote author="goblincoding" date="1358514448"] If you really want to have widgets "on top of each other", have a look at "QStackedWidget":https://qt-project.org/doc/qt-4.8/qstackedwidget.html[/quote]
In the documentation for QStackedWidget referenced above by goblincoding, look for:
setFrameShadow ( Shadow )
setFrameShape ( Shape )
setFrameStyle ( int )