title: How to stick widgets side by side
body: <p>The code below creates a dialog window with three widgets: QLabel, QComboBox and QButton.</p>
  
  <p>I want QLabel and QComboBox to be sitting on a same line. That is why both of these widgets are assigned to the same horizontal layout.
  Resizing the dialog creates a huge empty space between the Label and ComboBox. How to assure that the left side of the Combo sticks to the right side of Label when dialog is resizing? </p>
  
  <p><a href="https://i.stack.imgur.com/cRiDr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cRiDr.png" alt="enter image description here"></a></p>
  
  <pre><code>from PyQt5.QtGui import *
  from PyQt5.QtWidgets import *
  from PyQt5.QtCore import *
  app = QApplication([])
  
  
  class Dialog(QDialog):
      def __init__(self, parent=None):
          super(Dialog, self).__init__(parent)
          self.setLayout(QVBoxLayout())
          h_layout = QHBoxLayout()
          self.layout().addLayout(h_layout)
          label = QLabel(self)
          label.setText('Month:')
          combo = QComboBox(self)
          h_layout.addWidget(label)
          h_layout.addWidget(combo)
          button = QPushButton('Ok')
          self.layout().addWidget(button)
          self.resize(200, 50)
          self.show()
  
  
  dialog = Dialog()
  app.exec_()
  </code></pre>