kevin880701
kevin880701

Reputation: 105

Center and top align a QVBoxLayout

I want let the two code work simultaneously,but I don't know how to do that.

self.botV.setAlignment(Qt.Aligntop)
self.botV.setAlignment(Qt.AlignCenter)

It just do the last one.

Upvotes: 3

Views: 5990

Answers (1)

eyllanesc
eyllanesc

Reputation: 243897

I suppose you want a central horizontal alignment and the vertical alignment in the top, then you must use the operator |, also be careful with the case of the variables, Qt uses camelcase:

self.botV.setAlignment(Qt.AlignHCenter | Qt.AlignTop)

Upvotes: 5

Related Questions