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

Get object, which have received signal

$
0
0
Just use QObject::sender() [qt-project.org], if the code you posted above is inside a slot that received a signal and the object you’re looking for is the sender of the signal. Then you could do something like this: if(qobject_cast<QWidget*>(QObject::sender())) // cast to the appropriate class here, QWidget is just as an example {    CMainWindow.tryLoadFromNetwork(qobject_cast<QWidget*>(QObject::sender()).desc_text) // cast to the appropriate class here, QWidget is just as an example }

Viewing all articles
Browse latest Browse all 4972

Trending Articles