<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.5897" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=181530023-27012010>PS: I've added this to the Symbology-NG page on the
wiki - </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=181530023-27012010></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=181530023-27012010><A
href="http://www.qgis.org/wiki/Symbology-NG">http://www.qgis.org/wiki/Symbology-NG</A></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=181530023-27012010></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=181530023-27012010>Cheers</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=181530023-27012010>Chris</SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> qgis-developer-bounces@lists.osgeo.org
[mailto:qgis-developer-bounces@lists.osgeo.org] <B>On Behalf Of </B>Chris
Crook<BR><B>Sent:</B> Thursday, 28 January 2010 11:16 a.m.<BR><B>To:</B>
qgis-developer@lists.osgeo.org<BR><B>Subject:</B> [Qgis-developer] RE: Python
renderer plugin icon - solution .. almost<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=394041022-27012010>Hi</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=394041022-27012010></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=394041022-27012010>I've done some digging into this, and it seems that I
can create an icon, but I have difficulty associating it with the renderer in
the dialog. The problem is in qgsrendererv2propertiesdialog.cpp, line 74,
which reads:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=394041022-27012010></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2> QString iconPath =
QgsApplication::defaultThemePath() + m->iconName();<BR></FONT></DIV>
<DIV><SPAN class=394041022-27012010><FONT face=Arial color=#0000ff size=2>The
problem I have my icon resource (built with pyrcc4) isn't necessarily on the
default theme path. I guess I could put it there, but that would depend on
it not being changed. I wonder if it would be better to code this
as:</FONT></SPAN></DIV><SPAN class=394041022-27012010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN><FONT face=Arial color=#0000ff size=2></FONT>
<DIV><BR><FONT face=Arial color=#0000ff size=2> QString
iconPath = m->iconName();</FONT></DIV>
<DIV><SPAN class=394041022-27012010></SPAN><FONT face=Arial><FONT
color=#0000ff><FONT size=2> <SPAN class=394041022-27012010> if(
! iconPath.startsWith(':')) iconPath = QgsApplication::defaultThemePath()
+iconPath</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=394041022-27012010></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=394041022-27012010>That way I can use my own resource path, which avoids
any possible conflict.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=394041022-27012010></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=394041022-27012010>Is this something that could be
implemented?</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=394041022-27012010></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=394041022-27012010>Thanks</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=394041022-27012010>Chris</SPAN></FONT></FONT></FONT></DIV>
<DIV><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> qgis-developer-bounces@lists.osgeo.org
[mailto:qgis-developer-bounces@lists.osgeo.org] <B>On Behalf Of </B>Chris
Crook<BR><B>Sent:</B> Wednesday, 27 January 2010 11:04 a.m.<BR><B>To:</B>
qgis-developer@lists.osgeo.org<BR><B>Subject:</B> [Qgis-developer] Python
renderer plugin icon<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><SPAN class=242224921-26012010><FONT face=Arial size=2>I'm wanting to
associate an icon with a python based renderer plugin, so that it looks like the
other renderers in the symbology dialog. It seems that the icon defined by
name in the QgsRendererV2AbstractMetadata constructor.</FONT></SPAN></DIV>
<DIV><SPAN class=242224921-26012010><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=242224921-26012010><FONT face=Arial size=2>I guess that the
icon name refers to the name of a QIcon resource, and I imagine
that </FONT></SPAN><SPAN class=242224921-26012010><FONT face=Arial size=2>I
can install the resource with this name somewhere as part of my initGui function
of my plugin class factory. </FONT></SPAN></DIV>
<DIV><SPAN class=242224921-26012010><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=242224921-26012010><FONT face=Arial size=2>However my knowledge
of PyQt lets me down at this point. Can anyone give me any clues as to how
to build an icon resource from a .png file and how to install it
so that it shows up as an icon in the Symbology dialog?</FONT></SPAN></DIV>
<DIV><SPAN class=242224921-26012010><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=242224921-26012010><FONT face=Arial
size=2>Thanks</FONT></SPAN></DIV>
<DIV><SPAN class=242224921-26012010><FONT face=Arial
size=2>Chris</FONT></SPAN></DIV>
<DIV>
<HR>
<DIV>This message contains information, which is confidential and may be subject
to legal privilege. <BR>If you are not the intended recipient, you must not
peruse, use, disseminate, distribute or copy this message.<BR>If you have
received this message in error, please notify us immediately (Phone 0800 665 463
or <A href="mailto:sinfo@linz.govt.nz">info@linz.govt.nz</A> ) and destroy the
original message.</DIV>
<DIV>LINZ accepts no responsibility for changes to this email, or for any
attachments, after its transmission from LINZ.</DIV>
<DIV> </DIV>
<DIV><STRONG>Thank you.</STRONG> <BR></DIV>
<HR>
</DIV>
<DIV>
<HR>
<DIV>This message contains information, which is confidential and may be subject
to legal privilege. <BR>If you are not the intended recipient, you must not
peruse, use, disseminate, distribute or copy this message.<BR>If you have
received this message in error, please notify us immediately (Phone 0800 665 463
or <A href="mailto:sinfo@linz.govt.nz">info@linz.govt.nz</A> ) and destroy the
original message.</DIV>
<DIV>LINZ accepts no responsibility for changes to this email, or for any
attachments, after its transmission from LINZ.</DIV>
<DIV> </DIV>
<DIV><STRONG>Thank you.</STRONG> <BR></DIV>
<HR>
</DIV>
<DIV>
<HR>
<DIV>This message contains information, which is confidential and may be subject
to legal privilege. <BR>If you are not the intended recipient, you must not
peruse, use, disseminate, distribute or copy this message.<BR>If you have
received this message in error, please notify us immediately (Phone 0800 665 463
or <A href="mailto:sinfo@linz.govt.nz">info@linz.govt.nz</A> ) and destroy the
original message.</DIV>
<DIV>LINZ accepts no responsibility for changes to this email, or for any
attachments, after its transmission from LINZ.</DIV>
<DIV> </DIV>
<DIV><STRONG>Thank you.</STRONG> <BR></DIV>
<HR>
</DIV>
</BODY></HTML>