main の子QMainWindow
としてa を使用します。これにより、ドッキング可能なウィジェットに使用できる別の領域が得られます ( )。QMainWindow
QDockWidget
次の投稿によると、これは問題ありません。私にとっても完全に機能します。
- https://qt-project.org/forums/viewthread/17519
- http://www.qtcentre.org/threads/12569-QMainWindow-as-a-child-of-QMainWindow
通常のウィジェットとして動作させるためにQMainWindow
、ウィンドウ フラグの設定を解除します。このトリックは、上記の投稿の 1 つに記載されています。
QMainWindow
ここで、ドッキングされたすべてのウィジェットでこの子をフロートできるようにしたいと考えています。つまり、「通常のウィジェットにする」というステップを元に戻したいのです。残念ながら、これは機能しません。メイン ウィンドウからは消えていますが、まったく表示されません。
それを解決する方法はありますか?
// this is the child QMainWindow
if (this->m_infoAreaFloating)
{
// this should give me a floating window besides the main window
this->setWindowFlags(Qt::Desktop);
this->show();
}
else
{
// make this compliant as QWidget
this->setWindowFlags(this->windowFlags() & ~Qt::Window);
}