connect(act, SIGNAL(toggled(bool)), toolbaraction, SLOT(setChecked(bool)));
connect(toolbaraction, SIGNAL(toggled(bool)), act, SLOT(setChecked(bool)));
QAction toolbaraction = new QAction(...);
QAction act = QDockWidget::toggleViewAction();
QMenu::addAction(act);
connect(act, SIGNAL(toggled(bool)), toolbaraction, SLOT(setChecked(bool)));
connect(toolbaraction, SIGNAL(toggled(bool)), act, SLOT(setChecked(bool)));
To copy to clipboard, switch view to plain text mode
if you want to have different icons etc in menu and toolbar. If not just use the same action as munna has mentioned
Bookmarks