[Qt-interest] qmake does not support headers without a corresponding source file
Jainish Jain
Jainish_Jain at persistent.co.in
Fri May 28 08:51:27 CEST 2010
Hi,
Do you have any cpp file in your project? Assuming on "I have added mywidget.h to myproject.pro and ran qmake"
If not then, you need to create one and include your header file. Even cpp file containing main function will work.
Problem here is Compiler compiles source files and not .h files. In normal cases, .h files are compiled since they are included in at least one of the source files either directly or indirectly(through other header files). I don't t think there is any issue with qmake here.
I agree that ui_x.h files generated by UIC contains complete class along with member function definations however again they are included in the source files or they will not work
Sorry if I have interpreted your problem incorrectly.
Jainish
________________________________________
From: qt-interest-bounces at trolltech.com [qt-interest-bounces at trolltech.com] On Behalf Of Kustaa Nyholm [Kustaa.Nyholm at planmeca.com]
Sent: Friday, May 28, 2010 12:07 PM
To: QT Interest List
Subject: [Qt-interest] qmake does not support headers without a corresponding source file
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
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
More information about the Qt-interest-old
mailing list