[PyQt] I seem to need help with some basic stuff.. =P

Jared Henley jared.henley at gmail.com
Tue May 26 22:15:43 BST 2015


On Tue, 26 May 2015 16:18:02 -0400
inhahe <inhahe at gmail.com> wrote:

> I create a QTabWidget, and add to it QVBoxLayout (if i don't do this
> it seems that none of the things I add to the tab widget show up),
> and then I add a QWidget to the QTabWidget, and to the QWidget I add
> a QHBoxLayout, and to the QHBoxLayout I add a QTextEdit.  I  want to
> make the QTextEdit span the whole main window from left to right, and
> then below it I want another QTextEdit that also spans all the way
> horizontally but takes a lot less room (a fixed amount) vertically.
> 
> I've tried looking at the documentation for both size policies and
> layouts, and I can't really make heads or tails of it. I have no idea
> how to do these things with those things. So instead I was going to
> setGeometry directly (and also do this on resize events), so I was
> going to get the geometry of the tab's QHBoxLayout and start off by
> subtract some from the bottom to to set the bottom of my first
> QTextEdit, but when I call QHBoxLayout.geometry().bottomRight(), I
> get (-1, -1). That doesn't seem to help. What am I doing wrong / how
> do I do this?
> 
> Also, the QHBoxLayout puts a thin empty area all around the QTextEdit
> I add between its edge and the edge of the main window. How do I get
> rid of that empty area?
> 
> Thanks..

Could I suggest playing around with Qt Designer?  You'll find it much
faster to test things out.


More information about the PyQt mailing list