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

improvements to qt edit widget #4411

Merged
merged 2 commits into from May 13, 2015
Merged

Conversation

tacaswell
Copy link
Member

If there are lines on the Axes, but they are all labeled
'nolegend', treat as if there are no lines on the Axes.

Closes #4323

Convert all colors to hex before passing to the form layout

Closes #4410

If there are lines on the Axes, but they are all labeled
'_nolegend_', treat as if there are no lines on the Axes.

Closes matplotlib#4323
@tacaswell tacaswell added this to the next point release milestone May 6, 2015
@tacaswell
Copy link
Member Author

This should probably be back-ported

Convert all line colors to hex before passing into the form layout.

Closes matplotlib#4410
@tacaswell tacaswell changed the title FIX : do not pass empty curve list through improvements to qt edit widget May 6, 2015
@anntzer
Copy link
Contributor

anntzer commented May 6, 2015

I feel like one should rather fix FormTabWidget.__init__ to support empty data lists (and do nothing in that case) and to_qcolor (at least let it throw an exception if it can't convert the color, mapping everything to black is clearly wrong).

@tacaswell
Copy link
Member Author

The color stuff is a bit excessive, but the reason it is the way it is is that to_qcolor is used as part of the processing of converting user input -> color in the gui which comes back as a string. The commit message on the last time the color = str(color) line was touched references dealing with QString issues which is a nasty bit of API change over in pyqt. Having this default to black isn't a bad course of action if the user types 'aardvark' into the color box and it looks like we are relying on Qt default behavior here to get that, not ours. Making sure we pass the initial color in in an unambiguous string like way is relatively clean and the minimal change to fix this problem. I think any other way would be a change in behavior and require a good bit of re-working on the Qt side of this.

Same with FormTabWidget, ensuring mpl passes in valid input is simpler than modifying the Qt code.

formlayout.py is an external project that we bundle so I am biased against modifying it more than absolutely needed.

@anntzer If you would like to propose more invasive changes PRs are always welcome, but I think that these changes fix the problem in a relatively clean way.

Roughly related to #4304 which also involves this widget and colors.

efiring added a commit that referenced this pull request May 13, 2015
@efiring efiring merged commit 03eccd0 into matplotlib:master May 13, 2015
@tacaswell tacaswell deleted the fix_qt4_widget branch May 13, 2015 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants