title: Qt "The inferior stopped because it received a signal from the operating system"
body: <p>I can see this error displayed by my application, I'm running in the debugger and the application halts on the same line when this error is displayed.</p>
  
  <p>If there any further information I can find to give a clue as to why this is being displayed?</p>
  
  <p>The code looks fine, all the pointers and variables look correct, but something is causing a problem, the code:</p>
  
  <pre><code>    pobjPainter-&gt;setBackgroundMode(Qt::OpaqueMode);
  </code></pre>
  
  <p>pobjPainter is a pointer to an instance of <code>QPainter</code>, it has been set-up and is active.</p>
  
  <p>I have been converting the application from <code>QWidget</code> to <code>QOpenGLWidget</code> and this is a work in progress, so I expect there to be a few issues, but is there any further information or help other than this rather cryptic and not very helpful message?</p>
  
  <p><a href="https://i.stack.imgur.com/4lgOJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4lgOJ.png" alt="enter image description here"></a></p>
  
  <p>QPainter is created as follows, this is called in the paintGL method and the object is derived from public QOpenGLWidget, protected QOpenGLFunctions:</p>
  
  <pre><code>    //Get painter object
      QPainter objVisible;
      //Set-up the painter
      objVisible.begin(this);
  </code></pre>
  
  <p>It is then passed down to the render routine for each object type:</p>
  
  <pre><code>    renderText(&amp;objVisible, &amp;rctGeom, &amp;rctInterior);
  </code></pre>
  
  <p>Finally I call:</p>
  
  <pre><code>    objVisible.end();
  </code></pre>
  
  <p>Before exiting.</p>
  
  <p>This screenshot shows the stack trace in more detail, it looks like the crash occurs in one of the openGL routines:</p>
  
  <p><a href="https://i.stack.imgur.com/pKzSI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pKzSI.png" alt="enter image description here"></a></p>