<p>How do I set the initial width of a QDockWidget?</p>

<p>I have implemented the sizeHint function but what next?</p>

If you want it to have the same width as the same last time the program was running, you should look into settings. The Qt 4.4 documentation has an example on how to use settings
here
.
This is how I have done it:
```
```
void Applicotion::readSettings() {
  QSettings settings("Company Name", "Application Name");
  settings.beginGroup("LibraryDock");
  libraryDock->setFloating(settings.value("docked").toBool());
  libraryDock->resize(settings.value("size", QSize(1, 1)).toSize());
  libraryDock->move(settings.value("pos", QPoint(200, 200)).toPoint());
  addDockWidget((Qt::DockWidgetArea)settings.value("dockarea", Qt::RightDockWidgetArea).toInt(), libraryDock);
  settings.endGroup();
}

void Applicotion::writeSettings() {
  QSettings settings("Company Name", "Application Name");
  settings.beginGroup("LibraryDock");
  settings.setValue("dockarea", dockWidgetArea(libraryDock));
  settings.setValue("docked", libraryDock->isFloating());
  settings.setValue("size", libraryDock->size());
  settings.setValue("pos", libraryDock->pos());
  settings.endGroup();
```
```
}