[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: PyQt6: setting enum values to properties using keyword args in init.
From: Phil Thompson <phil () riverbankcomputing ! com>
Date: 2021-01-16 16:49:21
Message-ID: 791136c4906495780edf0fa95dbb7526 () riverbankcomputing ! com
[Download RAW message or body]
On 15/01/2021 17:23, alan moore wrote:
> Hello all,
>
> I'm starting the process of porting some PyQt5 code to PyQt6, and step
> one is dealing with the namespacing of enums.
>
>
> In PyQt5 I could specify certain property values as keyword arguments,
> e.g.:
>
>
> tab_widget = QtWidgets.QTabWidget(
>
> tabPosition=QtWidgets.QTabWidget.West,
>
> tabShape=QtWidgets.QTabWIdget.Triangular
>
> )
>
>
> So converting to PyQt6, I figured I just need to fix the path of the
> enum values:
>
>
> tab_widget = QtWidgets.QTabWidget(
>
> tabPosition=QtWidgets.QTabWidget.TabPosition.West,
>
> tabShape=QtWidgets.QTabWIdget.TabShape.Triangular
>
> )
>
>
> However, this gives an error:
>
>
> TypeError: unable to convert a Python 'TabPosition' object to a
> C++ 'TabPosition' instance
>
> (and likewise with TabShape if I remove the tabPosition argument).
>
>
> I *can* set these after the widget is created using the setter:
>
>
> tab_widget.setTabPosition(QtWidgets.QTabWidget.TabPosition.West)
>
>
> SO I guess this is my long-winded way of asking if this is a bug, if
> I'm just doing it wrong, or if keyword property arguments are no
> longer supported. Thanks!
A bug - should be fixed the next snapshot.
Thanks,
Phil
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic