[Qt-creator] Problems console application and Q_OBJECT

Eike Ziller eike.ziller at nokia.com
Wed May 13 09:37:31 CEST 2009


Hi,

On May 13, 2009, at 6:45 AM, ext Andre Poenitz wrote:

> On Wed, May 13, 2009 at 01:06:04AM +0200, Petric Frank wrote:
>> i try to create a console application under Windows.  The problem is
>> that it does not create/update the moc_* files whenver a slot have
>> been added.  If i manually execute qmake and mingw32_make then i get
>> the files created/updated.
>
> That's a known problem, and running qmake manually is indeed the
> recommended workaround.

To clarify that a bit: It is a known problem that you have to run  
qmake manually (e.g. via the Build->Run qmake menu), if you add the  
Q_OBJECT macro to a file that didn't have it before. After you have  
done that once, adding slots or signals should automatically result in  
moc being called at build time. (There should be a rule in the  
Makefile, similar to
moc_mainwindow.cpp: mainwindow.h
         /Developer/Tools/Qt/moc $(DEFINES) $(INCPATH) -D__APPLE__ - 
D__GNUC__ mainwindow.h -o moc_mainwindow.cpp
for that.)

++ Eike

-- 
Eike Ziller
Software Engineer
Nokia, Qt Software
Phone  +49 (0)30 6392 3255
Fax    +49 (0)30 6392 3256
E-mail eike.ziller at nokia.com







More information about the Qt-creator-old mailing list