How to find enum's in PyQt6?

Barry barry at barrys-emacs.org
Mon Jul 11 08:39:35 BST 2022



> On 10 Jul 2022, at 13:11, Florian Bruhin <me at the-compiler.org> wrote:
> 
> On Sun, Jul 10, 2022 at 12:13:28PM +0100, Barry Scott wrote:
>> But I'm still none the wiser how to fix this:
>> 
>>    def _addMenu( self, menu, name, handler, enabler=None, icon_name=None,
>> checker=None, group=None, role=QtWidgets
>> .QAction.MenuRole.NoRole ):
>> AttributeError: module 'PyQt6.QtWidgets' has no attribute 'QAction'
>> 
>> I am using the KDE build of Qt6/PyQt6 for Fedora copr that is version 6.2.3.
>> 
>> Is this a problem with this being an older version?
> 
> That's not really an enum-specific issue - just that QAction got moved
> from QtWidgets to QtGui in Qt 6:
> 
> https://doc.qt.io/qt-6/widgets-changes-qt6.html#qaction-qactiongroup
> 
> Also see:
> 
> https://doc.qt.io/qt-6/qaction.html ("qmake: QT += gui") vs.
> https://doc.qt.io/qt-5/qaction.html ("qmake: QT += widgets")
> 
> Here is the full list of changes per module:
> https://doc.qt.io/qt-6/modulechanges.html
> 
> I'd recommend giving that a skim for all the modules you use in your
> appliaction.

Thanks Detlev for the specific info and to you Florian for the resources.

I am making good progress.

Barry

> 
> Florian
> 
> -- 
>            me at the-compiler.org | https://www.qutebrowser.org 
>       https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
>       GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
>             I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/octet-stream
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20220711/ce639cbb/attachment.obj>


More information about the PyQt mailing list