|
|
On 19.11.05 10:14:31, Stefan Sander wrote:
> Am Samstag, 19. November 2005 02:28 schrieb Andreas Pakulat:
> > On 18.11.05 16:43:49, Michael Sullivan wrote:
> > > On my GUI I have four distinct widget groups made up of QLineEdits,
> > > QComboBoxes and QLabels organized like this:
> > >
> > > QLineEdit QLineEdit
> > > QCombo QCombo
> > > QLabel QLabel
> > >
> > > QLineEdit QLineEdit
> > > QCombo QCombo
> > > QLabel QLabel
> > >
> > > First of all, I can't get my QLineEdits to shorten themselves. I've
> > > tried setMaxSize and setGeometry, but I can't see any change. It could
> > > be because I've got each individual widget set (there are four) layed
> > > out in QVBoxLayouts. I've got the top and bottom rows layed out in two
> > > QHBoxLayouts, and then my two QHBoxLayouts are in a master QVBoxLayout.
> > > It looks good except for the fact that my QLineEdits are too long and I
> > > want the who shebang centered on the parent widget, which is sized
> > > maximized. How can I accomplish this?
> >
> > Centering something is normally achieved using 4 spacers on each side of
> > whatever should be centered. So you should probably have
> >
> > spacer
> > spacer shebang spacer
> > spacer
> >
> > Which means to either have a vbox with a spacer, shebang, spacer in that
> > order and then a hbox with spacer, vbox, spacer. Or you first do the
> > horizontal and then the vertical.
>
> you may try to set the alignment of the layout or item, so you would not need
> spacers.
I don't see a possibility to change the alignment of layouts or
qwidgets. From the widgets the OP uses only QLabel and QLineEdit have an
alignment property.
Andreas
--
Life is to you a dashing and bold adventure.
|
|