title: Qt 5.11, QWidget and creating a window and connecting to signals
body: <p>I am dynamically creating new windows using:</p>
  
  <pre><code>QWidget* pobjWin = new QWidget();    
  pobjNode-&gt;setWidget(pobjWin);
  pobjWin-&gt;resize(intWidth, intHeight);
  pobjWin-&gt;move(intX, intY);
  </code></pre>
  
  <p>This works and in my application I have 3 windows, I want to connect to the various signals that according to the online documentation are:</p>
  
  <pre><code>activeChanged
  contentOrientationChanged
  focusObjectChanged
  ...
  </code></pre>
  
  <p>In my application as an example I connect to these signals with:</p>
  
  <pre><code>QObject::connect(pobjWin, SIGNAL(activeChanged(void))
                  ,pobjSubNode
                  ,SLOT(windowSlotActiveChanged(void)));
  </code></pre>
  
  <p>The pointer 'pobjSubNode' points to a class which has defined slots for each of the signals I am connecting to.</p>
  
  <p>When I run this and the connects are executed I get:</p>
  
  <pre><code>2018-10-25 16:26:39.550030+0100 XMLMPAM[2048:219099] QObject::connect: No such signal QWidget::activeChanged(void) in ../XMLMPAM/clsMainWnd.cpp:733
  </code></pre>
  
  <p>I think the issue is because the pobjWin points to a QWidget and not a QWindow, but I couldn't find an example that doesn't create a window this way.</p>
  
  <p>[Edit] Using the new connection method:</p>
  
  <pre><code>   QObject::connect(pobjWin, &amp;QWindow::activeChanged
                     ,pobjSubNode, &amp;clsXMLnode::windowSlotActiveChanged);
  </code></pre>
  
  <p>The prototypes for activeChanged and windowSlotActiveChanged are identical.   But when I build with this implementation I get:</p>
  
  <pre><code>/Users/simonplatten/XMLMPAM/clsMainWnd.cpp:733: error: no matching function for call to 'connect'
                  QObject::connect(pobjWin, &amp;QWindow::activeChanged
                  ^~~~~~~~~~~~~~~~
  </code></pre>
  
  <p>[Edit2] I've changed the connect to:</p>
  
  <pre><code>QObject::connect(pobjWin-&gt;windowHandle(), &amp;QWindow::activeChanged
                                  ,pobjSubNode, &amp;clsXMLnode::windowSlotActiveChanged);
  </code></pre>
  
  <p>Now I get:</p>
  
  <pre><code>2018-10-25 17:37:22.299066+0100 XMLMPAM[2930:423194] QObject::connect: invalid null parameter
  </code></pre>
  
  <p>Having just assigned:</p>
  
  <pre><code>QWindow* pobjW2 = pobjWin-&gt;windowHandle();
  </code></pre>
  
  <p>I can see in the debugger that pobjW2 is NULL, which explains the error.</p>
  
  <p>Changing the line:</p>
  
  <pre><code>QWidget* pobjWin = new QWidget(); 
  </code></pre>
  
  <p>To:</p>
  
  <pre><code>QWindow* pobjWin = new QWindow();
  </code></pre>
  
  <p>Has fixed the connection problems, once I fixed all the methods to use the QWindow versions instead of the QWidget versions, but now I don't get any visible windows...investigating.  Its odd that the methods in QWindow have different names to those that do the exact same job in QWidget.</p>
  
  <p>[Edit 3] After fixing the problems with help on correcting the connection and inserting a call to showNormal before creating the connections.  The code is exactly as originally posted with a call to pobjWin->showNormal before any connects.</p>