biolab / orange3-associate

🍊 :package: Frequent itemsets and association rules mining for Orange 3.
Other
65 stars 37 forks source link

Use QApplication.instance() instead of qApp (Qt6 compatibility) #57

Closed markotoplak closed 1 year ago

markotoplak commented 1 year ago
Issue
2023-09-29 01:29:44,099:INFO:orangecanvas.registry.discovery: Could not import 'orangecontrib.associate.widgets.owassociate'.
Traceback (most recent call last):
  File "/home/frankc/orange/lib/python3.11/site-packages/orangecanvas/registry/discovery.py", line 309, in iter_widget_descriptions
    module = asmodule(name)
             ^^^^^^^^^^^^^^
  File "/home/frankc/orange/lib/python3.11/site-packages/orangecanvas/registry/discovery.py", line 552, in asmodule
    return __import__(module, fromlist=[""])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/frankc/orange/lib/python3.11/site-packages/orangecontrib/associate/widgets/owassociate.py", line 9, in <module>
    from AnyQt.QtWidgets import QTableView, qApp, QGridLayout, QLabel
ImportError: cannot import name 'qApp' from 'AnyQt.QtWidgets' (/home/frankc/orange/lib/python3.11/site-packages/AnyQt/QtWidgets.py)
2023-09-29 01:29:44,100:INFO:orangecanvas.registry.discovery: Could not import 'orangecontrib.associate.widgets.owitemsets'.
Traceback (most recent call last):
  File "/home/frankc/orange/lib/python3.11/site-packages/orangecanvas/registry/discovery.py", line 309, in iter_widget_descriptions
    module = asmodule(name)
             ^^^^^^^^^^^^^^
  File "/home/frankc/orange/lib/python3.11/site-packages/orangecanvas/registry/discovery.py", line 552, in asmodule
    return __import__(module, fromlist=[""])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/frankc/orange/lib/python3.11/site-packages/orangecontrib/associate/widgets/owitemsets.py", line 9, in <module>
    from AnyQt.QtWidgets import QTreeWidget, QTreeWidgetItem, qApp

From biolab/orange3#6588

I had exact same problems with PyQt6 6.5.

Description of changes

qApp -> QApplication.instance()

Includes
codecov-commenter commented 1 year ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (80b4983) 52.71% compared to head (37690eb) 52.71%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #57 +/- ## ======================================= Coverage 52.71% 52.71% ======================================= Files 6 6 Lines 791 791 ======================================= Hits 417 417 Misses 374 374 ``` | [Files](https://app.codecov.io/gh/biolab/orange3-associate/pull/57?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biolab) | Coverage Δ | | |---|---|---| | [orangecontrib/associate/widgets/owassociate.py](https://app.codecov.io/gh/biolab/orange3-associate/pull/57?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biolab#diff-b3JhbmdlY29udHJpYi9hc3NvY2lhdGUvd2lkZ2V0cy9vd2Fzc29jaWF0ZS5weQ==) | `88.77% <100.00%> (ø)` | | | [orangecontrib/associate/widgets/owitemsets.py](https://app.codecov.io/gh/biolab/orange3-associate/pull/57?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biolab#diff-b3JhbmdlY29udHJpYi9hc3NvY2lhdGUvd2lkZ2V0cy9vd2l0ZW1zZXRzLnB5) | `0.00% <0.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.