[Qgis-developer] Problems with using QGIS Custom Widgets

C Hamilton adenaculture at gmail.com
Wed Aug 17 07:46:40 PDT 2016


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>
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/20160817/28fcd468/attachment.html>


More information about the Qgis-developer mailing list