[Qgis-community-team] HI

Tim Sutton tim at linfiniti.com
Fri Feb 13 03:36:19 EST 2009


Hi

On Friday 13 February 2009 08:39:31 Otto Dassau wrote:
> Hi Sahana,
>
> please post this email to the QGIS user list:
> http://lists.osgeo.org/mailman/listinfo/qgis-user

Probably the developer list would be more appropriate for this kind of 
question.

Regards

Tim

>
> the community list deals with topics like documentation, context help,
> user-guide, online experience ...
>
> regards,
>  Otto
>
> On Fri, 13 Feb 2009 10:47:15 +0530
>
> Sahana BS <sahana at analytica-india.com> wrote:
> > Hi.
> >
> >       i am using qgis_0.11.0, in windows i have installed.  i have
> > created a plugin but the problem is i need to draw something on the
> > screen  by using this plugin but i am not getting here is my code.can
> > anybody please help me............... i am new to this.............
> >
> >
> >
> > #include "qgspointconverterplugin.h"
> >
> >
> > #ifdef WIN32
> > #define QGISEXTERN extern "C" __declspec( dllexport )
> > #else
> > #define QGISEXTERN extern "C"
> > #endif
> > QgsPointConverterPlugin::QgsPointConverterPlugin(QgisInterface* iface):
> > mIface(iface), qGisInterface( iface)
> > {
> > }
> > QgsPointConverterPlugin::~QgsPointConverterPlugin()
> > {
> > }
> > void QgsPointConverterPlugin::initGui()
> > {
> >   // myQActionPointer = new QAction( QIcon( ":/scale_bar.png" ), tr(
> > "&Scale Bar" ), this );
> >   mAction = new QAction(tr("&Convert to point"), this);
> >   connect(mAction, SIGNAL(activated()), this, SLOT( run() ) );
> >   connect( qGisInterface->getMapCanvas(), SIGNAL( renderComplete(
> > QPainter * ) ), this, SLOT( render(QPainter * )) );
> >
> >   mIface->addToolBarIcon(mAction);
> >   mIface->addPluginMenu(tr("&Convert to point"), mAction);
> > }
> > void QgsPointConverterPlugin::unload()
> > {
> >   mIface->removeToolBarIcon(mAction);
> >   mIface->removePluginMenu(tr("&Convert to point"), mAction);
> >   delete mAction;
> > }
> > //void QgsPointConverterPlugin::refreshCanvas()
> > //{
> > //  qGisInterface->mapCanvas()->refresh();
> > //}
> >
> > void QgsPointConverterPlugin::run()
> > {
> >   /*QgsScaleBarPluginGui *myPluginGui = new QgsScaleBarPluginGui(
> > qGisInterface->mainWindow(), QgisGui::ModalDialogFlags );
> >   myPluginGui->setAttribute( Qt::WA_DeleteOnClose );
> >   myPluginGui->setPreferredSize( mPreferredSize );
> >   myPluginGui->setSnapping( mSnapping );
> >   myPluginGui->setPlacementLabels( mPlacementLabels );
> >   myPluginGui->setPlacement( mPlacementIndex );
> >   myPluginGui->setEnabled( mEnabled );
> >   myPluginGui->setStyleLabels( mStyleLabels );
> >   myPluginGui->setStyle( mStyleIndex );
> >   myPluginGui->setColour( mColour );*/
> >
> >   /*connect( myPluginGui, SIGNAL( changePreferredSize( int ) ), this,
> > SLOT( setPreferredSize( int ) ) );
> >   connect( myPluginGui, SIGNAL( changeSnapping( bool ) ), this, SLOT(
> > setSnapping( bool ) ) );
> >   connect( myPluginGui, SIGNAL( changePlacement( int ) ), this, SLOT(
> > setPlacement( int ) ) );
> >   connect( myPluginGui, SIGNAL( changeEnabled( bool ) ), this, SLOT(
> > setEnabled( bool ) ) );
> >   connect( myPluginGui, SIGNAL( changeStyle( int ) ), this, SLOT(
> > setStyle( int ) ) );
> >   connect( myPluginGui, SIGNAL( changeColour( QColor ) ), this, SLOT(
> > setColour( QColor ) ) );
> >   connect( myPluginGui, SIGNAL( refreshCanvas() ), this, SLOT(
> > refreshCanvas() ) );
> >   myPluginGui->show();*/
> > }
> > void QgsPointConverterPlugin::render(QPainter *painter)//
> > {
> >
> >   painter->setRenderHint(QPainter::Antialiasing, true);
> >   painter->setPen(QPen(Qt::black, 12, Qt::DashDotLine, Qt::RoundCap));
> >   painter->setBrush(QBrush(Qt::green, Qt::SolidPattern));
> >   painter->drawEllipse(10, 10, 100, 140);
> >
> >
> > }
> >
> > QGISEXTERN QgisPlugin* classFactory(QgisInterface* iface)
> > {
> >   return new QgsPointConverterPlugin(iface);
> > }
> >
> > QGISEXTERN QString name()
> > {
> >   return "point converter plugin";
> > }
> > QGISEXTERN QString description()
> > {
> >   return "A plugin that converts vector layers to delimited text point
> > files";
> > }
> > QGISEXTERN QString version()
> > {
> >   return "0.00001";
> > }
> >
> >
> > // Return the type (either UI or MapLayer plugin)
> > QGISEXTERN int type()
> > {
> >   return QgisPlugin::UI;
> > }
> > // Delete ourself
> > QGISEXTERN void unload(QgisPlugin* theQgsPointConverterPluginPointer)
> > {
> >
> >   //disconnect( qGisInterface->mapCanvas(), SIGNAL( renderComplete(
> > QPainter * ) ),
> >               //this, SLOT( renderScaleBar( QPainter * ) ) );
> >  // refreshCanvas();
> >
> >   //delete myQActionPointer;
> >   delete theQgsPointConverterPluginPointer;
> > }
>
> _______________________________________________
> Qgis-community-team mailing list
> Qgis-community-team at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-community-team

Regards,

-- 
Tim Sutton, Linfiniti Consulting
==============================================
* QGIS Project Steering Committee Member (Release  Manager)
* Visit http://linfiniti.com for more information 
   about the QGIS and FOSS services we provide.
* Skype: timlinux Irc: timlinux on #qgis at freenode.net
==============================================

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.osgeo.org/pipermail/qgis-community-team/attachments/20090213/e3d1e46a/attachment.bin


More information about the Qgis-community-team mailing list