Results 1 to 7 of 7

Thread: dockwindows in qt 4

  1. #1
    Join Date
    Mar 2007
    Posts
    15
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default dockwindows in qt 4

    how to return list of dockwindows in qt 4. Something similar to following function dockwindows() in Qt4.


    QList<Q3DockWindows *> list = mainWindow->dockWindows();

    Qt 3 function : QList<Q3DockWindow *> Q3MainWindow::dockWindows ( Qt:ock dock ) const

    Thanks,

  2. #2
    Join Date
    Mar 2007
    Posts
    15
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: dockwindows in qt 4

    I tried with dockWidgetArea( ) but still did not work because it did not return list type value.

    QList <QDockWidget *> dw = mainWindow->dockWidgetArea(QDockWidget *);

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: dockwindows in qt 4

    Qt Code:
    1. QList<QDockWidget*> = qFindChildren<QDockWidget*>(mainWindow, QString());
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Mar 2007
    Posts
    15
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: dockwindows in qt 4

    I have tried the above mention code still I am not able to iterate through dockwidget list still list is not being intialized properly.
    QDockWidget * pDockWidget;

    QList<QDockWidget*>dw = qFindChildren<QDockWidget*>(mainWindow, QString());

    for (int i = 0; i < dw.size(); ++i)

    {
    dw.at(i)->display();
    }

    r I have tried the following too.


    QList<QDockWidget*> dw = qFindChildren<QDockWidget*>(mainWindow);

    QListIterator<QDockWidget *> i(dw);
    while (i.hasNext())
    {
    i.next()->display();
    }

  5. #5
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: dockwindows in qt 4

    Is display() a member of QDockWidget? I haven't seen such a memeber...

    What are you trying to do with the dock widgets?

    Marcel

  6. #6
    Join Date
    Mar 2007
    Posts
    15
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: dockwindows in qt 4

    sorry for typing wrong . I am using show() fucntion actually it is a member of QWidget. But what I am doing is displaying dockwindows in small screen and when the screen is full I am trying to hide these windows. Even using show( ) still did not work.


    QList<QDockWidget*>dw = qFindChildren<QDockWidget*>(mainWindow, QString());

    for (int i = 0; i < dw.size(); ++i)

    {
    dw.at(i)->show();
    }

  7. #7
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: dockwindows in qt 4

    Maybe your dock widgets are outside the screen area...
    Try this:

    for (int i = 0; i < dw.size(); ++i)
    {
    dw.at(i)->show();
    QRect geom = dw[i]->geometry();
    }

    and examine the geom QRect. See where the widget is positioned.
    If they are outside the viewable area, then maybe you should use move() to bring them back.

    Marcel

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
  •  
Qt is a trademark of The Qt Company.