title: Simple ribbon: how to use QActions within QTabBar?
body: <p>I'm trying to implement simple tabbed interface with Qt5. I use <code>QTabWidget</code> with <code>QToolBar</code>s placed inside its tabs and I add <code>QAction</code>s to the <code>QToolBar</code>s.</p>
  
  <p>That works but causes the following issue: any action remains accessible only while its parent tab is active. If I try to use keyboard shortcut for currently "invisible" action, I will have no success. Since there's no menu etc, the tabs are the only place, where the actions are placed.</p>
  
  <p>Here's how I add the elements to the toolbar:</p>
  
  <pre><code>QTabWidget *ribbon               = new QTabWidget(window);
  QToolBar *tool_bar_game          = new QToolBar(tab_game);
  QAction *action_go_to_next_level = new QAction(window);
  
  action_go_to_next_level-&gt;setText(QApplication::translate("Window", "&amp;Next", 0));
  action_go_to_next_level-&gt;setIcon(QIcon::fromTheme("go-last"));
  action_go_to_next_level-&gt;setShortcut(QApplication::translate("Window", "PgDown", 0));
  
  
  ribbon-&gt;addTab(tool_bar_game, tr("Game"));
  tool_bar_game-&gt;addAction(action_go_to_next_level);
  </code></pre>
  
  <p>and a screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/zbRQz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zbRQz.png" alt="Ribbon-like 2-tabs interface"></a></p>
  
  <p>How can I make the action accessible with shortcuts, even when the action's parent tab is not currently opened?</p>