PDA

View Full Version : Error in qsqlrelationaldelegate.h?



brcain
25th August 2006, 23:48
Hello,

I'm having trouble with the database example from chapter 13 of the book. Is it due to an error in the Qt header file?

.../include/qtsql/../../src/sql/models/qsqlrelationaldelegate.h
which is included by the header file, QtSql.

There's a (#ifdef QT_GUI_LIB) statement at line 27 that doesn't appear to be defined anywhere in the Qt installation directory.

I'm not aware of a need for a QT_GUI_LIB preprocessor directive. However, creating one makes the problem go away ... properly building the example.

BTW another (#ifdef QT_GUI_LIB) statement is found at line 153 of file:

.../include/qtsql/../../src/tools/qtestlib/src/qtest.h

Thanks,
Ben

jacek
25th August 2006, 23:57
Is it due to an error in the Qt header file?
No, each module has its own directive that qmake defines when you add given module to QT variable in the .pro file. Since you don't use qmake, you have to define it manually.

brcain
28th August 2006, 08:05
I haven't seen this problem with any other module (e.g. XML, OpenGL) ... assuming that's what you mean by "module".

Would the problem go away with a commercial license using Visual Studio? This project doens't need a commercial license ... other than the fact that I'm trying to use the Visual Studio IDE. I'm supporting a research effort ... not selling a product.

jacek
28th August 2006, 12:05
Would the problem go away with a commercial license using Visual Studio?
I've never tried VS integration, because I don't use VS, but qmake should work. Try vcapp template.