
Originally Posted by
Cyrebo
So this action is triggered when i click another button which an ok button slot to get the figures. How may I use all the variables in my function. I know in c you just type in the variable function name but that doesn't work on c++...
do you mean use the variables form the other function? if this is what you mean you could try this:
QList<double> spinboxValues;
double values;
mainWindow::dbinfo(){
//get values from spin box
}
void MainWindow::okbuttonslot(){
spinBoxValue << value;
}
QList<double> spinboxValues;
double values;
mainWindow::dbinfo(){
//get values from spin box
}
void MainWindow::okbuttonslot(){
spinBoxValue << value;
}
To copy to clipboard, switch view to plain text mode
that would mean when you press the button the value from your spinbox would be appended to the QList spinbox but you will probably have to use a boolen or something if you use this method otherwise each time you press the button it will append it to the end
Bookmarks