Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Can't emit signal in android.
Forum Updated to NodeBB v4.3 + New Features

Can't emit signal in android.

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 2 Posters 2.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bmeric
    wrote on last edited by
    #1

    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); //cv::mat removed
    };
    
    #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);//cv::mat removed
        public slots:
            void requestImage();
            void setFrame(int frameID);
            void loadImage(QString fileName);
        }
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Do you get any warning related to that function when building for Windows ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      B 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Do you get any warning related to that function when building for Windows ?

        B Offline
        B Offline
        bmeric
        wrote on last edited by
        #3

        @SGaist said:

        Hi and welcome to devnet,

        Do you get any warning related to that function when building for Windows ?

        Hi, thanks :)

        No, i get no warning with -Wall.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I meant on stdout when running your application. Which connection syntax are you using ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bmeric
            wrote on last edited by
            #5

            Nope, i get nothing on stdout.

            I connect signal/slot like this;

            QObject::connect(this->rManager.imreader, SIGNAL(sendImage(QImage&)), this, SLOT(sendImage(QImage&)) );
            

            I also tried new syntax but nothing changed :/

            connect(this->rManager.imreader, &imageReader::sendImage, this, &MainWindow::sendImage );
            
            1 Reply Last reply
            0
            • B Offline
              B Offline
              bmeric
              wrote on last edited by
              #6

              Hi,

              I opened an issue in bugreports.qt.io, you can find details in there.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                To sum up what happened is that you were trying to send a reference to a temporary object thus it failed

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                B 1 Reply Last reply
                0
                • SGaistS SGaist

                  To sum up what happened is that you were trying to send a reference to a temporary object thus it failed

                  B Offline
                  B Offline
                  bmeric
                  wrote on last edited by bmeric
                  #8

                  @SGaist

                  Yes, basically; "emit signal( Object() );" works with Visual C++(and iirc Intel) but not with GCC.

                  And for the Mingw; it was my mistake :)(sorry about that), when i tested my codebase with it, i didn't use "signal( Object() )" but didn't realize i didn't tested with final codebase(sometimes Qt Creator does not build with final changes-especially with qml- unless clean/rebuild)

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved