[Qt-interest] How can I remove/hide all toolbars from a QMainWindow?
Malyushytsky, Alex
alex at wai.com
Tue Jun 7 12:09:17 CEST 2011
Iterate through QMainWindow'se children and if child is derived from QToolBar remove it /delete, etc.
I suggest to use:
QObject::children (); // to get list of children
QObject::inherits(const char * className);// to determine if object class is QToolBar subclass
QMainWindow::removeToolBar ( QToolBar * toolbar );//to remove toolbar
Regards,
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 Emiliano Mennucci
Sent: Tuesday, June 07, 2011 2:13 AM
To: qt-interest at qt.nokia.com
Subject: [Qt-interest] How can I remove/hide all toolbars from a QMainWindow?
I have a third party QMainWindow and I need to embed it in my own
QMainWindow (i.e. use it as a normal widget). I know it's not a best
practise (to say the least) but I have no other way right now.
I need to hide the third-party window's statusbar, menubar and
toolbars. I was able to remove the statusbar (setStatusBar(0)) and the
menubar (setMenuBar(0)) but I cannot find a way to do the samething
with the toolbar area
Is there any way to hide/remove toolbars?
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest
---------------------------------------------------------------------------------------------------
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.”
More information about the Qt-interest-old
mailing list