Results 1 to 4 of 4

Thread: accessing qdockwidgets given the qmainwindow

  1. #1
    Join Date
    May 2011
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default accessing qdockwidgets given the qmainwindow

    I don't see any QMainWindow method for accessing its QDockWidgets. Is there a better way to do this than to call children() and loop through the Objectlist and dynamic cast as QDockWidget?

  2. #2
    Join Date
    Jul 2011
    Location
    Pune India
    Posts
    3
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: accessing qdockwidgets given the qmainwindow

    Hi

    Actually don't understand what you exactly want to do with Dock widget.

    But QMainWindow has the methods related to Doc Widget as,

    addDockWidget ( Qt:ockWidgetArea, QDockWidget * )
    addDockWidget ( Qt:ockWidgetArea, QDockWidget *, Qt::Orientation )
    dockOptions () const : DockOptions
    dockWidgetArea ( QDockWidget * ) const : Qt:ockWidgetArea

    .... Etc.. and lots of to access and manage the Doc Widget.

    Refer the Qt documentation to understand it better.

    Thanks
    Prashant Moglaikar

  3. #3
    Join Date
    May 2011
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: accessing qdockwidgets given the qmainwindow

    None of the methods you mention or those described in the documentation seem to actually provide access to the dock widgets. Lets say you want to provide a toolbar button that hides all dock widgets. How do you access the dock widgets?

  4. #4
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: accessing qdockwidgets given the qmainwindow

    try

    Qt Code:
    1. findChildren<QDockWidget*>
    To copy to clipboard, switch view to plain text mode 

  5. The following user says thank you to FelixB for this useful post:

    gkarthick5 (29th July 2011)

Similar Threads

  1. Replies: 3
    Last Post: 13th November 2011, 08:12
  2. Replies: 0
    Last Post: 22nd July 2011, 15:38
  3. Replies: 0
    Last Post: 5th October 2010, 09:20
  4. I need help resizing QDockWidgets Mannually
    By aarelovich in forum Qt Programming
    Replies: 3
    Last Post: 22nd June 2010, 18:24
  5. Accessing QMainWindow methods
    By vieraci in forum Qt Programming
    Replies: 2
    Last Post: 21st April 2009, 08:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.