Added QT_NO_KEYWORDS build compilation to avoid conflicts with boost signals used in the ROS package

git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@347 620bd6b2-0a58-f614-fd9a-1bd335dccda9
This commit is contained in:
matlabbe 2014-07-08 19:55:03 +00:00
parent 3c36e088d7
commit 488c5865fe
18 changed files with 50 additions and 49 deletions

View File

@ -42,6 +42,7 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
####### DEPENDENCIES ####### ####### DEPENDENCIES #######
FIND_PACKAGE(OpenCV REQUIRED) # tested on 2.3.1 FIND_PACKAGE(OpenCV REQUIRED) # tested on 2.3.1
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtNetwork) # tested on Qt4.7 FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtNetwork) # tested on Qt4.7
ADD_DEFINITIONS(-DQT_NO_KEYWORDS) # To avoid conflicts with boost signals used in ROS
####### OSX BUNDLE CMAKE_INSTALL_PREFIX ####### ####### OSX BUNDLE CMAKE_INSTALL_PREFIX #######
OPTION(BUILD_AS_BUNDLE "Set to ON to build as bundle (DragNDrop)" OFF) OPTION(BUILD_AS_BUNDLE "Set to ON to build as bundle (DragNDrop)" OFF)

View File

@ -22,7 +22,7 @@ public:
quint16 getPort() const; quint16 getPort() const;
private slots: private Q_SLOTS:
void addClient(); void addClient();
void publishImage(const cv::Mat & image); void publishImage(const cv::Mat & image);

View File

@ -28,7 +28,7 @@ public:
// ownership transferred to caller // ownership transferred to caller
ObjWidget * retrieveObject() {ObjWidget * obj = object_; object_=0; return obj;} ObjWidget * retrieveObject() {ObjWidget * obj = object_; object_=0; return obj;}
private slots: private Q_SLOTS:
void update(const cv::Mat &); void update(const cv::Mat &);
void next(); void next();
void back(); void back();

View File

@ -188,15 +188,15 @@ void Camera::takeImage()
{ {
cv::Mat resampled; cv::Mat resampled;
cv::resize(img, resampled, cv::Size(Settings::getCamera_2imageWidth(), Settings::getCamera_3imageHeight())); cv::resize(img, resampled, cv::Size(Settings::getCamera_2imageWidth(), Settings::getCamera_3imageHeight()));
emit imageReceived(resampled); Q_EMIT imageReceived(resampled);
} }
else if(capture_.isOpened()) else if(capture_.isOpened())
{ {
emit imageReceived(img.clone()); // clone required with VideoCapture::read() Q_EMIT imageReceived(img.clone()); // clone required with VideoCapture::read()
} }
else else
{ {
emit imageReceived(img); // clone not required with cv::imread() Q_EMIT imageReceived(img); // clone not required with cv::imread()
} }
} }
} }

View File

@ -19,7 +19,7 @@ public:
cv::Mat getImage(); cv::Mat getImage();
bool isConnected() const {return connected_;} bool isConnected() const {return connected_;}
private slots: private Q_SLOTS:
void readReceivedData(); void readReceivedData();
void displayError(QAbstractSocket::SocketError socketError); void displayError(QAbstractSocket::SocketError socketError);
void connectionLost(); void connectionLost();
@ -45,10 +45,10 @@ public:
int getCurrentFrameIndex(); int getCurrentFrameIndex();
void moveToFrame(int frame); void moveToFrame(int frame);
signals: Q_SIGNALS:
void imageReceived(const cv::Mat & image); void imageReceived(const cv::Mat & image);
public slots: public Q_SLOTS:
virtual void updateImageRate(); virtual void updateImageRate();
virtual void takeImage(); virtual void takeImage();

View File

@ -1756,7 +1756,7 @@ void MainWindow::update(const cv::Mat & image)
if(objectsDetected.size() > 0 || Settings::getGeneral_sendNoObjDetectedEvents()) if(objectsDetected.size() > 0 || Settings::getGeneral_sendNoObjDetectedEvents())
{ {
emit objectsFound(objectsDetected); Q_EMIT objectsFound(objectsDetected);
} }
ui_->label_objectsDetected->setNum(objectsDetected.size()); ui_->label_objectsDetected->setNum(objectsDetected.size());
} }

View File

@ -49,12 +49,12 @@ public:
protected: protected:
virtual void closeEvent(QCloseEvent * event); virtual void closeEvent(QCloseEvent * event);
public slots: public Q_SLOTS:
void startProcessing(); void startProcessing();
void stopProcessing(); void stopProcessing();
void pauseProcessing(); void pauseProcessing();
private slots: private Q_SLOTS:
void loadSettings(); void loadSettings();
void saveSettings(); void saveSettings();
void loadObjects(); void loadObjects();
@ -76,7 +76,7 @@ private slots:
void moveCameraFrame(int frame); void moveCameraFrame(int frame);
void rectHovered(int objId); void rectHovered(int objId);
signals: Q_SIGNALS:
void objectsFound(const QMultiMap<int, QPair<QRect, QTransform> > &); void objectsFound(const QMultiMap<int, QPair<QRect, QTransform> > &);
private: private:

View File

@ -597,7 +597,7 @@ void ObjWidget::mouseReleaseEvent(QMouseEvent * event)
right = qAbs(l - pixmap_.width()); right = qAbs(l - pixmap_.width());
} }
emit roiChanged(QRect(left, top, right-left, bottom-top)); Q_EMIT roiChanged(QRect(left, top, right-left, bottom-top));
} }
QWidget::mouseReleaseEvent(event); QWidget::mouseReleaseEvent(event);
} }
@ -640,7 +640,7 @@ void ObjWidget::contextMenuEvent(QContextMenuEvent * event)
} }
else if(action == delete_) else if(action == delete_)
{ {
emit removalTriggered(this); Q_EMIT removalTriggered(this);
} }
else if(action == graphicsViewMode_) else if(action == graphicsViewMode_)
{ {

View File

@ -85,7 +85,7 @@ protected:
virtual void mouseMoveEvent(QMouseEvent * event); virtual void mouseMoveEvent(QMouseEvent * event);
virtual void mouseReleaseEvent(QMouseEvent * event); virtual void mouseReleaseEvent(QMouseEvent * event);
signals: Q_SIGNALS:
void removalTriggered(ObjWidget *); void removalTriggered(ObjWidget *);
void selectionChanged(); void selectionChanged();
void roiChanged(const QRect &); void roiChanged(const QRect &);

View File

@ -94,7 +94,7 @@ void ParametersToolBox::resetCurrentPage()
this->blockSignals(true); this->blockSignals(true);
QStringList paramChanged = this->resetPage(this->currentIndex()); QStringList paramChanged = this->resetPage(this->currentIndex());
this->blockSignals(false); this->blockSignals(false);
emit parametersChanged(paramChanged); Q_EMIT parametersChanged(paramChanged);
} }
void ParametersToolBox::resetAllPages() void ParametersToolBox::resetAllPages()
@ -106,7 +106,7 @@ void ParametersToolBox::resetAllPages()
paramChanged.append(this->resetPage(i)); paramChanged.append(this->resetPage(i));
} }
this->blockSignals(false); this->blockSignals(false);
emit parametersChanged(paramChanged); Q_EMIT parametersChanged(paramChanged);
} }
void ParametersToolBox::updateParametersVisibility() void ParametersToolBox::updateParametersVisibility()
@ -407,7 +407,7 @@ void ParametersToolBox::changeParameter(const QString & value)
Settings::setParameter(sender()->objectName(), value); Settings::setParameter(sender()->objectName(), value);
QStringList paramChanged; QStringList paramChanged;
paramChanged.append(sender()->objectName()); paramChanged.append(sender()->objectName());
emit parametersChanged(paramChanged); Q_EMIT parametersChanged(paramChanged);
} }
} }
void ParametersToolBox::changeParameter() void ParametersToolBox::changeParameter()
@ -442,7 +442,7 @@ void ParametersToolBox::changeParameter()
} }
QStringList paramChanged; QStringList paramChanged;
paramChanged.append(sender()->objectName()); paramChanged.append(sender()->objectName());
emit parametersChanged(paramChanged); Q_EMIT parametersChanged(paramChanged);
} }
} }
@ -573,6 +573,6 @@ void ParametersToolBox::changeParameter(const int & value)
} }
paramChanged.append(sender()->objectName()); paramChanged.append(sender()->objectName());
emit parametersChanged(paramChanged); Q_EMIT parametersChanged(paramChanged);
} }
} }

View File

@ -30,10 +30,10 @@ private:
void addParameter(QVBoxLayout * layout, const QString & key, const bool & value); void addParameter(QVBoxLayout * layout, const QString & key, const bool & value);
void addParameter(QVBoxLayout * layout, const QString & name, QWidget * widget); void addParameter(QVBoxLayout * layout, const QString & name, QWidget * widget);
signals: Q_SIGNALS:
void parametersChanged(const QStringList & name); void parametersChanged(const QStringList & name);
private slots: private Q_SLOTS:
void changeParameter(); void changeParameter();
void changeParameter(const QString & value); void changeParameter(const QString & value);
void changeParameter(const int & value); void changeParameter(const int & value);

View File

@ -59,7 +59,7 @@ void RectItem::showDescription()
placeHolder_->setPos(0,0); placeHolder_->setPos(0,0);
placeHolder_->setVisible(true); placeHolder_->setVisible(true);
emit hovered(id_); Q_EMIT hovered(id_);
} }
} }

View File

@ -21,7 +21,7 @@ public:
void setColor(const QColor & color); void setColor(const QColor & color);
int id() const {return id_;} int id() const {return id_;}
signals: Q_SIGNALS:
void hovered(int); void hovered(int);
protected: protected:

View File

@ -23,7 +23,7 @@ public:
quint16 getPort() const; quint16 getPort() const;
private slots: private Q_SLOTS:
void addClient(); void addClient();
void publishObjects(const QMultiMap<int, QPair<QRect, QTransform> > & objects); void publishObjects(const QMultiMap<int, QPair<QRect, QTransform> > & objects);
}; };

View File

@ -156,7 +156,7 @@ void PdfPlotCurve::setData(const QMap<int, float> & dataMap, const QMap<int, int
//reset minMax, this will force the plot to update the axes //reset minMax, this will force the plot to update the axes
this->updateMinMax(); this->updateMinMax();
emit dataChanged(this); Q_EMIT dataChanged(this);
} }
} }

View File

@ -419,7 +419,7 @@ void UPlotCurve::addValue(UPlotItem * data)
if(data) if(data)
{ {
this->_addValue(data); this->_addValue(data);
emit dataChanged(this); Q_EMIT dataChanged(this);
} }
} }
@ -464,7 +464,7 @@ void UPlotCurve::addValues(QVector<UPlotItem *> & data)
{ {
this->_addValue(data.at(i)); this->_addValue(data.at(i));
} }
emit dataChanged(this); Q_EMIT dataChanged(this);
} }
void UPlotCurve::addValues(const QVector<float> & xs, const QVector<float> & ys) void UPlotCurve::addValues(const QVector<float> & xs, const QVector<float> & ys)
@ -474,7 +474,7 @@ void UPlotCurve::addValues(const QVector<float> & xs, const QVector<float> & ys)
{ {
this->_addValue(new UPlotItem(xs.at(i),ys.at(i),width)); this->_addValue(new UPlotItem(xs.at(i),ys.at(i),width));
} }
emit dataChanged(this); Q_EMIT dataChanged(this);
} }
void UPlotCurve::addValues(const QVector<float> & ys) void UPlotCurve::addValues(const QVector<float> & ys)
@ -494,7 +494,7 @@ void UPlotCurve::addValues(const QVector<float> & ys)
} }
this->_addValue(new UPlotItem(x,ys.at(i),width)); this->_addValue(new UPlotItem(x,ys.at(i),width));
} }
emit dataChanged(this); Q_EMIT dataChanged(this);
} }
void UPlotCurve::addValues(const QVector<int> & ys) void UPlotCurve::addValues(const QVector<int> & ys)
@ -514,7 +514,7 @@ void UPlotCurve::addValues(const QVector<int> & ys)
} }
this->_addValue(new UPlotItem(x,ys.at(i),width)); this->_addValue(new UPlotItem(x,ys.at(i),width));
} }
emit dataChanged(this); Q_EMIT dataChanged(this);
} }
void UPlotCurve::addValues(const std::vector<int> & ys) void UPlotCurve::addValues(const std::vector<int> & ys)
@ -534,7 +534,7 @@ void UPlotCurve::addValues(const std::vector<int> & ys)
} }
this->_addValue(new UPlotItem(x,ys.at(i),width)); this->_addValue(new UPlotItem(x,ys.at(i),width));
} }
emit dataChanged(this); Q_EMIT dataChanged(this);
} }
void UPlotCurve::addValues(const std::vector<float> & ys) void UPlotCurve::addValues(const std::vector<float> & ys)
@ -554,7 +554,7 @@ void UPlotCurve::addValues(const std::vector<float> & ys)
} }
this->_addValue(new UPlotItem(x,ys.at(i),width)); this->_addValue(new UPlotItem(x,ys.at(i),width));
} }
emit dataChanged(this); Q_EMIT dataChanged(this);
} }
int UPlotCurve::removeItem(int index) int UPlotCurve::removeItem(int index)
@ -846,7 +846,7 @@ void UPlotCurve::setData(const QVector<float> & x, const QVector<float> & y)
//reset minMax, this will force the plot to update the axes //reset minMax, this will force the plot to update the axes
this->updateMinMax(); this->updateMinMax();
emit dataChanged(this); Q_EMIT dataChanged(this);
} }
else else
{ {
@ -883,7 +883,7 @@ void UPlotCurve::setData(const std::vector<float> & x, const std::vector<float>
//reset minMax, this will force the plot to update the axes //reset minMax, this will force the plot to update the axes
this->updateMinMax(); this->updateMinMax();
emit dataChanged(this); Q_EMIT dataChanged(this);
} }
else else
{ {
@ -923,7 +923,7 @@ void UPlotCurve::setData(const std::vector<float> & y)
//reset minMax, this will force the plot to update the axes //reset minMax, this will force the plot to update the axes
this->updateMinMax(); this->updateMinMax();
emit dataChanged(this); Q_EMIT dataChanged(this);
} }
void UPlotCurve::getData(QVector<float> & x, QVector<float> & y) const void UPlotCurve::getData(QVector<float> & x, QVector<float> & y) const
@ -1309,7 +1309,7 @@ void UPlotLegendItem::contextMenuEvent(QContextMenuEvent * event)
} }
else if(action == _aRemoveCurve) else if(action == _aRemoveCurve)
{ {
emit legendItemRemoved(_curve); Q_EMIT legendItemRemoved(_curve);
} }
else if (action == _aCopyToClipboard) else if (action == _aCopyToClipboard)
{ {
@ -1436,7 +1436,7 @@ void UPlotLegend::removeLegendItem(const UPlotCurve * curve)
{ {
if(this->remove(curve)) if(this->remove(curve))
{ {
emit legendItemRemoved(curve); Q_EMIT legendItemRemoved(curve);
} }
} }
@ -1456,7 +1456,7 @@ void UPlotLegend::redirectToggled(bool toggled)
UPlotLegendItem * item = qobject_cast<UPlotLegendItem*>(sender()); UPlotLegendItem * item = qobject_cast<UPlotLegendItem*>(sender());
if(item) if(item)
{ {
emit legendItemToggled(item->curve(), _flat?!toggled:toggled); Q_EMIT legendItemToggled(item->curve(), _flat?!toggled:toggled);
} }
} }
} }

View File

@ -142,7 +142,7 @@ public:
void getData(QVector<float> & x, QVector<float> & y) const; // only call in Qt MainThread void getData(QVector<float> & x, QVector<float> & y) const; // only call in Qt MainThread
void draw(QPainter * painter); void draw(QPainter * painter);
public slots: public Q_SLOTS:
/** /**
* *
* Clear curve's values. * Clear curve's values.
@ -212,7 +212,7 @@ public slots:
void addValues(const std::vector<float> & ys); // for convenience void addValues(const std::vector<float> & ys); // for convenience
void addValues(const std::vector<int> & ys); // for convenience void addValues(const std::vector<int> & ys); // for convenience
signals: Q_SIGNALS:
/** /**
* *
* emitted when data is changed. * emitted when data is changed.
@ -261,7 +261,7 @@ public:
UPlotCurveThreshold(const QString & name, float thesholdValue, Qt::Orientation orientation = Qt::Horizontal, QObject * parent = 0); UPlotCurveThreshold(const QString & name, float thesholdValue, Qt::Orientation orientation = Qt::Horizontal, QObject * parent = 0);
virtual ~UPlotCurveThreshold(); virtual ~UPlotCurveThreshold();
public slots: public Q_SLOTS:
/** /**
* Set threshold value. * Set threshold value.
*/ */
@ -345,7 +345,7 @@ public:
virtual ~UPlotLegendItem(); virtual ~UPlotLegendItem();
const UPlotCurve * curve() const {return _curve;} const UPlotCurve * curve() const {return _curve;}
signals: Q_SIGNALS:
void legendItemRemoved(const UPlotCurve *); void legendItemRemoved(const UPlotCurve *);
protected: protected:
@ -380,17 +380,17 @@ public:
QPixmap createSymbol(const QPen & pen, const QBrush & brush); QPixmap createSymbol(const QPen & pen, const QBrush & brush);
bool remove(const UPlotCurve * curve); bool remove(const UPlotCurve * curve);
public slots: public Q_SLOTS:
void removeLegendItem(const UPlotCurve * curve); void removeLegendItem(const UPlotCurve * curve);
signals: Q_SIGNALS:
void legendItemRemoved(const UPlotCurve * curve); void legendItemRemoved(const UPlotCurve * curve);
void legendItemToggled(const UPlotCurve * curve, bool toggled); void legendItemToggled(const UPlotCurve * curve, bool toggled);
protected: protected:
virtual void contextMenuEvent(QContextMenuEvent * event); virtual void contextMenuEvent(QContextMenuEvent * event);
private slots: private Q_SLOTS:
void redirectToggled(bool); void redirectToggled(bool);
private: private:
@ -508,7 +508,7 @@ public:
void setGraphicsView(bool on); void setGraphicsView(bool on);
QRectF sceneRect() const; QRectF sceneRect() const;
public slots: public Q_SLOTS:
/** /**
* *
* Remove a curve. If UPlot is the parent of the curve, the curve is deleted. * Remove a curve. If UPlot is the parent of the curve, the curve is deleted.
@ -522,7 +522,7 @@ public slots:
*/ */
void clearData(); void clearData();
private slots: private Q_SLOTS:
void captureScreen(); void captureScreen();
void updateAxis(const UPlotCurve * curve); void updateAxis(const UPlotCurve * curve);

View File

@ -16,7 +16,7 @@ class TcpClient : public QTcpSocket
public: public:
TcpClient(const QString & hostname, quint16 port, QObject * parent = 0); TcpClient(const QString & hostname, quint16 port, QObject * parent = 0);
private slots: private Q_SLOTS:
void readReceivedData(); void readReceivedData();
void displayError(QAbstractSocket::SocketError socketError); void displayError(QAbstractSocket::SocketError socketError);
void connectionLost(); void connectionLost();