diff --git a/CMakeLists.txt b/CMakeLists.txt index 46919193..ab947c34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) ####### DEPENDENCIES ####### FIND_PACKAGE(OpenCV REQUIRED) # tested on 2.3.1 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 ####### OPTION(BUILD_AS_BUNDLE "Set to ON to build as bundle (DragNDrop)" OFF) diff --git a/imagesTcpServer/ImagesTcpServer.h b/imagesTcpServer/ImagesTcpServer.h index 98e21b8f..647c7142 100644 --- a/imagesTcpServer/ImagesTcpServer.h +++ b/imagesTcpServer/ImagesTcpServer.h @@ -22,7 +22,7 @@ public: quint16 getPort() const; -private slots: +private Q_SLOTS: void addClient(); void publishImage(const cv::Mat & image); diff --git a/src/AddObjectDialog.h b/src/AddObjectDialog.h index d81b9653..28a019ec 100644 --- a/src/AddObjectDialog.h +++ b/src/AddObjectDialog.h @@ -28,7 +28,7 @@ public: // ownership transferred to caller ObjWidget * retrieveObject() {ObjWidget * obj = object_; object_=0; return obj;} -private slots: +private Q_SLOTS: void update(const cv::Mat &); void next(); void back(); diff --git a/src/Camera.cpp b/src/Camera.cpp index 93e9f20a..344f1a3a 100644 --- a/src/Camera.cpp +++ b/src/Camera.cpp @@ -188,15 +188,15 @@ void Camera::takeImage() { cv::Mat resampled; cv::resize(img, resampled, cv::Size(Settings::getCamera_2imageWidth(), Settings::getCamera_3imageHeight())); - emit imageReceived(resampled); + Q_EMIT imageReceived(resampled); } else if(capture_.isOpened()) { - emit imageReceived(img.clone()); // clone required with VideoCapture::read() + Q_EMIT imageReceived(img.clone()); // clone required with VideoCapture::read() } else { - emit imageReceived(img); // clone not required with cv::imread() + Q_EMIT imageReceived(img); // clone not required with cv::imread() } } } diff --git a/src/Camera.h b/src/Camera.h index b578f20a..b99347ad 100644 --- a/src/Camera.h +++ b/src/Camera.h @@ -19,7 +19,7 @@ public: cv::Mat getImage(); bool isConnected() const {return connected_;} -private slots: +private Q_SLOTS: void readReceivedData(); void displayError(QAbstractSocket::SocketError socketError); void connectionLost(); @@ -45,10 +45,10 @@ public: int getCurrentFrameIndex(); void moveToFrame(int frame); -signals: +Q_SIGNALS: void imageReceived(const cv::Mat & image); -public slots: +public Q_SLOTS: virtual void updateImageRate(); virtual void takeImage(); diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 871a41d2..594ea11a 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -1756,7 +1756,7 @@ void MainWindow::update(const cv::Mat & image) if(objectsDetected.size() > 0 || Settings::getGeneral_sendNoObjDetectedEvents()) { - emit objectsFound(objectsDetected); + Q_EMIT objectsFound(objectsDetected); } ui_->label_objectsDetected->setNum(objectsDetected.size()); } diff --git a/src/MainWindow.h b/src/MainWindow.h index 05371ad5..b4b65826 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -49,12 +49,12 @@ public: protected: virtual void closeEvent(QCloseEvent * event); -public slots: +public Q_SLOTS: void startProcessing(); void stopProcessing(); void pauseProcessing(); -private slots: +private Q_SLOTS: void loadSettings(); void saveSettings(); void loadObjects(); @@ -76,7 +76,7 @@ private slots: void moveCameraFrame(int frame); void rectHovered(int objId); -signals: +Q_SIGNALS: void objectsFound(const QMultiMap > &); private: diff --git a/src/ObjWidget.cpp b/src/ObjWidget.cpp index c88d84fd..bbb10c7f 100644 --- a/src/ObjWidget.cpp +++ b/src/ObjWidget.cpp @@ -597,7 +597,7 @@ void ObjWidget::mouseReleaseEvent(QMouseEvent * event) 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); } @@ -640,7 +640,7 @@ void ObjWidget::contextMenuEvent(QContextMenuEvent * event) } else if(action == delete_) { - emit removalTriggered(this); + Q_EMIT removalTriggered(this); } else if(action == graphicsViewMode_) { diff --git a/src/ObjWidget.h b/src/ObjWidget.h index a423bef0..2b4734df 100644 --- a/src/ObjWidget.h +++ b/src/ObjWidget.h @@ -85,7 +85,7 @@ protected: virtual void mouseMoveEvent(QMouseEvent * event); virtual void mouseReleaseEvent(QMouseEvent * event); -signals: +Q_SIGNALS: void removalTriggered(ObjWidget *); void selectionChanged(); void roiChanged(const QRect &); diff --git a/src/ParametersToolBox.cpp b/src/ParametersToolBox.cpp index 72884908..a44df3ae 100644 --- a/src/ParametersToolBox.cpp +++ b/src/ParametersToolBox.cpp @@ -94,7 +94,7 @@ void ParametersToolBox::resetCurrentPage() this->blockSignals(true); QStringList paramChanged = this->resetPage(this->currentIndex()); this->blockSignals(false); - emit parametersChanged(paramChanged); + Q_EMIT parametersChanged(paramChanged); } void ParametersToolBox::resetAllPages() @@ -106,7 +106,7 @@ void ParametersToolBox::resetAllPages() paramChanged.append(this->resetPage(i)); } this->blockSignals(false); - emit parametersChanged(paramChanged); + Q_EMIT parametersChanged(paramChanged); } void ParametersToolBox::updateParametersVisibility() @@ -407,7 +407,7 @@ void ParametersToolBox::changeParameter(const QString & value) Settings::setParameter(sender()->objectName(), value); QStringList paramChanged; paramChanged.append(sender()->objectName()); - emit parametersChanged(paramChanged); + Q_EMIT parametersChanged(paramChanged); } } void ParametersToolBox::changeParameter() @@ -442,7 +442,7 @@ void ParametersToolBox::changeParameter() } QStringList paramChanged; 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()); - emit parametersChanged(paramChanged); + Q_EMIT parametersChanged(paramChanged); } } diff --git a/src/ParametersToolBox.h b/src/ParametersToolBox.h index a23caa38..92d05c2b 100644 --- a/src/ParametersToolBox.h +++ b/src/ParametersToolBox.h @@ -30,10 +30,10 @@ private: void addParameter(QVBoxLayout * layout, const QString & key, const bool & value); void addParameter(QVBoxLayout * layout, const QString & name, QWidget * widget); -signals: +Q_SIGNALS: void parametersChanged(const QStringList & name); -private slots: +private Q_SLOTS: void changeParameter(); void changeParameter(const QString & value); void changeParameter(const int & value); diff --git a/src/RectItem.cpp b/src/RectItem.cpp index 5638f0ff..e9dd1a65 100644 --- a/src/RectItem.cpp +++ b/src/RectItem.cpp @@ -59,7 +59,7 @@ void RectItem::showDescription() placeHolder_->setPos(0,0); placeHolder_->setVisible(true); - emit hovered(id_); + Q_EMIT hovered(id_); } } diff --git a/src/RectItem.h b/src/RectItem.h index d1798edb..53e6d125 100644 --- a/src/RectItem.h +++ b/src/RectItem.h @@ -21,7 +21,7 @@ public: void setColor(const QColor & color); int id() const {return id_;} -signals: +Q_SIGNALS: void hovered(int); protected: diff --git a/src/TcpServer.h b/src/TcpServer.h index 487515ab..06dc48fe 100644 --- a/src/TcpServer.h +++ b/src/TcpServer.h @@ -23,7 +23,7 @@ public: quint16 getPort() const; -private slots: +private Q_SLOTS: void addClient(); void publishObjects(const QMultiMap > & objects); }; diff --git a/src/rtabmap/PdfPlot.cpp b/src/rtabmap/PdfPlot.cpp index 578382b3..7b01ad28 100644 --- a/src/rtabmap/PdfPlot.cpp +++ b/src/rtabmap/PdfPlot.cpp @@ -156,7 +156,7 @@ void PdfPlotCurve::setData(const QMap & dataMap, const QMapupdateMinMax(); - emit dataChanged(this); + Q_EMIT dataChanged(this); } } diff --git a/src/utilite/UPlot.cpp b/src/utilite/UPlot.cpp index bd6e8a55..1e43f982 100644 --- a/src/utilite/UPlot.cpp +++ b/src/utilite/UPlot.cpp @@ -419,7 +419,7 @@ void UPlotCurve::addValue(UPlotItem * data) if(data) { this->_addValue(data); - emit dataChanged(this); + Q_EMIT dataChanged(this); } } @@ -464,7 +464,7 @@ void UPlotCurve::addValues(QVector & data) { this->_addValue(data.at(i)); } - emit dataChanged(this); + Q_EMIT dataChanged(this); } void UPlotCurve::addValues(const QVector & xs, const QVector & ys) @@ -474,7 +474,7 @@ void UPlotCurve::addValues(const QVector & xs, const QVector & ys) { this->_addValue(new UPlotItem(xs.at(i),ys.at(i),width)); } - emit dataChanged(this); + Q_EMIT dataChanged(this); } void UPlotCurve::addValues(const QVector & ys) @@ -494,7 +494,7 @@ void UPlotCurve::addValues(const QVector & ys) } this->_addValue(new UPlotItem(x,ys.at(i),width)); } - emit dataChanged(this); + Q_EMIT dataChanged(this); } void UPlotCurve::addValues(const QVector & ys) @@ -514,7 +514,7 @@ void UPlotCurve::addValues(const QVector & ys) } this->_addValue(new UPlotItem(x,ys.at(i),width)); } - emit dataChanged(this); + Q_EMIT dataChanged(this); } void UPlotCurve::addValues(const std::vector & ys) @@ -534,7 +534,7 @@ void UPlotCurve::addValues(const std::vector & ys) } this->_addValue(new UPlotItem(x,ys.at(i),width)); } - emit dataChanged(this); + Q_EMIT dataChanged(this); } void UPlotCurve::addValues(const std::vector & ys) @@ -554,7 +554,7 @@ void UPlotCurve::addValues(const std::vector & ys) } this->_addValue(new UPlotItem(x,ys.at(i),width)); } - emit dataChanged(this); + Q_EMIT dataChanged(this); } int UPlotCurve::removeItem(int index) @@ -846,7 +846,7 @@ void UPlotCurve::setData(const QVector & x, const QVector & y) //reset minMax, this will force the plot to update the axes this->updateMinMax(); - emit dataChanged(this); + Q_EMIT dataChanged(this); } else { @@ -883,7 +883,7 @@ void UPlotCurve::setData(const std::vector & x, const std::vector //reset minMax, this will force the plot to update the axes this->updateMinMax(); - emit dataChanged(this); + Q_EMIT dataChanged(this); } else { @@ -923,7 +923,7 @@ void UPlotCurve::setData(const std::vector & y) //reset minMax, this will force the plot to update the axes this->updateMinMax(); - emit dataChanged(this); + Q_EMIT dataChanged(this); } void UPlotCurve::getData(QVector & x, QVector & y) const @@ -1309,7 +1309,7 @@ void UPlotLegendItem::contextMenuEvent(QContextMenuEvent * event) } else if(action == _aRemoveCurve) { - emit legendItemRemoved(_curve); + Q_EMIT legendItemRemoved(_curve); } else if (action == _aCopyToClipboard) { @@ -1436,7 +1436,7 @@ void UPlotLegend::removeLegendItem(const UPlotCurve * 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(sender()); if(item) { - emit legendItemToggled(item->curve(), _flat?!toggled:toggled); + Q_EMIT legendItemToggled(item->curve(), _flat?!toggled:toggled); } } } diff --git a/src/utilite/UPlot.h b/src/utilite/UPlot.h index 555c12ef..ced25e42 100644 --- a/src/utilite/UPlot.h +++ b/src/utilite/UPlot.h @@ -142,7 +142,7 @@ public: void getData(QVector & x, QVector & y) const; // only call in Qt MainThread void draw(QPainter * painter); -public slots: +public Q_SLOTS: /** * * Clear curve's values. @@ -212,7 +212,7 @@ public slots: void addValues(const std::vector & ys); // for convenience void addValues(const std::vector & ys); // for convenience -signals: +Q_SIGNALS: /** * * emitted when data is changed. @@ -261,7 +261,7 @@ public: UPlotCurveThreshold(const QString & name, float thesholdValue, Qt::Orientation orientation = Qt::Horizontal, QObject * parent = 0); virtual ~UPlotCurveThreshold(); -public slots: +public Q_SLOTS: /** * Set threshold value. */ @@ -345,7 +345,7 @@ public: virtual ~UPlotLegendItem(); const UPlotCurve * curve() const {return _curve;} -signals: +Q_SIGNALS: void legendItemRemoved(const UPlotCurve *); protected: @@ -380,17 +380,17 @@ public: QPixmap createSymbol(const QPen & pen, const QBrush & brush); bool remove(const UPlotCurve * curve); -public slots: +public Q_SLOTS: void removeLegendItem(const UPlotCurve * curve); -signals: +Q_SIGNALS: void legendItemRemoved(const UPlotCurve * curve); void legendItemToggled(const UPlotCurve * curve, bool toggled); protected: virtual void contextMenuEvent(QContextMenuEvent * event); -private slots: +private Q_SLOTS: void redirectToggled(bool); private: @@ -508,7 +508,7 @@ public: void setGraphicsView(bool on); QRectF sceneRect() const; -public slots: +public Q_SLOTS: /** * * Remove a curve. If UPlot is the parent of the curve, the curve is deleted. @@ -522,7 +522,7 @@ public slots: */ void clearData(); -private slots: +private Q_SLOTS: void captureScreen(); void updateAxis(const UPlotCurve * curve); diff --git a/tcpClient/TcpClient.h b/tcpClient/TcpClient.h index 018d1c1f..72adce16 100644 --- a/tcpClient/TcpClient.h +++ b/tcpClient/TcpClient.h @@ -16,7 +16,7 @@ class TcpClient : public QTcpSocket public: TcpClient(const QString & hostname, quint16 port, QObject * parent = 0); -private slots: +private Q_SLOTS: void readReceivedData(); void displayError(QAbstractSocket::SocketError socketError); void connectionLost();