Understanding the doc format
Moved
Solved
Qt for Python
-
I am now trying to code my interface directly. This has progressed well so far, with sufficient tabs, a group box, labels, etc.
I want to align the labels right.I went to the doc.qt.io and was told that:
Qt::AlignRight
I have already imported
Qt
fromPyQt6.QtCore
.I tried this:
newgridcell = QLabel("Point of new grid cell:") newgridcell.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
I get
AttributeError: type object 'Qt' has no attribute 'AlignRight'
If I remove Qt then, obvious,
AlignRight is not defined
If I just follow the document withQt::AlignRight
I, obviously, getSyntaxError: invalid syntax
So, I am trying to...
- resolve the immediate issue of aligning right
- more importantly, trying to understand the structure of the documentation - for future usage
Please help. :)
-