title: QShortcut - how to correcly declare in widget?
body: <p>i am trying to use QShortcut, and declare in in widget constructor like:</p>
  <pre><code>   QShortcut  *keyCtrlL;
      keyCtrlL = new QShortcut(this);
      keyCtrlL-&gt;setKey(Qt::CTRL + Qt::Key_L);
      connect(keyCtrlL, &amp;QShortcut::activated, this, &amp;MyPage::loadB);
  </code></pre>
  <p>I am not sure it will work, even it compile fine, as variable is local in the constructor.
  So i am trying to declare it as a private variable for the whole class MyPage,</p>
  <p>and getting compilation errors:</p>
  <pre><code>error: cannot initialize a parameter of type 'QWidget *' with an rvalue of type 'MyPage *'
      ui-&gt;setupUi(this);
                  ^~~~
  ./qt/forms/ui_mypage.h:69:27: note: passing argument to parameter 'MyPage' here
      void setupUi(QWidget *MyPage)
                            ^
  qt/mypage.cpp:153:20: error: no matching constructor for initialization of 'QShortcut'
      keyCtrlL = new QShortcut(this);
  </code></pre>
  <p>Even MyPage is inherited from QWidget.
  Why this error happens, how can i fix it?</p>