Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

markotoplak
Copy link
Member

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
  • Code changes
  • Tests
  • Documentation

@codecov-commenter
Copy link

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
@@           Coverage Diff           @@
##           master      #57   +/-   ##
=======================================
  Coverage   52.71%   52.71%           
=======================================
  Files           6        6           
  Lines         791      791           
=======================================
  Hits          417      417           
  Misses        374      374           
Files Coverage Δ
orangecontrib/associate/widgets/owassociate.py 88.77% <100.00%> (ø)
orangecontrib/associate/widgets/owitemsets.py 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@markotoplak markotoplak changed the title Use QApplication.instance() instead of qApp Use QApplication.instance() instead of qApp (Qt6 compatibility) Sep 29, 2023
@PrimozGodec PrimozGodec merged commit c045621 into biolab:master Sep 29, 2023
6 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants