Review Request 119042: Implement the QML color picker in QML

Denis Steckelmacher steckdenis at yahoo.fr
Mon Jun 30 17:47:52 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119042/
-----------------------------------------------------------

Review request for KDevelop.


Repository: kdev-qmljs


Description
-------

In order not to have two different kinds of "helper widgets" (widgets that pop up when the cursor is over a QML property), QML ones and C++ ones, this patch removes the C++ color picker widget and replaces it with a pure QML implementation of it. The QML widget looks very much like the C++ one (and behaves a bit better, for instance it is always in sync with the value displayed in the source code), and is quite a bit smaller than the code it replaces.

Two features are removed by this patch, though:

* Colors are not highlighted everywhere, but only when they are used as property values. The special highlighting of colors has also been removed. I hope this feature was not too important, but I like that everything behaves in the same way (and it allowed me to remove many lines of code)
* Named colors are temporarily not supported anymore. If the user places the cursor over a named color (like "red"), the color picker widget will not recognize it and will show a black color. This comes from the fact that there is no way of getting the red, green and blue components of a color in QML, so I cannot just let QColor parse the name and then get the red, green and blue components. The parsing has to be done by hand, and currently only recognizes #rrggbbaa and #rrggbb formats (#rgba and #rgb should be easy to add if needed).


Diffs
-----

  CMakeLists.txt 036ec6f 
  kdevqmljsplugin.h d1afff5 
  kdevqmljsplugin.cpp 3bf0145 
  navigation/colorchooser.h 1fa6e32 
  navigation/colorchooser.cpp e17b18a 
  navigation/propertypreviewwidget.cpp 083ab65 
  navigation/propertywidgets/ColorPicker.qml PRE-CREATION 

Diff: https://git.reviewboard.kde.org/r/119042/diff/


Testing
-------

The widget is properly shown for "color" properties, and displays the color that was already present in the source code. Modifying the hue, value or luminosity of the color works as expected, and the correct color is written in the source code.


Thanks,

Denis Steckelmacher

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140630/d620635c/attachment.html>


More information about the KDevelop-devel mailing list