Hello All,
I am new to qt and cpp also. I am using qslider for my project. Here is the code:
program.hprogram.cpp
How can I call int pos in main function. to my knowledge int x= functionname(& variable), but I cannot call.
Thans a lot in advance.
Hello All,
I am new to qt and cpp also. I am using qslider for my project. Here is the code:
program.hprogram.cpp
How can I call int pos in main function. to my knowledge int x= functionname(& variable), but I cannot call.
Thans a lot in advance.
Your question is not clear to me some how.How can I call int pos in main function.
if you want slider position, useand you have a current change value with the help of onValueChanged(int value) // value is the current slider valueQSlider::value()
If you want current slider value in some other place, have a public function in mainwindow which return;slider->value()
And call this where ever you want main/some other class where you have this mainwindow handle.
i don't know what your doing with this code
Qt Code:
void MainWindow::onValueChanged(int value) { int pos = slider->sliderPosition(); value=pos; //what are doing here, why are you overwriting value //................. }To copy to clipboard, switch view to plain text mode
Last edited by prasad_N; 7th October 2015 at 09:23.
Thanks :-)
Bookmarks