[Qt-interest] qmake does not support headers without a corresponding source file

Kustaa Nyholm Kustaa.Nyholm at planmeca.com
Fri May 28 08:37:28 CEST 2010


For example:

I have created my own widget class derived from QWidget. I refer to that
class (only) from within my .ui file.

I have the full class definition anddeclaration for mywidget in the header
file mywidget.h (it is a very simple widget and only refered to once).

I have added mywidget.h to myproject.pro and ran qmake.

The resulting Makefile only has one reference to mywidget.h
and that is for target dist: and indeed changing the header does not
trigger any action for the default target.

I need to create mywidget.cpp and add that to SOURCES in the myproject.pro
file, then everything works as expected.

It seems a bit inconsistent that this (header only classes) are not
supported by qmake, since Qt itself uses the same pattern/strategy
for ui_ files.

br Kusti





More information about the Qt-interest-old mailing list