9

I have this signal in my project;

void sendImage(cv::Mat &imgMat, QImage &imgQImage);

Project compiles on both Mingw and Visual Studio but when i try to build for Android, i get "error: no matching function for call to imageReader::sendImage(cv::Mat&, QImage)" error.

I tested my pro file on different project, try clean/run qmake/clean/rebuild, remove cv::Mat from signal but nothing worked.

What can be the problem?

Edit;

#ifndef READERMANAGERQMLINTERFACE_H
#define READERMANAGERQMLINTERFACE_H

#include <QObject>
#include <QDebug>

#include "readermanager.h"
class ReaderManagerQMLInterface : public QObject
{
    Q_OBJECT
public:
    explicit ReaderManagerQMLInterface(QObject *parent = 0);
    ~ReaderManagerQMLInterface();

    readerManager rManager;

private:

signals:
    void reqIm();

public slots:
    void sendImage(QImage &imgQImage);
};

#endif // READERMANAGERQMLINTERFACE_H

imageReader;

#ifndef IMAGEREADER_H
#define IMAGEREADER_H

#include <QObject>
#include <QImage>
#include <QDebug>
#include <QThread>
#include <QDir>
#include <QFile>

#include <opencv/cv.h>
class imageReader : public QObject
    {
        Q_OBJECT
    public:
        explicit imageReader(QObject *parent = 0);
        ~imageReader();
        imgHelpers imHelpers;

    signals:
        void sendImage(QImage &imgQImage);
    public slots:
        void requestImage();
        void setFrame(int frameID);
        void loadImage(QString fileName);
    }

I'm emitting signal like this;(in case my mat2Image function causes the problem, i tried both)

void imageReader::requestImage()
{
    images.at(currentImageID).copyTo(this->currentImage);
    processImage(currentImage);
    emit sendImage(imHelpers.mat2Image(this->currentImage) );
  //emit sendImage(QImage("d:/test.bmp"));
}
10
  • Could you post the complete code of class definition?
    – Tay2510
    Apr 20, 2015 at 7:51
  • @Tay2510; I have updated with definition.
    – bmeric
    Apr 20, 2015 at 7:55
  • I think imageReader is the class you should provide with the code.
    – Tay2510
    Apr 20, 2015 at 8:03
  • @Tay2510; I updated again with imageReader.
    – bmeric
    Apr 20, 2015 at 8:09
  • The compilers said "error: no matching function for call to imageReader::sendImage(cv::Mat&, QImage)" because your signal definition is void sendImage(QImage &imgQImage); You cannot connect to a signal that doesn't even exist.
    – Tay2510
    Apr 20, 2015 at 8:11

1 Answer 1

4

I opened an issue in bugreports.qt.io and looks like problem is related to Visual Studio. You can find details in here.

Edit: When i say "problem is related visual studio" i mean "Visual Studio lead me in the wrong direction", my emit line should give compile error in the first place like gcc.

1
  • 3
    No, as the developers told you in the bug report, the bug is that your signal should have a QImage parameter, not a QImage& parameter. It works in Visual Studio but shouldn't. It doesn't work in gcc which is why you have trouble on Android. Apr 28, 2015 at 3:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.