title: How do I add a menubar to a QWidget?
body: <p>I have a Qwidget thats usually is displayed in a Qmainwindow.
  Sometimes its unnecessary to use the whole mainwindow, because you only want to use functions from a certain Qwidget. If that's the case, I want a menubar in my widget.</p>
  
  <p>I tried:</p>
  
  <pre><code>if parent  == "self":
      self.layout().addMenubar(self)
  </code></pre>
  
  <p>But using the code above the its just stops compiling without raising any error.
  What Im doing wrong? Thanks!</p>