
Originally Posted by
danielperaza
Do I have to add this pointer to the menu manually?
Yes, you have to manually add it to the menu. Or semimanually - you can query for all dock widgets, their toggle actions and add them to some menu, for instance like so:
//...
QList<QDockWidget
*> docs
= qFindChildren<QDockWidget
*>
(this,
QString::null);
QAction *act
= dck
->toggleViewAction
();
someMenu->addAction(act);
}
}
XX::XX(...) : QMainWindow(...){
//...
QList<QDockWidget*> docs = qFindChildren<QDockWidget*>(this, QString::null);
foreach(QDockWidget *dck, docs){
QAction *act = dck->toggleViewAction();
someMenu->addAction(act);
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks