i've got a little class which allows dockwidgets to be minimzed or closed once they're floating. on windows, this works without issue, however on linux (ubuntu) when the qdockwidgets are 'undocked' and floating, they don't draw, they're black rectangles. the really weird part, is if i step through with the debugger in the 'floating_changed' below, they show up properly?

is there a better way to accomplish this?

Qt Code:
  1. class BaseDock : public QDockWidget {
  2. Q_OBJECT
  3. public:
  4. BaseDock(QWidget *parent = 0, Qt::WindowFlags flags = 0)
  5. :QDockWidget(parent,flags)
  6. {
  7. connect(this,SIGNAL(topLevelChanged(bool)),this,SLOT(floating_changed(bool)));
  8. }
  9.  
  10. private slots:
  11. void floating_changed(bool floating){
  12. if(this->isVisible() && floating){
  13. this->setWindowFlags(Qt::Window);
  14. QPoint pos = this->pos();
  15. if(pos.x() < 0)
  16. pos.setX(0);
  17. if(pos.y() < 0)
  18. pos.setY(0);
  19. this->move(pos);
  20. this->show();
  21. }
  22. }
  23.  
  24. };
To copy to clipboard, switch view to plain text mode