PDA

View Full Version : dockwindows in qt 4



Project25
2nd April 2007, 21:01
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::Dock dock ) const

Thanks,

Project25
3rd April 2007, 01:04
I tried with dockWidgetArea( ) but still did not work because it did not return list type value.

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

wysota
3rd April 2007, 01:08
QList<QDockWidget*> = qFindChildren<QDockWidget*>(mainWindow, QString());

Project25
3rd April 2007, 18:30
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();
}

marcel
3rd April 2007, 18:33
Is display() a member of QDockWidget? I haven't seen such a memeber...

What are you trying to do with the dock widgets?

Marcel

Project25
3rd April 2007, 18:41
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();
}

marcel
3rd April 2007, 18:46
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