Hi ,
I am looking how I could use a QShortcut to make my main QWidget appear and disappear. I tried this but it only hide the widget I can't show() it again by the same shortcut:
Qt Code:
  1. void ULmain::upShwHide()
  2. {
  3. if(m_visible)
  4. {
  5. //this->QWidget::hide();
  6. setVisible(true);
  7. m_visible = false;
  8. }
  9. else
  10. {
  11. //this->QWidget::show();
  12. setVisible(true);
  13. m_visible = true;
  14. }
  15. }
To copy to clipboard, switch view to plain text mode 

I declared in my class constructor:
Qt Code:
  1. QShortcut * shwHide = new QShortcut(QKeySequence("Ctrl+Space"), this);
To copy to clipboard, switch view to plain text mode 
and connect:
Qt Code:
  1. QObject::connect(shwHide, SIGNAL(activated()), this, SLOT(upShwHide()));
To copy to clipboard, switch view to plain text mode 

I thought about a systemtray application but it doesn't seems to work.