Originally Posted by
jochen_r
I am coding using QT4, but I had something similar happen to me. I found out that it was because I didn't have
CONFIG += qt
CONFIG += qt
To copy to clipboard, switch view to plain text mode
in my project file, hap2006.pro. That may not be your solution, but it worked for me.
Originally Posted by
jochen_r
A second question in the same area: If I follow the Qt book (
http://doc.trolltech.com/4.0/how-to-learn-qt.html - see link in the first line of the text), they use #include <qapplication.h> which works on my computer. I thought one shouldn't use the <xxx.h> for includes anymore. Any opinion on that? Which tutorial is the more recent one?
Regards,
Jochen
I also ran into that TODAY!, while trying to edit and compile my hap2006 project in Code::Blocks with the MinGW compiler, as an experiment. I found out that some libraries required the ".h" extension, and some did not.
For example, here are the #includes in my homestead.cpp file after I got it to compile using Code::Blocks and the MinGW compiler:
#include <Qt>
#include <QKeyEvent>
#include <QString.h>
#include <QStringList.h>
#include <QMessageBox.h>
#include <QDate>
#include <QSqlQueryModel.h>
#include <QSqlError.h>
#include <QSqlRecord.h>
#include <QSqlField.h>
#include <QAbstractItemView.h>
#include <QModelIndex>
#include <QHeaderView>
#include <QFile.h>
#include <QDir.h>
#include <QProcess.h>
#include <QDialog.h>
#include <QPrintDialog.h>
#include <QPrinter.h>
#include <QInputDialog.h>
#include <math.h>
#include <QValidator.h>
#include <QIntValidator>
#include <QPalette.h>
#include <QTextEdit.h>
#include <QTextDocument.h>
#include <Qt>
#include <QKeyEvent>
#include <QString.h>
#include <QStringList.h>
#include <QMessageBox.h>
#include <QDate>
#include <QSqlQueryModel.h>
#include <QSqlError.h>
#include <QSqlRecord.h>
#include <QSqlField.h>
#include <QAbstractItemView.h>
#include <QModelIndex>
#include <QHeaderView>
#include <QFile.h>
#include <QDir.h>
#include <QProcess.h>
#include <QDialog.h>
#include <QPrintDialog.h>
#include <QPrinter.h>
#include <QInputDialog.h>
#include <math.h>
#include <QValidator.h>
#include <QIntValidator>
#include <QPalette.h>
#include <QTextEdit.h>
#include <QTextDocument.h>
To copy to clipboard, switch view to plain text mode
I just did trial and error on the include statements using the error msgs spit out by the compiler. "Qt" and "QDate" gave "can't find..." messages IF I added the ".h" extension. The rest failed if I DIDN'T have the ".h" extension.
Bookmarks