hi,<br><br>i have used mapcanvas() to render ellipse on qgis application, i have installed qgis_1.0.0 in windows and created one plugin from that plugin i have to render a ellipse&nbsp; on screen this my code it works on linux but not in windows please can anybody help me.<br>
here is the code.<br><br><br><br><br>#include &quot;qgspointconverterplugin.h&quot;<br><br><br>#ifdef WIN32<br>#define QGISEXTERN extern &quot;C&quot; __declspec( dllexport )<br>#else<br>#define QGISEXTERN extern &quot;C&quot;<br>
#endif<br>QgsPointConverterPlugin::<div id=":6f" class="ArwC7c ckChnd">QgsPointConverterPlugin(QgisInterface* iface): mIface(iface), qGisInterface( iface)<br>
{<br>}<br>QgsPointConverterPlugin::~QgsPointConverterPlugin()<br>{<br>}<br>void QgsPointConverterPlugin::initGui()<br>{<br>&nbsp; // myQActionPointer = new QAction( QIcon( &quot;:/scale_bar.png&quot; ), tr( &quot;&amp;Scale Bar&quot; ), this );<br>

&nbsp; mAction = new QAction(tr(&quot;&amp;Convert to point&quot;), this);<br>&nbsp; connect(mAction, SIGNAL(activated()), this, SLOT( run() ) );<br>&nbsp; connect( qGisInterface-&gt;getMapCanvas(), SIGNAL( renderComplete( QPainter * ) ), this, SLOT( render(QPainter * )) );&nbsp; <br>

&nbsp; <br>&nbsp; mIface-&gt;addToolBarIcon(mAction);<br>&nbsp; mIface-&gt;addPluginMenu(tr(&quot;&amp;Convert to point&quot;), mAction);<br>}<br>void QgsPointConverterPlugin::unload()<br>{<br>&nbsp; mIface-&gt;removeToolBarIcon(mAction);<br>

&nbsp; mIface-&gt;removePluginMenu(tr(&quot;&amp;Convert to point&quot;), mAction);<br>&nbsp; delete mAction;<br>}<br>//void QgsPointConverterPlugin::refreshCanvas()<br>//{<br>//&nbsp; qGisInterface-&gt;mapCanvas()-&gt;refresh();<br>//}<br>

<br>void QgsPointConverterPlugin::run()<br>{<br>&nbsp; /*QgsScaleBarPluginGui *myPluginGui = new QgsScaleBarPluginGui( qGisInterface-&gt;mainWindow(), QgisGui::ModalDialogFlags );<br>&nbsp; myPluginGui-&gt;setAttribute( Qt::WA_DeleteOnClose );<br>

&nbsp; myPluginGui-&gt;setPreferredSize( mPreferredSize );<br>&nbsp; myPluginGui-&gt;setSnapping( mSnapping );<br>&nbsp; myPluginGui-&gt;setPlacementLabels( mPlacementLabels );<br>&nbsp; myPluginGui-&gt;setPlacement( mPlacementIndex );<br>&nbsp; myPluginGui-&gt;setEnabled( mEnabled );<br>

&nbsp; myPluginGui-&gt;setStyleLabels( mStyleLabels );<br>&nbsp; myPluginGui-&gt;setStyle( mStyleIndex );<br>&nbsp; myPluginGui-&gt;setColour( mColour );*/<br><br>&nbsp; /*connect( myPluginGui, SIGNAL( changePreferredSize( int ) ), this, SLOT( setPreferredSize( int ) ) );<br>

&nbsp; connect( myPluginGui, SIGNAL( changeSnapping( bool ) ), this, SLOT( setSnapping( bool ) ) );<br>&nbsp; connect( myPluginGui, SIGNAL( changePlacement( int ) ), this, SLOT( setPlacement( int ) ) );<br>&nbsp; connect( myPluginGui, SIGNAL( changeEnabled( bool ) ), this, SLOT( setEnabled( bool ) ) );<br>

&nbsp; connect( myPluginGui, SIGNAL( changeStyle( int ) ), this, SLOT( setStyle( int ) ) );<br>&nbsp; connect( myPluginGui, SIGNAL( changeColour( QColor ) ), this, SLOT( setColour( QColor ) ) );<br>&nbsp; connect( myPluginGui, SIGNAL( refreshCanvas() ), this, SLOT( refreshCanvas() ) );<br>

&nbsp; myPluginGui-&gt;show();*/<br>}<br>void QgsPointConverterPlugin::render(QPainter *painter)//<br>{<br><br>&nbsp; painter-&gt;setRenderHint(QPainter::Antialiasing, true);<br>&nbsp; painter-&gt;setPen(QPen(Qt::black, 12, Qt::DashDotLine, Qt::RoundCap));<br>

&nbsp; painter-&gt;setBrush(QBrush(Qt::green, Qt::SolidPattern));<br>&nbsp; painter-&gt;drawEllipse(10, 10, 100, 140);<br><br><br>}<br><br>QGISEXTERN QgisPlugin* classFactory(QgisInterface* iface)<br>{<br>&nbsp; return new QgsPointConverterPlugin(iface);<br>

}<br><br>QGISEXTERN QString name()<br>{<br>&nbsp; return &quot;point converter plugin&quot;;<br>}<br>QGISEXTERN QString description()<br>{<br>&nbsp; return &quot;A plugin that converts vector layers to delimited text point files&quot;;<br>

}<br>QGISEXTERN QString version()<br>{<br>&nbsp; return &quot;0.00001&quot;;<br>}<br><br><br>// Return the type (either UI or MapLayer plugin)<br>QGISEXTERN int type()<br>{<br>&nbsp; return QgisPlugin::UI;<br>}<br>// Delete ourself<br>

QGISEXTERN void unload(QgisPlugin* theQgsPointConverterPluginPointer)<br>{<br>&nbsp; <br>&nbsp; //disconnect( qGisInterface-&gt;mapCanvas(), SIGNAL( renderComplete( QPainter * ) ),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //this, SLOT( renderScaleBar( QPainter * ) ) );<br>

&nbsp;// refreshCanvas();<br><br>&nbsp; //delete myQActionPointer;<br>&nbsp; delete theQgsPointConverterPluginPointer;<br>}</div><br>