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

Report: Fix saving to PDF #281

Merged
merged 3 commits into from
Dec 6, 2024
Merged

Report: Fix saving to PDF #281

merged 3 commits into from
Dec 6, 2024

Conversation

janezd
Copy link
Contributor

@janezd janezd commented Dec 5, 2024

Issue

In Qt6, QPrinter no longer contains an enum with page sizes, e.g. QPrinter.A4. I haven't found a notice that enum is obsolete and removed, but I found this.

To reproduce, on macOS:

  • Report something
  • Click Print
  • Choose PDF -> Save as PDF ...
  • Enter file name, click Save

Crashes with

File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/orangewidget/report/owreport.py", line 350, in save_report
    printer.setPageSize(QPrinter.A4)
                        ^^^^^^^^^^^
AttributeError: type object 'QPrinter' has no attribute 'A4'
Description of changes

Use QPageSize.

Includes
  • Code changes

@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.03%. Comparing base (05bbef6) to head (39b8e9a).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #281      +/-   ##
==========================================
+ Coverage   71.76%   72.03%   +0.26%     
==========================================
  Files          34       34              
  Lines        9117     9117              
==========================================
+ Hits         6543     6567      +24     
+ Misses       2574     2550      -24     

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

@janezd janezd merged commit c28fde3 into biolab:master Dec 6, 2024
23 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