Qt-Advanced-Docking-System icon indicating copy to clipboard operation
Qt-Advanced-Docking-System copied to clipboard

Example `main.py` run: `AttributeError: module 'PyQtAds' has no attribute 'CDockManager'`

Open andry81 opened this issue 8 months ago • 7 comments

System:

  • Python 3.12.2 (PyQt5, PyQtAds)
  • Windows 8.1

$ py main.py

Traceback (most recent call last):
  File "...\QtADS\examples\centralwidget\main.py", line 104, in <module>
    w = MainWindow()
        ^^^^^^^^^^^^
  File "...\QtADS\examples\centralwidget\main.py", line 23, in __init__
    QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.OpaqueSplitterResize, True)
    ^^^^^^^^^^^^^^^^^^
AttributeError: module 'PyQtAds' has no attribute 'CDockManager'

I've checked the site-packages and didn't found any py modules. But instead have found sip modules.

Do I need to somehow compile sip modules? There is no instructions about it in the readme.

andry81 avatar Apr 16 '25 19:04 andry81

@andry81 The PyQtAds package is a third party contribution and I cannot help you in this case. Maybe you can contact the authors of the contribution to get some help?

githubuser0xFFFF avatar May 04 '25 06:05 githubuser0xFFFF

@andry81 The PyQtAds package is a third party contribution and I cannot help you in this case. Maybe you can contact the authors of the contribution to get some help?

You have main.py in the examples. The PyQtAds is installed. I have tried to just run the python entry point. And it does not work from the box. Then why to hold it anyway? May be add details with what version of PyQt a user have to run?

My modules list, just in case:

packaging                   24.2
pip                         25.0.1
prompt_toolkit              3.0.47

PyQt5                       5.15.11
PyQt5-Qt5                   5.15.2
PyQt5_sip                   12.17.0
PyQtAds                     3.8.1

setuptools                  78.1.0
sip                         6.10.0

wheel                       0.42.0

andry81 avatar May 04 '25 11:05 andry81

What do you mean with: "Then why to hold it anyway?"

githubuser0xFFFF avatar May 05 '25 11:05 githubuser0xFFFF

What do you mean with: "Then why to hold it anyway?"

It just couldn't run from the box.

andry81 avatar May 05 '25 12:05 andry81

Yes, but if you fix it then maybe it will run and other users are happy if you contribute your fix.

githubuser0xFFFF avatar May 05 '25 17:05 githubuser0xFFFF

Yes, but if you fix it then maybe it will run and other users are happy if you contribute your fix.

And how it works before?

andry81 avatar May 05 '25 21:05 andry81

You just need to change the import import PyQtAds as QtAds -> from PyQtAds import ads as QtAds.

Python 3.13.3 (main, Apr 21 2025, 15:30:38) [Clang 20.1.3 ] 64 bit (AMD64) with MSC v.1939 CRT] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5.QtCore
>>> import PyQtAds
>>> dir(PyQtAds)
['__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'ads']
>>> from PyQtAds import ads
>>> dir(ads)
['AllDockAreas', 'BitwiseAnd', 'BitwiseOr', 'BottomDockWidgetArea', 'CDockAreaTabBar', 'CDockAreaTitleBar', 'CDockAreaWidget', 'CDockComponentsFactory', 'CDockContainerWidget', 'CDockFocusController', 'CDockManager', 'CDockOverlay', 'CDockOverlayCross', 'CDockSplitter', 'CDockWidget', 'CDockWidgetTab', 'CDockingStateReader', 'CElidingLabel', 'CFloatingDockContainer', 'CFloatingDragPreview', 'CIconProvider', 'CSpacerWidget', 'CTitleBarButton', 'CenterDockWidgetArea', 'DockAreaCloseIcon', 'DockAreaMenuIcon', 'DockAreaUndockIcon',
'DockWidgetArea', 'DockWidgetAreas', 'DraggingFloatingWidget', 'DraggingInactive', 'DraggingMousePressed', 'DraggingTab', 'IFloatingWidget', 'IconCount', 'InvalidDockWidgetArea', 'LeftDockWidgetArea', 'NoDockWidgetArea', 'OuterDockAreas', 'RightDockWidgetArea', 'TabCloseIcon', 'TitleBarButton', 'TitleBarButtonClose', 'TitleBarButtonTabsMenu', 'TitleBarButtonUndock', 'TopDockWidgetArea', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'eBitwiseOperator', 'eDragState', 'eIcon', 'internal']
>>> ads.CDockManager
<class 'PyQtAds.ads.CDockManager'>

char101 avatar Jun 01 '25 08:06 char101