Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

QMetaObject_invokeMethod

#ifndef RECEIVER_H
#define RECEIVER_H

#include <QObject>
#include <QDebug>

struct SomeData {
    QString str;
    int id;
};
//Q_DECLARE_METATYPE(SomeData);

class Receiver : public QObject
{
    Q_OBJECT
public:
    explicit Receiver(QObject *parent = nullptr) : QObject(parent) {}

    void doSmth(SomeData data) {
        qDebug() << data.str;
    }

signals:

};

#endif // RECEIVER_H
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
8+9 =