On Tue, Feb 22, 2011 at 10:50 AM, Salvatore Larosa <[email protected]> wrote:
>
>
> Martin Dobias wrote:
>>
>> Hi Salvatore
>>
>> to use semi-transparent circles as vertex markers:
>>
>> settings = QSettings()
>> settings.setValue("/qgis/digitizing/marker_style",
>> "SemiTransparentCircle")
>>
>> That code can be put somewhere in the application's initialization.
>> Other values are "Cross" and "None". You can also change the size of
>> the marker:
>>
>> settigs.setValue("/qgis/digitizing/marker_size", 3)
>>
>>
>> Martin
>> _______________________________________________
>> Qgis-developer mailing list
>> [email protected]
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>>
>
> Thank for your reply, Martin
>
> I put in the my script the code you posted, but it not works.
>
> I have imported QSettings() from PyQt4.QtCore and put the code
> in class MainWindow and I get this error:
>
> File "/home/sam/dev_qgis/src/mainwintest.py", line 32, in __init__
> settings.setValue("/qgis/digitizing/marker_style", "SemiTransparentCircle")
> TypeError: argument 2 of QSettings.setValue() has an invalid type
>
> Any hint?

You probably need to wrap the second parameter into QVariant class (I
think newer PyQt versions have this conversion automatically):

settings.setValue("/qgis/digitizing/marker_style",
QVariant("SemiTransparentCircle"))

Martin
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to