title: How to align widgets in PyQt5
body: <p>I am trying to use PyQt5 for one of my GUI application. I could be able to add widgets as I want, but couldn't align them properly. I want to align my widgets as below:</p>
  <p><a href="https://i.stack.imgur.com/nIEZ8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nIEZ8.png" alt="enter image description here" /></a></p>
  <p>But, My code is working something like this,</p>
  <p><a href="https://i.stack.imgur.com/J4GVB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/J4GVB.jpg" alt="enter image description here" /></a></p>
  <p>Following is my code, can anyone help me please?</p>
  <pre><code>from PyQt5 import QtCore, QtWidgets
  from PyQt5.QtCore import QRect
  from PyQt5.QtGui import QPixmap
  from PyQt5.QtWidgets import QDesktopWidget, QLabel
  
  
  class GroupBox(QtWidgets.QWidget):
      def __init__(self):
          super().__init__()
          self.setGeometry(QtCore.QRect(20, 20, 900, 700))
          self.setWindowTitle(&quot;InvoiceMee - Split Documents&quot;)
          layout = QtWidgets.QGridLayout(self)
          groupbox = QtWidgets.QGroupBox(&quot;Files to Convert&quot;, checkable=False)
          layout.addWidget(groupbox)
  
          hbox = QtWidgets.QHBoxLayout()
          groupbox.setLayout(hbox)
          label = QLabel()
          pixmap = QPixmap('images.jpg')
          label.setPixmap(pixmap)
          label.resize(pixmap.width(), pixmap.height())
          pathBox = QtWidgets.QLineEdit(self)
          pathBox.setPlaceholderText(&quot;Enter the Path Here&quot;)
          pathBox.setGeometry(QRect(160, 150, 201, 20))
          selectFileBtn = QtWidgets.QPushButton(&quot;Select&quot;)
          convertButton = QtWidgets.QPushButton(&quot;Convert&quot;)
          good_radiobutton = QtWidgets.QRadioButton(&quot;Invoices&quot;)
          naive_radiobutton = QtWidgets.QRadioButton(&quot;Credit Notes&quot;)
          hbox.addWidget(pathBox, alignment=QtCore.Qt.AlignCenter)
          hbox.addWidget(selectFileBtn, alignment=QtCore.Qt.AlignCenter)
          hbox.addWidget(convertButton, alignment=QtCore.Qt.AlignCenter)
          hbox.addWidget(good_radiobutton, alignment=QtCore.Qt.AlignCenter)
          hbox.addWidget(naive_radiobutton, alignment=QtCore.Qt.AlignCenter)
          hbox.addWidget(label,alignment=QtCore.Qt.AlignCenter)
          hbox.addStretch()
          self.center()
  
  
      def center(self):
          # geometry of the main window
          qr = self.frameGeometry()
          # center point of screen
          cp = QDesktopWidget().availableGeometry().center()
          # move rectangle's center point to screen's center point
          qr.moveCenter(cp)
          # top left of rectangle becomes top left of window centering it
          self.move(qr.topLeft())
  </code></pre>