Question

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 ?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top