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 #######
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)

View File

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

View File

@ -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();

View File

@ -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()
}
}
}

View File

@ -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();

View File

@ -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());
}

View File

@ -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<int, QPair<QRect, QTransform> > &);
private:

View File

@ -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_)
{

View File

@ -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 &);

View File

@ -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);
}
}

View File

@ -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);

View File

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

View File

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

View File

@ -23,7 +23,7 @@ public:
quint16 getPort() const;
private slots:
private Q_SLOTS:
void addClient();
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
this->updateMinMax();
emit dataChanged(this);
Q_EMIT dataChanged(this);
}
}

View File

@ -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<UPlotItem *> & data)
{
this->_addValue(data.at(i));
}
emit dataChanged(this);
Q_EMIT dataChanged(this);
}
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));
}
emit dataChanged(this);
Q_EMIT dataChanged(this);
}
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));
}
emit dataChanged(this);
Q_EMIT dataChanged(this);
}
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));
}
emit dataChanged(this);
Q_EMIT dataChanged(this);
}
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));
}
emit dataChanged(this);
Q_EMIT dataChanged(this);
}
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));
}
emit dataChanged(this);
Q_EMIT dataChanged(this);
}
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
this->updateMinMax();
emit dataChanged(this);
Q_EMIT dataChanged(this);
}
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
this->updateMinMax();
emit dataChanged(this);
Q_EMIT dataChanged(this);
}
else
{
@ -923,7 +923,7 @@ void UPlotCurve::setData(const std::vector<float> & 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<float> & x, QVector<float> & 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<UPlotLegendItem*>(sender());
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 draw(QPainter * painter);
public slots:
public Q_SLOTS:
/**
*
* Clear curve's values.
@ -212,7 +212,7 @@ public slots:
void addValues(const std::vector<float> & ys); // for convenience
void addValues(const std::vector<int> & 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);

View File

@ -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();