QCAD

QCAD - 2D CAD System.

Click here for a documentation of the DokuWiki formatting syntax that can be used in reports

Please search for existing tasks (also closed ones) before opening a new task.

Please make sure that you are using the latest Version of QCAD before posting a bug (menu Help - Check for Updates)

Tasklist

FS#9 - RSettings.setValue() doesn't work for "GraphicsViewColors/BackgroundColor"

Attached to Project: QCAD
Opened by Martin (martin) - Thursday, 14 April 2011, 11:36 GMT+1
Last edited by Martin (martin) - Thursday, 14 April 2011, 15:53 GMT+1
Task Type Bug Report
Category Main
Status Closed
Assigned To Andrew (andrew)
Operating System Linux (All / Other)
Severity Low
Priority Normal
Reported Version Development
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Context: Needed to set color settings for book images.

RSettings.setValue("GraphicsViewColors/BackgroundColor", new RColor(0xff, 0xfe, 0xfd));
RSettings.setValue("GraphicsViewColors/MetaGridColor", new RColor(0xff, 0xfe, 0xfd));

QCAD3.conf:

BackgroundColor=@Variant(\0\0\0\x7f\0\0\0\aRColor\0\x1\xff\xff\0\0\0\0\0\0\0\0\0\x2)
MetaGridColor  =@Variant(\0\0\0\x7f\0\0\0\aRColor\0\x1\xff\xff\xff\xff\xfe\xfe\xfd\xfd\0\0\0\x2)

Setting the alpha channel value and the color mode for RColor doesn’t change anything.
Using view.setBackgroundColor() instead works for the background color, but not for other colors such as the meta grid color.

This task depends upon

Closed by  Martin (martin)
Thursday, 14 April 2011, 15:53 GMT+1
Reason for closing:  Not a bug
Comment by Andrew (andrew) - Thursday, 14 April 2011, 12:20 GMT+1

The background color of a graphics view can be set without changing the configuration file (view.setBackgroundColor()). This override is needed for the part library icons (white background) and also serves as cache.

To set the background color for an existing graphics view (does not change the settings file):

view.setBackgroundColor(...);

To set the background color for all new graphics views (changes the settings file):

RSettings.setValue("GraphicsViewColors/BackgroundColor", ...);

To set the background color for an existing graphics view and changing the settings file, both lines are needed.

For all other colors, RSettings.setValue(...) can be used.

Comment by Martin (martin) - Thursday, 14 April 2011, 13:25 GMT+1

yes, but

RSettings.setValue("GraphicsViewColors/BackgroundColor", ...);

stores black (0) for any given value. That's the bug.

Sure I can make it with a workaround for the book images. The idea was to have a setup method, where all things are set right (colors, dock window settings etc.). At this point in time there is no drawing opened, so changing the config file was the only way.

Loading...