Hello to all. There is a Form ui on it has a comboBox and two QDateTime. It is necessary that by pressing the ui-> push_button_Ok button, these values ​​are passed to the function. In the future, they will work in the function. What is the best way to do this?

  • And what prevents to read these values ​​in the handler? - Evgeny Shmidt September

1 answer 1

Attach a slot to the signal. Inside the slot, place the data from the widgets into variables and call the function:

void onPushPressed() { auto dateTime1 = mDateTimeWidget1.dateTime(); auto dateTime2 = mDateTimeWidget2.dateTime(); auto comboValue = mComboBox.currentText(); foo(dateTime1, dateTime2, comboValue); }