Make QColor a value type
authorChris Adams <christopher.adams@nokia.com>
Tue, 2 Aug 2011 23:20:18 +0000 (09:20 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 18 Aug 2011 03:10:14 +0000 (05:10 +0200)
commit36767e3fe1f0038441ae06ef5b5e1cb19a3738fa
treeb0585a341061534876ac1e5ce1ce85f78a504ef1
parent74f3a67fe80fecf7ba2fd76e1758b6c0f68ce918
Make QColor a value type

This commit allows direct access to the r, g, b and a components
of a color (in floating point format: 0 <= v <= 1). Since conversion
from color to string is a common operation, this commit also adds
unit tests to ensure that the previous behaviour is maintained in
other cases (comparison with toString value, etc).

Task-number: QTBUG-14731
Change-Id: I87b521dd4f9c1e96dfe5b20cf8053293cb14cfe4
Reviewed-on: http://codereview.qt.nokia.com/2527
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
src/declarative/qml/qdeclarativevaluetype.cpp
src/declarative/qml/qdeclarativevaluetype_p.h
tests/auto/declarative/qdeclarativevaluetypes/data/color_compare.qml [new file with mode: 0644]
tests/auto/declarative/qdeclarativevaluetypes/data/color_read.qml [new file with mode: 0644]
tests/auto/declarative/qdeclarativevaluetypes/data/color_write.qml [new file with mode: 0644]
tests/auto/declarative/qdeclarativevaluetypes/testtypes.h
tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp