0

I am trying to align an item both horizontally on the right and vertically in the center. There are 2 single functions that work:

setAlignment(Qt.AlignRight) 

and

setAlignment(Qt.AlignVCenter)

But when the 2 functions are combined (one after the other), the result is that only the last one is applied (and the first one is forgotten).

How to get the alignment I want (horizontal right and vertical center)?

kAmJi
  • 77
  • 12

1 Answers1

1

setAlignment accepts alignment flag or flags combination, you can build flag combination with bitwise or operator

setAlignment(Qt.AlignVCenter | Qt.AlignRight)
mugiseyebrows
  • 4,138
  • 1
  • 14
  • 15