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?
Q_OBJECT
public:
BaseDock
(QWidget *parent
= 0, Qt
::WindowFlags flags
= 0) {
connect(this,SIGNAL(topLevelChanged(bool)),this,SLOT(floating_changed(bool)));
}
private slots:
void floating_changed(bool floating){
if(this->isVisible() && floating){
this->setWindowFlags(Qt::Window);
if(pos.x() < 0)
pos.setX(0);
if(pos.y() < 0)
pos.setY(0);
this->move(pos);
this->show();
}
}
};
class BaseDock : public QDockWidget {
Q_OBJECT
public:
BaseDock(QWidget *parent = 0, Qt::WindowFlags flags = 0)
:QDockWidget(parent,flags)
{
connect(this,SIGNAL(topLevelChanged(bool)),this,SLOT(floating_changed(bool)));
}
private slots:
void floating_changed(bool floating){
if(this->isVisible() && floating){
this->setWindowFlags(Qt::Window);
QPoint pos = this->pos();
if(pos.x() < 0)
pos.setX(0);
if(pos.y() < 0)
pos.setY(0);
this->move(pos);
this->show();
}
}
};
To copy to clipboard, switch view to plain text mode
Bookmarks