Bug 401087 - Custom plot range values are problematic
Summary: Custom plot range values are problematic
Status: RESOLVED FIXED
Alias: None
Product: LabPlot2
Classification: Applications
Component: frontend (other bugs)
Version First Reported In: latest
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-15 22:14 UTC by Stefan Gerlach
Modified: 2019-02-14 07:52 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In: 2.6
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gerlach 2018-11-15 22:14:35 UTC
1. It is hard to customize the xy-plot x/y-range minimum/maximum to values bigger than 1e6 or smaller than 1e-6 because the value is evaluated after entering one digit and changed to scientific notation. Just try to set it to "1e+8".
2. When the value for maximum is "1e+6" and i enter "0" leading to "1e+60", LP crashes immediately
Comment 1 Alexander Semke 2019-02-14 07:47:29 UTC
Git commit 17eedf3e26725b62f776384e32b5104fb16ff322 by Alexander Semke.
Committed on 14/02/2019 at 07:46.
Pushed by asemke into branch 'master'.

Don't allow to enter infinite values for plot ranges leading to crashes.
FIXED-IN: 2.6

M  +2    -2    src/backend/worksheet/plots/cartesian/CartesianPlot.cpp

https://commits.kde.org/labplot/17eedf3e26725b62f776384e32b5104fb16ff322
Comment 2 Alexander Semke 2019-02-14 07:52:56 UTC
(In reply to Stefan Gerlach from comment #0)
> 1. It is hard to customize the xy-plot x/y-range minimum/maximum to values
> bigger than 1e6 or smaller than 1e-6 because the value is evaluated after
> entering one digit and changed to scientific notation. Just try to set it to
> "1e+8".
> 2. When the value for maximum is "1e+6" and i enter "0" leading to "1e+60",
> LP crashes immediately

I added a safety check now in order not to crash in 2.6 now. The entry of such values is still cumbersome...

I think the solution here would be to switch everywhere from QLineEdit to our ExpressionTextEdit. In our task for 2.7 https://phabricator.kde.org/T10225 I mentioned this already under 
"allow to enter formulas for things like min/max values for plot ranges, scaling factor in axes and so on. Useful for example if you work with bytes and want to switch in the plot to kB, MB and so on."

This is quite some work and would result in further delay of 2.6, though. So, let's improve everywhere and consistently in 2.7.