title: QHBoxLayout (size, resize, move)
body: <h2>Task:</h2>
  <p>For example (the code below) we create QHBoxLayout in which there are two buttons.</p>
  <pre><code>import sys
  from PyQt5.QtWidgets import (QWidget, QPushButton, QHBoxLayout, QApplication)
  class Example(QWidget):
      
          def __init__(self):
              super().__init__()
      
              hbox = QHBoxLayout()
              okButton = QPushButton(&quot;OK&quot;)
              cancelButton = QPushButton(&quot;Cancel&quot;)
              hbox.addWidget(okButton)
              hbox.addWidget(cancelButton)
              self.setLayout(hbox)
      
              self.setGeometry(100, 100, 500, 500)
              self.show()
      
  app = QApplication(sys.argv)
  ex = Example()
  sys.exit(app.exec_())
  </code></pre>
  <h2>Necessary:</h2>
  <p>Set the size for <strong>hbox</strong> (QHBoxLayout)  (W_pix, H_pix) and its coordinates (X_pos, Y_pos) on the main window (they do not fit, I did not find such functions in the documentation for the description for QHBoxLayout, QWidget).</p>
  <p>v.2</p>
  <pre><code>import sys
  
  from PyQt5 import QtCore, QtWidgets
  from PyQt5.QtCore import QRect
  from PyQt5.QtWidgets import (QWidget, QPushButton,
                               QHBoxLayout, QApplication, QMainWindow, QVBoxLayout)
  
  class Example(QMainWindow):
  
      def __init__(self):
          super().__init__()
          self.hbox = QVBoxLayout()
          self.okButton = QPushButton(&quot;OK&quot;)
          self.cancelButton = QPushButton(&quot;Cancel&quot;)
          self.hbox.addWidget(self.okButton)
          self.hbox.addWidget(self.cancelButton)
  
          self.setGeometry(100, 100, 500, 500)
          self.setLayout(self.hbox)
          self.hbox.setGeometry(QtCore.QRect(200, 200, 300, 300))
          self.show()
  
  app = QApplication(sys.argv)
  ex = Example()
  sys.exit(app.exec_())
  </code></pre>