Hi guys,
Seems to be silly question but I'm unable to achieve it.

I'm porting my application from Qt3 to Qt4 and is using Qt3 support classes for a while. The problem is I use Q3MainWindows, Q3DockWindow, QSplitter, Q3Frame as shown in code below. Now I want to hide/unhide the dockWindow. I do this by right clicking on toolBar. First I right click and the dockWindow is hidden then again I rightClick and click on 'routes' but the dockWindow doesnt appear. I dont know why.

Please dont suggest me to use QMainWindow, QDockWidget or so... I have already made lots of changes and cant revert back. Please help me to rectify this problem with the solution given
Qt Code:
  1. #include <Q3MainWindow>
  2. #include <QSplitter>
  3.  
  4. class MainWindow : public Q3MainWindow
  5. {
  6. Q_OBJECT
  7.  
  8. public:
  9. MainWindow(QWidget *parent = 0);
  10. ~MainWindow();
  11.  
  12. private:
  13. Q3DockWindow *treeDock;
  14. QSplitter *s2;
  15. Q3Frame *frame;
  16.  
  17. };
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. MainWindow::MainWindow(QWidget *parent)
  2. : Q3MainWindow(parent)
  3. {
  4. treeDock = new Q3DockWindow( this, "routes" );
  5. Q_CHECK_PTR( treeDock );
  6. moveDockWindow( treeDock, Qt::Left );
  7. treeDock->setHorizontallyStretchable( true );
  8. treeDock->setVerticallyStretchable( true );
  9. treeDock->setResizeEnabled( true );
  10. treeDock->setOrientation( Qt::Vertical );
  11. treeDock->setCaption( tr("Routes") );
  12.  
  13. s2 = new QSplitter( Qt::Vertical, this, "splitter" );
  14. Q_CHECK_PTR( s2 );
  15. setCentralWidget( s2 );
  16. frame = new Q3Frame( s2 );
  17. frame->setBackgroundColor( Qt::white );
  18. frame->setAutoFillBackground( true );
  19.  
  20. Q3PopupMenu *file = new Q3PopupMenu;
  21. Q_CHECK_PTR( file );
  22.  
  23. int openId = file->insertItem( tr("&Open..."), this, SLOT(fileOpen()),
  24. Qt::CTRL+Qt::Key_O );
  25.  
  26. Q3PopupMenu *edit = new Q3PopupMenu;
  27. Q_CHECK_PTR( edit );
  28. int copyId = edit->insertItem( tr("&Copy"), this, SLOT(copy()), Qt::CTRL+Qt::Key_C );
  29.  
  30. menuBar()->insertItem( tr("&File"), file );
  31. menuBar()->insertItem( tr("&Edit"), edit );
  32. }
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. #include <QtGui/QApplication>
  2. #include "mainwindow.h"
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QApplication a(argc, argv);
  7. MainWindow w;
  8. w.show();
  9. a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
  10. return a.exec();
  11. }
To copy to clipboard, switch view to plain text mode 

Thanks in advance