title: QT: Context menu on Trigger
body: <p>I have a QMenu that in a QSystemTrayIcon. Both are members of a QMainWindow object.</p>
  
  <p>I wan the QMenu of the QSystemTrayIcon to act exactly alike when right clicking (ie, reason QSystemTrayIcon::Context) and when single left clicking (ie, reason QSystemTrayIcon::Trigger).</p>
  
  <p>The right clicking behavior by default acts like I want it to. However I can't figure out how to make the left click act exactly like right click. My efforts so far lead me to:</p>
  
  <pre><code> void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason)
   {
       if(reason==QSystemTrayIcon::Trigger)  trayIcon-&gt;contextMenu()-&gt;popup(QCursor::pos());
   }
  </code></pre>
  
  <p>However, the menu doesn't disappear when it loses focus whereas bringing up the contextmenu with right click does make it disappear when focus is lost.</p>
  
  <p>Is there away to make Trigger act like Context? Maybe a way to throw a mock signal or something?</p>