python - PYQT layout and setgeometry basic overview -


im trying qsplitlines set basic shape upon startup of program. have been playing around 4 numbers in setgerometry(x, x, x, x) simple explanation of correlate too?

from top, ?, left, ?

(down starting top, left, continuing, how many rows spas across)

hbox = qtgui.qhboxlayout(self)  topleft = qtgui.qframe(self) topleft.setframeshape(qtgui.qframe.styledpanel) topleft.setgeometry(0, 0, 300, 0)  topright = qtgui.qframe(self) topright.setframeshape(qtgui.qframe.styledpanel) topright.setgeometry(0, 320, 1000, 0)  bottom = qtgui.qframe(self) bottom.setframeshape(qtgui.qframe.styledpanel) bottom.setgeometry(1210, 0, 1280, 0)  splitter1 = qtgui.qsplitter(qtcore.qt.horizontal) splitter1.addwidget(topleft) splitter1.addwidget(topright)  splitter2 = qtgui.qsplitter(qtcore.qt.vertical) splitter2.addwidget(splitter1) splitter2.addwidget(bottom)  hbox.addwidget(splitter2)  self.setlayout(hbox) #qtgui.qapplication.setstyle(qtgui.qstylefactory.create('cleanlooks')) 

i'm going show how walk through documentation before answer @ bottom. it'll in long run.

start qframe documentation. looking setgeometry method. you'll notice there isn't one, qframe inherit qwidget

going qwidget documentation you'll find there 2 setgeometry methods

qwidget.setgeometry (self, qrect) 

and

qwidget.setgeometry (self, int ax, int ay, int aw, int ah) 

the first 1 takes qrect , second takes series of integers. let's @ qrect docs too:

a qrect can constructed set of left, top, width , height integers

this lines series of integers other method takes. image qt documentation helps explain it:

window geometry

thus, integers are:

  • x coordinate
  • y coordinate
  • width of frame
  • height of frame

Comments