← All bug reports

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

Type
Bug
Status
Closed
Resolution
Not a bug
Category
QCAD (main)
Severity
Low
Priority
Low
Reported version
Development
Operating system
Linux (All / Other)
Reported
2011-04-14 by anonymous
Closed
2011-04-14 by deleted user

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.

Comments (2)

andrew 2011-04-14

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.

deleted user 2011-04-14

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.