Guys,

I am trying to have a toolbar and 4 dockwidgets in my QMainWindow and I did it like this in the constructor.

Qt Code:
  1. // DockWidget No 1.
  2. QDockWidget *dock = new QDockWidget(QObject::tr("Sensor 1 - 12"), this);
  3. dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
  4. ptrTrendPlotter1 = new TrendPlotter(dock,TrendPlotter::sensor1to12);
  5.  
  6. dock->setWidget(ptrTrendPlotter1);
  7. addDockWidget(Qt::LeftDockWidgetArea, dock);
  8.  
  9. // DockWidget No 2.
  10. dock = new QDockWidget(QObject::tr("Sensor 13 - 24"), this);
  11. dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
  12. ptrTrendPlotter2 = new TrendPlotter(dock,TrendPlotter::sensor13to24);
  13.  
  14. dock->setWidget(ptrTrendPlotter2);
  15. addDockWidget(Qt::LeftDockWidgetArea, dock);
  16.  
  17. // DockWidget No 3.
  18. dock = new QDockWidget(QObject::tr("Sensor 25 - 36"), this);
  19. dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
  20. ptrTrendPlotter3 = new TrendPlotter(dock,TrendPlotter::sensor25to36);
  21.  
  22. dock->setWidget(ptrTrendPlotter3);
  23. addDockWidget(Qt::RightDockWidgetArea, dock);
  24.  
  25. // DockWidget No 4.
  26. dock = new QDockWidget(QObject::tr("Sensor 37 - 48"), this);
  27. dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
  28. ptrTrendPlotter4 = new BJSEECTrendPlotter(dock,BJSEECTrendPlotter::sensor37to48);
  29.  
  30. //Toolbar
  31. toolBar = new QToolBar(this);
  32. QToolButton *btnZoom = new QToolButton(toolBar);
  33. btnZoom->setText("Zoom");
  34. btnZoom->setCheckable(true);
  35. btnZoom->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
To copy to clipboard, switch view to plain text mode 

My Problem is the output/result is that in my window the tool bar area is covered by the dockwidgets. Somehow the toolbar area is not respected by the dockwidgets. If you notice in my constructor i did not set any mainWidget for my QMainWindow I was wondering if this is the case and if it is then how can i get away with it. My main objective in my window is to have 4 widgets displayed ( TrendPlotter) but the user can arrange them to whatever they want or they can float the widget out of the main window.

cheers,

baray98