Getting current year
I'm trying to get the date out of QDate using the following code:
QDate *year = new QDate; year = QDate::year (); qDebug() << "Year : " << year;
I get the following error message:
C:\Programming\Qtsamples\Date\mainwindow.cpp:11: error: cannot call member function 'int QDate::year() const' without object
year = QDate::year ();
What would be the correct way of doing this?
int year = QDate::currentDate().year();