22 #include <qapplication.h>
23 #include <qmainwindow.h>
27 setOrientation(Vertical);
29 setCloseMode(QDockWindow::Always);
37 QDockWindow::setWidget(w);
38 if(!(w->inherits(
"VTabWidget")))
41 setResizeEnabled(
false);
42 setHorizontallyStretchable(
false);
43 connect(m_tabWidget,SIGNAL(widgetStackHidden()),
this,SLOT(slotStackHidden()));
44 connect(m_tabWidget,SIGNAL(widgetStackShown()),
this,SLOT(slotStackShown()));
45 connect(
this,SIGNAL(placeChanged( QDockWindow::Place )),SLOT(updatePosition(QDockWindow::Place)));
51 void VTabbedDockWidget::slotStackShown()
53 setFixedExtentWidth(m_tabWidget->
sizeHint().width());
54 setHorizontallyStretchable(
true);
55 setResizeEnabled(
true);
61 void VTabbedDockWidget::slotStackHidden()
63 setFixedExtentWidth(m_tabWidget->
sizeHint().width());
64 setHorizontallyStretchable(
false);
65 setResizeEnabled(
false);
71 void VTabbedDockWidget::updatePosition(QDockWindow::Place p)
75 if(!(qApp->mainWidget()->inherits(
"QMainWindow")))
77 QMainWindow *mainWin = (QMainWindow*)(qApp->mainWidget());
82 bool res = mainWin->getLocation (
this, dock, ind, nl, eo );
85 if(dock == QDockWindow::DockLeft)
87 else if(dock == QDockWindow::DockRight)
89 mainWin->lineUpDockWindows();