views:

79

answers:

1

I am building an interface similar in features to the Eclipse IDE for a telemetry project. I'll be showing many different widgets and each of them needs to be resizable / moveable / popped_out / popped_in / hideable / "fullscreen-able" / etc... like a "perspective" of the Eclipse IDE.

What would be the best approach using QT? Which classes to use? Using QT's QMainWindow / QDockWidgets / LayoutManager or since any widget can be moved anywhere would it be best to handle everything by hand-coding ?

+2  A: 

In my opinion, QMainWindow gives you a good start. You can create and manage DockWidgets all around your central widget and add status and tool bars fairly easily.

The QDockWidget class already handles the dock/undock hide/show options, so all you have to do is do your own widget.

Also, if you want widgets to be hideables, you could look into QSplitter that allows to show two widgets, one on either side and resize them. They are collapsibles by default.

Hope this helps.

EDIT (to answer the comment question):

You can use QSettings to do so. It allows you to save any settings you want in the system directory.

You do so like this:

QSettings settings;
settings.setValue("editor/wrapMargin", 68);

and to get it back:

int margin = settings.value("editor/wrapMargin").toInt();

Hope this helps.

Live
@Live : Thanks for answering! That is a pretty good start! Do you know how to manipulate / save the layout once the user has done moving the widgets? For instance, i'd like to be able to create +n+ rows on the right.
David
Edited my post to answer your new question.
Live
@Live : my concern is about finding the information on the layout itself, more than saving it to disk. How are the widgets layed out when closing the app? I'm assuming QT is adding new LayoutManager on the fly as you move widgets, do you know which properties to look at?
David
It looks like saveState/saveGeometry is the way to go!
David
You are right, saveGeometry will do what you need.
Live