Frage

I wonder if it's possible to somehow prepare DockWidgets from the UI-Designer. There's no Object-Property like "visible" or "closed" so if I want to create another MainWindow from the MainWindow-Constructor and then set it as the DockWidget's Widget it will be visible upon Application-Launch.

I just want to let the user toggle those DockWidgets visible and have them all invisible at Application-Launch.

Therefore I have to setVisible(false) when I construct the MainWindow which means the DockWidget is first visible and then hidden at runtime.

This is not really a problem. But I wonder if the "placeholder" feature in UIDesigner would do what I want to do: Somehow prepare DockWidgets in UIDesigner but initialize them when they are needed and not initialize and hide them.

If not, what would be the better approach to achieve this using UIDesigner? Without Designer it's an easy task to prepare pointers on DockWidgets and initialize them when they are used the first time. Is that possible with UI-Designer too?

War es hilfreich?

Lösung

Not to my knowledge, unfortunately for you. It's not part of your question, but I'd advise you to use QAction* QDockWidget::toggleViewAction () const to manage dockwidgets visibility

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top