BUG: 308168
Details
- Reviewers
tcanabrava - Group Reviewers
KDE Edu - Commits
- R334:4ec38cf969af: Copy root value or (x,y) pair to clipboard
- Plot some function with a known root (e.g. f(x) = x^2).
- Left-click on the curve then right-click on it.
- Choose "Copy (x, y)". Paste the result somewhere (e.g. in KWrite).
- Move mouse pointer close to the root then right-click.
- Choose "Copy Root Value". Paste the result somewhere (e.g. in KWrite).
- Move mouse elsewhere then right-click. The "Copy Root Value" item should disappear from the popup menu.
Diff Detail
- Repository
- R334 KmPlot
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Because technically it has a root (x=0) and exactly this value will be copied.
To be honest, this new feature introduces nothing that has not already been in the interface. Statusbar shows "root: x_0 = +0.00000" as well.
kmplot/maindlg.h | ||
---|---|---|
219 | for consistence i'd initialzie this in the constructor to 0 or something | |
kmplot/view.cpp | ||
3519 | spacing here looks weird to me and looks like it should be on the same horizontal position as "else" but since you didn't use arc i can't see the rest of the file to see if that's actually the style for the file, feel free to ignore this. | |
kmplot/view.h | ||
215 | please add a getter, don't make this member variable public. | |
243 | i was going to complain how callign a signal setXXX makes no sense, because the signal is not setting anything, it's just saying something happened, so it should be really called rootValueChanged or updateRootValue or something like that but i see the one above is call set, so meh, i guess leave it if you don't agree with rootValueChanged being a better name. |
Get rid of unrelated changes, more locale-friendly result formatting for "Copy (x, y)".
kmplot/view.h | ||
---|---|---|
215 | this should be const. please take a look on const correctness |
kmplot/view.h | ||
---|---|---|
215 | Sorry, you added the wrong const. const QPointF getCrosshairPosition(); means that the QPointF that's being returned is a const. QPointF getCrosshairPosition() const; means that the *method* is constant and cannot change the this-pointer or any internals. take the time to look at the link I provided about const correctness. |