سؤال

When adding a QLCDNumber to a form it seems to always center in its container box. Is there a way to align the numbers to the right or left?

enter image description here

هل كانت مفيدة؟

المحلول

try putting a spacer before it see this link

spacer = QWidget()
spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
# hbox is an existing QHboxLayout
# lcdnumber is an existing QLCDNumber
hbox.addWidget(spacer)
hbox.addWidget(lcdnumber)
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top