03-17-2014 01:28 PM
Something quite unusual is happening, it looks like the DateTimePicker in my app suddenly decided that epoch was three days later than it should be:
schedTimePicker = new DateTimePicker();
connect(schedTimePicker, SIGNAL(valueChanged(QDateTime)), this, SLOT(onSchedTimeValueChanged(QDateTime)));
In the slot I have:
void MainClass:: onSchedTimeValueChanged(QDateTime time)
fprintf(stderr, "%s:%d time=%s\n", __FUNCTION__, __LINE__, time.toString().toUtf8().constData());
When I set the time picker to 00:00:00 the output on the console is:
onSchedTimeValueChanged:5448 time=Sat Jan 3 00:00:00 1970
A full three days after actual epoch. Am I losing it? What's going on?
Solved! Go to Solution.
03-17-2014 02:12 PM
Apparently the parameter provided for the valueChanged slot is not what the documentation says it is.
The most reliable way of determining what the value changed _to_ when the slot is called is to look at the picker->value() value instead. I'm suspecting the parameter had the value that was previously set, or something along those lines.