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
}
↧