Problems QDateEdit

Hi everybody !

I have a problem to susbract two QDateEdit. I just wanna find the difference in term of day between two dates determined by the user of my application, but i can't just write : result = QDateEdit1 - QDateEdit2 because it's not possible to do this with two QDateEdit. After long hours of research, i didn't find the solution, i hope a person here has it. I would think to convert my two QDateEdit into seconds since 1970 is a good idea but i didn't find the way to do it.

Here is the declaration of the QDateEdit
1
2
3
4
5
6
7
8
9
FenDate::FenDate()
{
    DateDebut = new QDateEdit;
    DateDebut->setDate(QDate::currentDate());
    DateFin = new QDateEdit;
    DateFin->setDate(QDate::currentDate());
 
...
}


Thank you very much !
"Long hours of research." Did it involve reading the Qt documentation? The bits that show the member of QDateEdit that actually returns the data? Or did you just miss the member of that returned type that (for some Qt version) "Returns the number of days from this date to d (which is negative if d is earlier than this date)."

Yes, a solution apparently exists. You are better off if you retrieve it yourself.
Topic archived. No new replies allowed.