Hi.
When I compile my application compiler says that it can't find two public slots.
Object
::connect: No such
slot QWidget::geometryClicked(Geometry
*,
QPoint) in src
/mwnd.
cpp:28
Object::connect: No such slot QWidget::geometryClicked(Geometry*,QPoint) in src/mwnd.cpp:28
Object::connect: No such slot QWidget::mouseEventCoordinate(QMouseEvent*,QPointF) in src/mwnd.cpp:46
To copy to clipboard, switch view to plain text mode
All the slots are defined in header and are writed in cpp file.
This is the part of code where I connect SIGNAL in mc and l and SLOT in mwnd.
mc = new MapControl( mapMcSize );
mapadapter = new TileMapAdapter("robots.local", "/maps/maps/%1/%2/%3.png", 256, 0, 17);
l = new MapLayer("Custom Layer", mapadapter);
mc->addLayer(l);
mc = new MapControl( mapMcSize );
mapadapter = new TileMapAdapter("robots.local", "/maps/maps/%1/%2/%3.png", 256, 0, 17);
l = new MapLayer("Custom Layer", mapadapter);
mc->addLayer(l);
To copy to clipboard, switch view to plain text mode
27 - 28
connect(l,
SIGNAL( geometryClicked
(Geometry
*,
QPoint) ),
this,
SLOT( geometryClicked
(Geometry
*,
QPoint) ));
connect(l, SIGNAL( geometryClicked(Geometry*,QPoint) ),
this, SLOT( geometryClicked(Geometry*,QPoint) ));
To copy to clipboard, switch view to plain text mode
45-46
connect(mc,SIGNAL(mouseEventCoordinate(const QMouseEvent*,QPointF)),
this, SLOT(mouseEventCoordinate(QMouseEvent*,QPointF)));
To copy to clipboard, switch view to plain text mode
Header:
public slots:
void geometryClicked
(Geometry
* geom,
QPoint coord_px
);
public slots:
void geometryClicked(Geometry* geom, QPoint coord_px);
void mouseEventCoordinate(QMouseEvent* event,QPointF point);
To copy to clipboard, switch view to plain text mode
CPP:
void mwnd
::geometryClicked(Geometry
*geom,
QPoint) {
if (geom->hasClickedPoints())
{
QList<Geometry*> pp = geom->clickedPoints();
for (int i=0; i<pp.size(); i++)
{
QMessageBox::information(this, geom
->name
(), pp.
at(i
)->name
());
}
}
else if (geom->GeometryType == "Point")
{
QMessageBox::information(this, geom
->name
(),
"just a point");
}
}
{
event->accept();
}
void mwnd::geometryClicked(Geometry *geom, QPoint)
{
if (geom->hasClickedPoints())
{
QList<Geometry*> pp = geom->clickedPoints();
for (int i=0; i<pp.size(); i++)
{
QMessageBox::information(this, geom->name(), pp.at(i)->name());
}
}
else if (geom->GeometryType == "Point")
{
QMessageBox::information(this, geom->name(), "just a point");
}
}
void mwnd::mouseEventCoordinate(QMouseEvent *event,QPointF point)
{
QMessageBox::information(this, "Test", QString("%1 : %2").arg(point.x()).arg(point.y()));
event->accept();
}
To copy to clipboard, switch view to plain text mode
What's I does wrong? Where is my mistake?
(Sorry for bad english)
PS I used qmapcontrol http://www.medieninf.de/qmapcontrol/
Bookmarks