PDA

View Full Version : Signal to Progressbar in Mainwindows Statusbar



ckvsoft
5th November 2016, 11:26
Hi

Again a question ;)

How can i send a SIGNAL to a SLOT in Mainwindow from any SUBCLASS?

Example

I Have a Statusbar with an Progressbar in MainWindow
A SLOT handle the Update of values for the Progressbar

Now i run a CLASS class1 from Mainwindow which use inside class2.
How send class2 the SIGNAL to the MAINWINDOW? Must i send this SIGNAL to class1 which send it to mainwindow or can class2 send it direct?


lg Chris

Lesiok
5th November 2016, 11:47
You can connect signal from class2 to slot in mainwindow in class1.

Killian
7th November 2016, 09:45
Just to make sure. You don't want to notify the MainWindow but rather the receiver itself.
So usually you don't put any instance inbetween sending and receiving entities. As Lesiok said just connect their signals and slots directly and make sure their parameters match.