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

customizableplot.available_font_families: Fix for non-existent default family #5037

Merged
merged 1 commit into from
Oct 23, 2020

Conversation

janezd
Copy link
Contributor

@janezd janezd commented Oct 17, 2020

Issue

Fixes #5036.

It seems that the default font doesn't always exist.

Description of changes

Check whether the default font family exists. If not, just return a sorted list of families, without pushing the default to the top.

Also: tests for available_font_family.

Includes
  • Code changes
  • Tests

@janezd janezd force-pushed the non-existent-default-font-family branch from b0e4a4f to 977eb77 Compare October 17, 2020 16:44
@codecov
Copy link

codecov bot commented Oct 17, 2020

Codecov Report

Merging #5037 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #5037      +/-   ##
==========================================
+ Coverage   84.66%   84.67%   +0.01%     
==========================================
  Files         285      285              
  Lines       59509    59557      +48     
==========================================
+ Hits        50381    50428      +47     
- Misses       9128     9129       +1     

@janezd janezd added the urgent Requires immediate action label Oct 22, 2020
top_section = []

default_family = default_font_family()
if default_family in fonts:
Copy link
Contributor

@VesnaT VesnaT Oct 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default_family should be added to the fontList even though not present in QFontDatabase().families(). If not, the combobox may crash when trying to set its text to something missing in its model().

@janezd janezd force-pushed the non-existent-default-font-family branch from 977eb77 to 86d052b Compare October 23, 2020 09:37
@VesnaT VesnaT merged commit 1d29cf9 into biolab:master Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
urgent Requires immediate action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

available_font_families crashes if default font is missing
2 participants