0

I have a qgis plugin (c++) that adds a map tool inherits from QgsMapTool. My tool does nothing, juste I can activate my tool by triggering. I test my plugin in Qgis 2.4; when I activate my tool the I passed to another tool Qgis crash and write a minimum dump file.

Dump File: qgis-20140915-111427-2760-1564-8fdd08a.dmp : C:\Users\Admin\AppData\Local\Temp\qgis-20140915-111427-2760-1564-8fdd08a.dmp Last Write Time: 15/09/2014 11:14:28 Process Name: qgis-bin.exe : C:\Program Files (x86)\QGIS Chugiak\bin\qgis-bin.exe Process Architecture: x86 Exception Code: 0xC0000005 Exception Information: The thread tried to read from or write to a virtual address for which it does not have the appropriate access. Heap Information: Not Present

System Information

OS Version: 6.1.7601 CLR Version(s):

Modules

Module Name Module Path Module Version


qgis-bin.exe C:\Program Files (x86)\QGIS Chugiak\bin\qgis-bin.exe 0.0.0.0 ntdll.dll C:\Windows\SysWOW64\ntdll.dll 6.1.7601.18247 ....

this is the C++ code:

MapToolAdvancedEditPolygons::MapToolAdvancedEditPolygons( QgisInterface *ptInterface )
    : QgsMapTool( ptInterface->mapCanvas () )
    , m_ptInterface ( ptInterface )
{
}

MapToolAdvancedEditPolygons::~MapToolAdvancedEditPolygons()
{
}

I initialised my plugin as below:

void GeoAdvancedEditTool::initGui ()
{
 m_ptAdvancedEditAction = new QAction ( QIcon ( ":/geoadvancededittool/images/AdvancedEditAction.png" ), tr ( "advanced edit polygons tool" ), this);
 m_ptAdvancedEditAction->setCheckable ( true );
 m_ptAdvancedEditAction->setActionGroup ( m_ptInterface->actionMoveFeature()->actionGroup() );
 m_ptInterface->digitizeToolBar()->addAction ( m_ptAdvancedEditAction );

 connect( m_ptAdvancedEditAction, SIGNAL( triggered() ), this, SLOT( advancedEditActivated() ) );

 m_ptMapToolAdvancedEditPolygons = new MapToolAdvancedEditPolygons( m_ptInterface );
 m_ptMapToolAdvancedEditPolygons->setObjectName( "GEOAdvancedEditPolygonsTool" );
 m_ptMapToolAdvancedEditPolygons->setAction( m_ptAdvancedEditAction );
 m_ptAdvancedEditAction->setEnabled(true);
}

void GeoAdvancedEditTool::advancedEditActivated()
{
 m_ptInterface->mapCanvas()->setMapTool( m_ptMapToolAdvancedEditPolygons );
 m_ptInterface->mapCanvas()->setCursor( QCursor( Qt::CrossCursor ) );
}

I don't understand why Qgis crash!

-1

Problem solved, I must use Qgis libraries shipped with OSGeo4W.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.