- add DateTimeSpinbox and normal qspinbox instead of lineEdit
- move corner to tick position if abs(angle) >= 0.01°
- fix axis label moving in x direction with offset
- don't move axistitle, if the axislabels are inside the plot
Details
- Reviewers
asemke
Diff Detail
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Thanks in advance for fixing a minor typo.
src/commonfrontend/widgets/DateTimeSpinBox.h | ||
---|---|---|
10 | Typo: alway -> always |
src/commonfrontend/widgets/DateTimeSpinBox.cpp | ||
---|---|---|
15 | warning: unknown escape sequence: '\.' | |
24 | warning: unused variable ‘type’ | |
202 | warning: unused parameter ‘nextType’ | |
205 | warning: enumeration value ‘millisecond’ not handled in switch | |
src/commonfrontend/widgets/DateTimeSpinBox.h | ||
30 | warning: 'stepEnabled' overrides a member function but is not marked 'override' |
DateTimeSpinBox is a useful widget. I think we can use it at some other places, too. Thanks for this contribution! Can you please add license headers to the new files?
I played a bit with the data from intraday.json. I added "1. open" to the y-values. The y-axis ranges in this case from 101.27 to 101.375. The paging step in the DoubleSpinBox for the tick increment is set to 1. With this, when changing the value once, we increment by 1 and all the ticks disappear. Can we adjust this paging step automatically to the current ranges of the axis somehow? This would further improve the user experience.
- determine decimals and steps for the qdoubleSpinbox
- removed not used variables
- update comments
src/backend/worksheet/plots/cartesian/Axis.cpp | ||
---|---|---|
1569–1570 | cosinus and sinus only used in the definition of diffx and diffy and can be used there directly. | |
1572–1581 | why do you need to check orientation here? | |
1599 | improve the wording a bit. Maybe something like "for rotated labels (angle is not zero), align label's corner at the position of the tick" | |
1600 | if I set Rotation=90° and Offset=0pt, I'd expect the label to be positioned right next to the tick and aligned at the center of the rotated label. This is not the case with this logic. | |
src/kdefrontend/dockwidgets/AxisDock.cpp | ||
72 | let's use hard coded row numbers here instead of this for loop with all the logic that is not so easy to grasp. | |
849 | this check is not required. An axis has always a plot as the parent. | |
911 | same as above. | |
919 | no brackets for one-liners. | |
931 | no brackets for one-liners. | |
1874 | why this change? | |
1882–1911 | why this change? |
src/backend/worksheet/plots/cartesian/Axis.cpp | ||
---|---|---|
1569–1570 | otherwise sinus and cosinus will be calculated every loop cycle | |
1572–1581 | before there was only but the labelsformat for datetime is different and it cannot be checked, if the labelsFormat == Axis::FormatDecimal ... | |
1600 | Thats correct :) I have to check. |
Looks good now. I'll add additional escaping in QRegularExpression in DateTimeSpinBox to get rid of compiler warnings and push your fix.