Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Q_RETURN_ARG for QObject-derived type

$
0
0
Hi and welcome to devnet, MyWidget.h   class MyWidget : public QWidget {     Q_OBJECT public:     MyWidget(QWidget *parent = 0); Q_INVOKABLE QWidget* me() { return this; } };   main.cpp MyWidget widget; QWidget *retVal = Q_NULLPTR;     QMetaObject::invokeMethod(&widget, "me", Qt::DirectConnection,                               Q_RETURN_ARG(QWidget*, retVal));     qDebug() << retVal; Returns the right value. Can you show your current function code and how you call it exactly ?

Viewing all articles
Browse latest Browse all 4972

Latest Images

Trending Articles



Latest Images