なぜそれが起こっているのか、私には手がかりがありません。QObject
マクロを拡張して追加しましたQ_OBJECT
。また、シグナルとスロットは両方とも同じパラメーターを持ちます。
元の質問を投稿しました
これは私のhppファイルです:
/*
* LocationMonitor.hpp
*
* Created on: Jul 13, 2013
* Author: Roland
*/
#ifndef LOCATIONMONITOR_HPP_
#define LOCATIONMONITOR_HPP_
#include <QObject>
#include <QtLocationSubset/qgeopositioninfo.h>
#include <QtLocationSubset/qgeoareamonitor.h>
using namespace Qt;
using namespace QtMobilitySubset;
class GeoNotification;
class LocationMonitor : public QObject
{
Q_OBJECT
public:
LocationMonitor(int id,GeoNotification *geoNotification,QVariantList locationList,QVariantList actionList);
virtual ~LocationMonitor();
public slots:
void areaEnteredd(QtMobilitySubset::QGeoPositionInfo info);
void areaExitedd(QtMobilitySubset::QGeoPositionInfo info);
public:
QGeoAreaMonitor *monitor;
};
#endif /* LOCATIONMONITOR_HPP_ */
これは私のcppファイルです
/*
* LocationMonitor.cpp
*
* Created on: Jul 13, 2013
* Author: Roland
*/
#include "LocationMonitor.hpp"
LocationMonitor::LocationMonitor(int id,GeoNotification *geoNotification,QVariantList locationList,QVariantList actionList):
geoNotification(geoNotification)
{
monitor = QGeoAreaMonitor::createDefaultMonitor(this);
QObject::connect(monitor, SIGNAL(areaEntered(QGeoPositionInfo)),this, SLOT(areaEnteredd(QGeoPositionInfo)));
QObject::connect(monitor, SIGNAL(areaExited(QGeoPositionInfo)),this, SLOT(areaExitedd(QGeoPositionInfo)));
}
LocationMonitor::~LocationMonitor() {}
void LocationMonitor::areaEnteredd(QGeoPositionInfo info)
{
}
void LocationMonitor::areaExitedd(QGeoPositionInfo info)
{
}
API ドキュメントのリンクはこちら
ありがとう。