[Qt-interest] any elegant to handle toolbar visibility?

Malyushytsky, Alex alex at wai.com
Thu Jul 7 20:34:40 CEST 2011


Is problem description unclear or nobody can see better way to do it?

Alex

-----Original Message-----
From: qt-interest-bounces+alex=wai.com at qt.nokia.com [mailto:qt-interest-bounces+alex=wai.com at qt.nokia.com] On Behalf Of Malyushytsky, Alex
Sent: Tuesday, July 05, 2011 6:08 PM
To: qt-interest at qt.nokia.com
Subject: [Qt-interest] any elegant to handle toolbar visibility?

My application uses multi-view design. Each view is a QMainWindow subclass.
Different views display different menus/toolbars/docking widgets.
Which view to display is define by QStackWidget (and some logic behind it).

Desired behavior is to show only specific for current QMainWindow toolbars/docking widgets.
Unfortunately even when QMainWindow is hidden (even if I hide it explicitly ) floating widgets are still shown.

I definitely could hide them manually when current index of stacked widget is changed,
but then you need to make it visible (if it was not manually hidden, which has to be tracked somewhere ). Also this requires customize saving and/or loading widget states routine, cause
wrong visibility flag will be written.

As a quick and dirty trick I disable toolbars and docking widgets of the hidden view.
But I still prefer visibility of toolbars/docking widgets being toggled.

To be fair I would expect child widgets to be hidden automatically if their parent is hidden, even if they are undocked. Unfortunately it does not work this way.

Anybody see any elegant solution?

Thanks in advance,

        Alex Malyushytsky


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

“This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you.”

“Please consider our environment before printing this email.”
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest


More information about the Qt-interest-old mailing list