title: Layout with frames
body: <p>Currently working on a graphical user interface. I am trying to make the layout out of 3 QFrames.</p>
  <p>As seen in the screenshot below, the <strong>yellow</strong> frame is on the right side. I would like that frame to be on top of the <strong>right frame</strong>. (On top of the numpad, taking the whole horizontal space)</p>
  <p>Also, for the numpad buttons on the right frame. I would like them to be as close to each other as they can be, like a numpad on a keyboard. How would I adjust the grid to do that?</p>
  <p><a href="https://i.stack.imgur.com/UwF2h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UwF2h.png" alt="enter image description here" /></a></p>
  <p><strong>EDITED</strong></p>
  <p>This is how I want the outcome to be. Where the red frame is the rightTopFrame (Yellow frame in first picture).</p>
  <p><a href="https://i.stack.imgur.com/M27S4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M27S4.png" alt="enter image description here" /></a></p>
  <p><strong>Code:</strong></p>
  <pre><code>def layoutUI(self):
          
          ### Right Top Frame
          self.rightTopFrame = QFrame()
          self.rightTopFrame.resize(1,1)
          self.rightTopFrame.setStyleSheet(&quot;background-color: yellow&quot;)
          
          
          ### Left Grid
          self.leftGrid = QGridLayout()
          self.leftGrid.setColumnMinimumWidth(10, 10)
          self.leftGrid.setRowMinimumHeight(1, 1) 
          
          # Run, Stop, Speed layout   
          self.leftGrid.addWidget(self.b1, 0, 0)
          self.leftGrid.addWidget(self.b2, 0, 2)
          
          self.leftGrid.addWidget(self.b3, 1, 0)
          self.leftGrid.addWidget(self.l1, 1, 1)
          self.leftGrid.addWidget(self.b4, 1, 2)  
          
          # pl (Pieces and Length) layout     
          self.leftGrid.addWidget(self.b5, 2, 0)
          self.leftGrid.addWidget(self.l2, 2, 1)
          self.leftGrid.addWidget(self.b6, 2, 2)
          
          self.leftGrid.addWidget(self.b7, 3, 0)
          self.leftGrid.addWidget(self.l3, 3, 1)
          self.leftGrid.addWidget(self.b8, 3, 2)
          
          # Manual
          self.leftGrid.addWidget(self.l4, 4, 1)
          
          self.leftGrid.addWidget(self.b9, 5, 0)
          self.leftGrid.addWidget(self.b10, 5, 1)
          self.leftGrid.addWidget(self.b11, 5, 2)
  
  
  
          
          ### Right Grid
          self.rightGrid = QGridLayout()
          self.rightGrid.setColumnMinimumWidth(0, 0)
          self.rightGrid.setRowMinimumHeight(1, 1)    
          
          
          
          self.rightGrid.addWidget(self.np1, 2, 0)
          self.rightGrid.addWidget(self.np2, 2, 1)
          self.rightGrid.addWidget(self.np3, 2, 2)
          self.rightGrid.addWidget(self.np4, 3, 0)
          self.rightGrid.addWidget(self.np5, 3, 1)
          self.rightGrid.addWidget(self.np6, 3, 2)
          self.rightGrid.addWidget(self.np7, 4, 0)
          self.rightGrid.addWidget(self.np8, 4, 1)
          self.rightGrid.addWidget(self.np9, 4, 2)
          self.rightGrid.addWidget(self.np0, 5, 1)
          self.rightGrid.addWidget(self.npCl, 5, 0)
          
          #self.rightGrid.addWidget(self.bExit, 0, 2)
          
          
          
                  
          ### Left Frame
          self.leftFrame = QFrame()
          self.leftFrame.resize(150,550)
          #self.leftFrame.setStyleSheet(&quot;background-color: red&quot;)
          self.leftFrame.setLayout(self.leftGrid)
          
          ### Right Frame
          self.rightFrame = QFrame()
          self.rightFrame.resize(15,50)
          #self.rightFrame.setStyleSheet(&quot;background-color: green&quot;)
          self.rightFrame.setLayout(self.rightGrid)
          
          
          
          
          
          ### Main Grid
          self.mainGrid = QGridLayout()
          self.mainGrid.setColumnMinimumWidth(10, 0)
          self.mainGrid.addWidget(self.leftFrame)
          self.mainGrid.addWidget(self.rightFrame)
          self.mainGrid.addWidget(self.rightTopFrame)
          
          
          ### Main Interface
          self.setGeometry(300, 200, 850, 450)
          self.setLayout(self.mainGrid)
          self.setStyleSheet(&quot;background-color: %s&quot; % backgroundColor)    
          self.setWindowTitle('Signal &amp; slot')
          self.show()
  </code></pre>