alright after more tinkering i've revised the slot's code, which seems to work better:
void floating_changed(bool floating){
bool vis = this->isVisible();
if(floating){
this->setWindowFlags(Qt::Window);
if(pos.x() < 0)
pos.setX(0);
if(pos.y() < 0)
pos.setY(0);
this->move(pos);
if(vis)
this->show();
}
}
void floating_changed(bool floating){
bool vis = this->isVisible();
if(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);
if(vis)
this->show();
}
}
To copy to clipboard, switch view to plain text mode
now the issue persists on linux only under a particular circumstance. first let me show the code that initializes the docks, in case there's something wrong there. all docks are setup like this:
PreferencesDock *pref_dock = new PreferencesDock(this); //this dock inherits the baseDock outlined in the first post.
pref_dock->setHidden(true);
pref_dock->setFloating(false);
addDockWidget(Qt::RightDockWidgetArea, pref_dock);
ui->menu_docks->addAction(pref_dock->toggleViewAction());
PreferencesDock *pref_dock = new PreferencesDock(this); //this dock inherits the baseDock outlined in the first post.
pref_dock->setHidden(true);
pref_dock->setFloating(false);
addDockWidget(Qt::RightDockWidgetArea, pref_dock);
ui->menu_docks->addAction(pref_dock->toggleViewAction());
To copy to clipboard, switch view to plain text mode
so, when running in windows all is fine. under linux (ubuntu) if a dock is added to a dock area on the sides of the application, and then you click the little 'undock' button to pop it out, that's when the issue occurs. it pops out the dock (floating mode) but, it doesn't draw it. it's just a rectangle on the screen where it should be.
the above 'floating_changed' is being called when it's popped out to floating mode, and if i put a break point in that code, then the dock is properly drawn as expected!?
Bookmarks