Re: DeprecationWarning using TextAlignmentRole in a QStandardItem subclass

Sibylle Koczian <[email protected]>
Newsgroups gmane.comp.python.pyqt-pykde
Message-ID <[email protected]>
Am 19.01.2020 um 12:42 schrieb Phil Thompson:
> On 18/01/2020 12:15, Sibylle Koczian wrote:
>> If I execute the following script I get this warning:
>>
>> Warning (from warnings module):
>>   File "D:\Sibylle\Src\PythonVersuche\PyQt\test_warning.py", line 77
>>     app.exec_()
>> DeprecationWarning: an integer is required (got type Alignment).
>> Implicit conversion to integers using __int__ is deprecated, and may be
>> removed in a future version of Python.
>
> It should be fixed in tonight's PyQt snapshot.
>
> In the meantime if you want to avoid the warning then do as it suggests
> and make the conversion explicit, ie. change the 'return' statement to...
>
>      return int(h_align | QtCore.Qt.AlignVCenter)
>

Thank you. Because the warning just contained the "app.exec_()" I didn't
understand that this was suggested.

Sibylle

_______________________________________________
PyQt mailing list    [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.