
Originally Posted by
henryjoye
Many thanks! I may re-interprete your solutions:
o The first one: I do not completely understand this solution. It seems that my current version is like that.
You would remove the lines from resetPOV() that set the member variables and change the setValue() lines.
void Setup_Dialog::resetFOV()
{
// set values
qsb_fov_min_x->setValue(-150.0);
qsb_fov_max_x->setValue(50.0);
qsb_fov_step_x->setValue(1.0);
qsb_fov_min_y->setValue(-150.0);
qsb_fov_max_y->setValue(150.0);
qsb_fov_step_y->setValue(1.0);
qsb_fov_min_z->setValue(50.0);
qsb_fov_max_z->setValue(60.0);
qsb_fov_step_z->setValue(1.0);
}
void Setup_Dialog::resetFOV()
{
// set values
qsb_fov_min_x->setValue(-150.0);
qsb_fov_max_x->setValue(50.0);
qsb_fov_step_x->setValue(1.0);
qsb_fov_min_y->setValue(-150.0);
qsb_fov_max_y->setValue(150.0);
qsb_fov_step_y->setValue(1.0);
qsb_fov_min_z->setValue(50.0);
qsb_fov_max_z->setValue(60.0);
qsb_fov_step_z->setValue(1.0);
}
To copy to clipboard, switch view to plain text mode
o The second one: this means that each widget has a separate slot function for the corresponding signal, but not use one slot for all widgets. Am i right?
Thank you!
Your current arrangement doesn't know or care which slider changed; update() reads/works with the current state of all of them anyway. This need not change except that you don't need to read each slider and stash it into a variable... everywhere you previously used the variable you would directly use the slider value. It really depends on how the current member variables are used as to whether this is feasible.
Bookmarks