[SOLVED]not found slots but the slots thera are!!
-
Hi all,
I have a problem because I use the Location api for found latitude and longitude, this is my constructor:@
GeoLocalizzazione::GeoLocalizzazione()
{
_updateArrived = false;
_locationInfo = QGeoPositionInfoSource::createDefaultSource(this);
qDebug() << "Metodi supportati: " << (int)(_locationInfo->supportedPositioningMethods());
_locationInfo->setPreferredPositioningMethods(QGeoPositionInfoSource::AllPositioningMethods);
QObject::connect(_locationInfo, SIGNAL(positionUpdated(QGeoPositionInfo)), this, SLOT(positionUpdated(QGeoPositionInfo)));
QObject::connect(_locationInfo, SIGNAL(updateTimeout()), this, SLOT(updateTimeout()));
//_locationInfo->setUpdateInterval(1000);
_locationInfo->requestUpdate(5000);
_locationInfo->startUpdates();
qDebug() << "requestUpdates";
QTimer::singleShot(30000, this, SLOT(timerExpired()));
}@the log of debug are this:
@Object::connect: No such slot QWidget::positionUpdated(QGeoPositionInfo) in ..\GamberoRosso\GeoLocalizzazione\geolocalizzazione.cpp:12
Object::connect: No such slot QWidget::updateTimeout() in ..\GamberoRosso\GeoLocalizzazione\geolocalizzazione.cpp:13
requestUpdates
Object::connect: No such slot QWidget::timerExpired() in ..\GamberoRosso\GeoLocalizzazione\geolocalizzazione.cpp:18@but this is my h file:
@
QTM_USE_NAMESPACE;namespace Ui {
class GeoLocalizzazione;
}class GeoLocalizzazione : public QWidget
{public:
GeoLocalizzazione();private:
//DICHIARAZIONE VARIABILI QString globalNavigation; QGeoPositionInfoSource* _locationInfo; bool _updateArrived;
protected slots:
void timerExpired(); void updateTimeout(); void positionUpdated(QGeoPositionInfo geoPositionInfo);
};
@why not get the slots?
-
You may want to add the Q_OBJECT macro in your class definition.
@
class GeoLocalizzazione : public QWidget
{
Q_OBJECTpublic:
GeoLocalizzazione();private:
//DICHIARAZIONE VARIABILI QString globalNavigation; QGeoPositionInfoSource* _locationInfo; bool _updateArrived;
protected slots:
void timerExpired(); void updateTimeout(); void positionUpdated(QGeoPositionInfo geoPositionInfo);
};
@
[edit] a couple of seconds late :-(