Qt Signal Slot: A signal is sent, but the slot is not called

I am using Qt in Visual Studio 2013 in C ++. I am trying to connect a signal to a slot. The problem is that the signal is sent, but the slot function is never called, and I do not know what happened. This code worked before, but after I migrated the code from Visual Studio 2012 to 32-bit in Visual Studio 2013 to 64-bit and made some changes, it no longer works. It prints debugging statements: before sending, sending the image and connecting, but it does not print the received image. Can anybody help?

Streamer.h

signals:
    //Signal to output frame to be displayed
    void processedImageStream(const vector<QImage> &imgs, const QImage &image2, const QImage &image3, const QImage &image4);

Streamer.cpp in run () function

qDebug() << "before sending";
emit processedImageStream(imgs,imgIntel, imgIntelDepth, imgIntelIR);
qDebug() << "images sent!";

mainwindow.h

private slots:
    //Display video frame in streamer UI
    void updateStreamerUI(const vector<QImage> &imgs, const QImage &imgIntel, const QImage &imgIntelDepth, const QImage &imgIntelIR);
private:
    Streamer* myStreamer;

mainwindow.cpp

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
{
    //Streamer initialization
    myStreamer = new Streamer();
    QObject::connect(myStreamer, SIGNAL(processedImageStream(vector<QImage>, QImage, QImage, QImage)), this, SLOT(updateStreamerUI(vector<QImage>, QImage, QImage, QImage)));
    qDebug() << "connected";
    ui.setupUi(this);
}

//slot for when new images are sent from the Streamer class
void MainWindow::updateStreamerUI(const vector<QImage> &imgs, const QImage &imgIntel, const QImage &imgIntelDepth, const QImage &imgIntelIR) {
    qDebug() << "images received!";
    //rest of the code
}
+4
source share
2

, , QVector Qt Meta Object. .

qRegisterMetaType<T>("T");

vector, ... .

Qt Qt , . QObject::connect.

, , QVector . , , . , . , , , , .

QVector .

:

qDebug() << Q_FUNC_INFO;
+8

/ . using (, using std::string;) Qt , string std::string.

, MainWindow::updateStreamerUI .cpp.

, MainWindow::updateStreamerUI :

void updateStreamerUI(const vector<QImage> &imgs, const QImage &imgIntel, const QImage &imgIntelDepth, const QImage &imgIntelIR)

MainWindow.cpp.

, - std::vector ,

void processedImageStream(const std::vector<QImage> &imgs, const QImage &image2, const QImage &image3, const QImage &image4);

void updateStreamerUI(const std::vector<QImage> &imgs, const QImage &imgIntel, const QImage &imgIntelDepth, const QImage &imgIntelIR);

0

All Articles