[Qgis-developer] Problems with using QGIS Custom Widgets

Casper Børgesen (CABO) CABO at NIRAS.DK
Thu Aug 18 01:13:53 PDT 2016


Hi Calvin

It does. Thanks a lot!


Regards, Casper


From: C Hamilton [mailto:adenaculture at gmail.com]
Sent: 17. august 2016 16:47
To: Casper Børgesen (CABO)
Cc: qgis-developer
Subject: Re: [Qgis-developer] Problems with using QGIS Custom Widgets

Yes I did. When you save the file it uses the C++ header so in my case it had the following:

 <customwidgets>
  <customwidget>
   <class>QgsColorButtonV2</class>
   <extends>QToolButton</extends>
   <header>qgscolorbuttonv2.h</header>
  </customwidget>
 </customwidgets>
You need to replace qgscolorbutton2.h with the PyQT/PyGIS gui module. In this case it is:

<customwidgets>
  <customwidget>
   <class>QgsColorButtonV2</class>
   <extends>QToolButton</extends>
   <header>qgis.gui</header>
  </customwidget>
 </customwidgets>
I think this works for all of the custom QGIS widgets. Unfortunately, every time you save using Qt Designer it overwrites qgis.gui and you have to manually go put it back in.
I hope this helps.
Calvin


On Wed, Aug 17, 2016 at 10:09 AM, Casper Børgesen (CABO) <CABO at niras.dk<mailto:CABO at niras.dk>> wrote:
Hi Calvin

I’m facing the same problem and before I go home I just wanted to ask if you found a solution to this problem?


Regards, Casper

Calvin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160818/37df2e07/attachment.html>


More information about the Qgis-developer mailing list