Add copy and paste support for calculator widget
Review Request #123161 - Created March 27, 2015 and submitted
The current displayed value from the textfield can be copied. Content from the clipboard can be pasted but only if the content is a valid number BUG: 318221
*) Tried copying entered numbers and results - works for me :)
*) Pasting "asdf" leads to nothing being pasted - correct
*) Pasting "5" appends the number to the currently entered input or replaces the current number in case an operator has been pressed before
Only pasting doubles is possible - no signs or full math expressions are supported.
It looks like the plasmoid doesn't supports signed numbers in general (e.g. 5 - -5 doesnt result in 10)
Comments welcome :) This is my second patch so hopefully my work isn't complete garbage :P
avoid guessing what the shortcut is.
Otherwise if someone maps it to alt in their settings it won't work. Or if someone has a dvorak layout it won't be c and v.
internally this will ask our QPT plugin which loads things from a KDE config file.
I'm not convinced this is going to work.
You'll update the display, but all the handling of storing what number is entered handles in the key press events.
Can you try pasting "5" then typing '+' and '1'
and see what happens.
I think it will then show 1, not 6.
Fixed pasting and implemented suggestions.
Revision 2 (+45)