Solved How to use signals and slots mechanism between different classes ?
-
Hi,
Scenario:
I have a mainwindow class which has a method to launch QDialog.
Another class which is plugin class that has QButton.
Now if I press button in plugin class then it should invoke the method of mainwindow class.How to achieve that using signals and slots mechanism between these two classes ?
An example code will really help me.Thanks in advance.
-
This post is deleted! -
@QtVik Did you read https://doc.qt.io/qt-5/signalsandslots.html ?
It is actually quite simple:MainWindow::MainWindow(...) { connect(pluginClass, &PlugInClass::signal, this, MainWindow::slot); }
Please explain what exactly is not clear/not working.
-
@jsulm Could you please share the detailed sample code how to do that ?
-
@QtVik Did you actually read the documentation I gave you?
There are examples. -
@jsulm Thank you. I have read the documentation.