1

I have a widget with 4 QGraphicsViews and I want them to be dockable. I've put a QGraphicsView in a QDockWidget. Then I was able to undock the view, but I don't know how to dock the view back, where it was. At the begin, there is a bar with an undock button, but when the widget is undocked, then this bar is gone.

What do I need to do, to dock the widget on it's original/starting position? Or is this QDockWidget not for things like that? I would be very grateful for some help.

Mat
  • 202,337
  • 40
  • 393
  • 406
Oli
  • 1,221
  • 2
  • 12
  • 18

1 Answers1

4

Just drag the widget back to its starting position, and the main window should grab it automatically. If this doesn't work for you, take a look at the Dock Widgets example program (Qt Creator -> Help -> Contents -> Tutorials and Examples -> Main Window Examples -> Dock Widgets). If even this example program doesn't work, then something is wrong with your Qt installation!

TonyK
  • 16,761
  • 4
  • 37
  • 72
  • Hi, thank you for the answer, but I don't want to drag it back. I want to press a button and then it gets docked back. First button-press undocks the view and the second it docks back. – Oli Aug 11 '11 at 09:03
  • 2
    Thats ok. but what if you want to dock it to the right or bottom? Or any other? setfloating has no more parameters. – Cocomico Oct 29 '14 at 15:26