[QBS] [Interest] QBS automoc

Иван Комиссаров abbapoh at gmail.com
Mon Jun 3 16:56:51 CEST 2013


Иван Комиссаров

03.06.2013, в 18:40, Joerg Bornemann <joerg.bornemann at digia.com> написал(а):

Hello, Joerg! Thank you for answering.

> Hi Ivan,
> 
> For qbs questions we have this mailing list:
> http://lists.qt-project.org/mailman/listinfo/qbs
> 
>> Hello, how do i enable "automocing" with qbs?
> 

Sorry, i forgot about that list.

> It is automatically enabled once your product depends on a Qt module.
> 
>> I'm have a cpp file (qcolorbutton.cpp), which includes moc file:
>> 
>> #include  "qcolorbutton.moc"
>> 
>> However, qbs ignores that line and generates wrong moc file (moc_qcolorbutton.cpp) which doesn't know about Private class.
> 
> The file name moc_qcolorbutton.cpp suggests that it is generated from qcolorbutton.h. Do you have the Q_OBJECT macro in both, the .h and .cpp file? Could you maybe provide some small example?

I tried both moc_qcolorbutton.cpp and qcolorbutton.moc, however none works. Here's a simple example: http://mtgs.clan.su/qbs-colorbutton.zip 

>> Should i set some varialbe to enable automocing or i have to get rid ofQ_PRIVATE_SLOTs?
> 
> No, there are no variables to alter moc behavior.
> 
> 
> BR,
> 
> Joerg
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20130603/4907ba49/attachment.html>


More information about the Qbs mailing list