Hi,
I have a problem with my QDockWidget, I want it to take all available width space. But it only takes the minimum space...

This is the source code that I do :

Qt Code:
  1. //testWidget.h
  2. class testWidget : public QWidget
  3. {
  4. Q_OBJECT
  5.  
  6. public:
  7. explicit testWidget(QWidget *parent = 0);
  8. QLabel test;
  9. QPushButton testButton;
  10.  
  11. };
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. //testWidget.cpp
  2. testWidget::testWidget(QWidget *parent) :
  3. QWidget(parent)
  4. {
  5. setStyleSheet("background-color: yellow");
  6.  
  7. test.setText("test label");
  8. test.setParent(this);
  9. test.setVisible(true);
  10.  
  11. testButton.setText("TestButton");
  12. testButton.setParent(this);
  13. testButton.move(0, 20);
  14. testButton.setVisible(true);
  15. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. //mainWindow.h
  2. class mainWindow : public QMainWindow
  3. {
  4. Q_OBJECT
  5.  
  6. public:
  7. explicit mainWindow(QWidget *parent = 0);
  8. testWidget *testW;
  9. };
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. //mainWindow.cpp
  2. mainWindow::mainWindow(QWidget *parent)
  3. : QMainWindow(parent)
  4. {
  5. setFixedSize(1000, 900);
  6.  
  7. QLabel *test = new QLabel;
  8. test->setFixedSize(500,900);
  9. test->setStyleSheet("background-color: black;");
  10. setCentralWidget(test);
  11.  
  12. testW = new testWidget;
  13.  
  14. QDockWidget *dock = new QDockWidget("DOCKTEST", this);
  15. dock->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
  16. dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
  17. dock->setWidget(testW);
  18. addDockWidget(Qt::RightDockWidgetArea, dock);
  19. }
To copy to clipboard, switch view to plain text mode 

The result is:
1335632129-Capturedu2012-04-28185448.jpg

And I want that :
1335632129-Capturedu2012-04-28185455.jpg

I don't know how to do that, and if I add 2 widgets in the QDockWidget, how can I only define the height value ? (maybe 2/3 for the first one, and 1/3 for the second one)

So, if someone can help me, it will be very great !

Thanks in advance for your help,