Is it possible to add new functions to the QDate class ?
In particular, I wanted to add the functions monthsTo(Qdate adate) and yearsTo(QDate adate) to complement the existing daysTo(QDate adate) function.
I know I could create a new class using QDate as a base, ie
class myQDate : public QDate
{
// function prototypes
int QDate::monthsTo(QDate adate);
int QDate::yearsTo(QDate adate);
};
I would then need to change all my QDates to myQDates.
Regarding future projects, is it better practice to create my own classes from the Qt bases if I suspect they may need to be extended.
TIA
Carlton.
Bookmarks