It's right to make connection with slot and signal like a
connect( ui->widget, SIGNAL( GetSquareParameters( int &, int &,int &,int &)), this, SLOT( SendSliderParams( int &, int &,int &,int &) ) );
If I need to get mouse coords from QMouseEvent
and need to get parameters from some sliders of the MainWindow
. I create signal GetSquareParameters
in the Scene
and SendSliderParams
slot in MainWindow
. Scene is a subclass from QGLWidget
.
I think it's don't right way to implement that.
Maybe I can connect somehow QMouseEvent
in Mainwindow
only if Event happen in widget(Scene) and call function like widget.AddElement( red, green, blue,... )
. Have another way to implement that without using slots and signals?