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

Thiago Macieira thiago at kde.org
Fri May 28 08:51:16 CEST 2010


Em Sexta-feira 28. Maio 2010, às 08.37.28, Kustaa Nyholm escreveu:
> 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.

Header-only classes are supported, no problem.

The problem is header-only projects. The qmake "app" or "lib" templates 
require building something, so they need source code, not just headers, to 
build.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100528/49d8a167/attachment.bin 


More information about the Qt-interest-old mailing list