Results 1 to 4 of 4

Thread: Vs-addin doesn't generate moc's

  1. #1

    Default Vs-addin doesn't generate moc's

    Hello. I'm using Visual Studio 2010 with vs-addin-1.2.2. I suppose, that addin should generate moc-files automatically when finds Q_OBJECT macro. But I added simple class and got linker errors. Moc-files were generated properly with other classes early, but not now. What's wrong? Is there any way to force generating?

    QwtFFT.h
    Qt Code:
    1. #pragma once
    2. #include "qwt_plot.h"
    3. class QwtFFT :
    4. public QwtPlot
    5. {
    6. Q_OBJECT
    7. public:
    8. QwtFFT(QWidget *);
    9. ~QwtFFT(void);
    10. };
    To copy to clipboard, switch view to plain text mode 

    QwtFFT.c
    Qt Code:
    1. #include "QwtFFT.h"
    2.  
    3. QwtFFT::QwtFFT(QWidget *parent) : QwtPlot(parent)
    4. {
    5. }
    6.  
    7. QwtFFT::~QwtFFT(void)
    8. {
    9. }
    To copy to clipboard, switch view to plain text mode 

    QWT_DLL defined. Thanks

  2. #2

    Default Re: Vs-addin doesn't generate moc's

    Well, I found a way to generate moc manually (set Custom Build Toll in header file properties, then add moc_* to generated files), but still have no idea why automatic generation was broken

  3. #3

    Default Re: Vs-addin doesn't generate moc's

    Solution re-creation solved the problem

  4. #4
    Join Date
    Oct 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Vs-addin doesn't generate moc's

    It sometimes happens to me too. I don't know why, but the quickest way I found to force addin to re-generate the moc files is this:

    -delete the Q_OBJECT macro (eg. by shift+delete in that line)
    -save (ctrl+s)
    -add back the macro (eg. ctrl+z)
    -save (ctrl+s)

    4 keystrokes and the moc files are back. No need to recreate the whole solution
    Last edited by crossblades; 15th February 2014 at 11:47. Reason: spelling corrections

Similar Threads

  1. MOC doesn't generate files
    By Gera777 in forum Qt Programming
    Replies: 1
    Last Post: 10th May 2013, 21:25
  2. qt-vs-addin-1.1.11 and 'Open with'
    By gib in forum Qt Tools
    Replies: 1
    Last Post: 15th March 2013, 01:49
  3. Qt VS-Addin
    By dpatel in forum Qt Tools
    Replies: 0
    Last Post: 2nd November 2010, 11:19
  4. Error about setup the qt-vs-addin-1.1.4.exe
    By to_guliang in forum Installation and Deployment
    Replies: 2
    Last Post: 30th April 2010, 07:38
  5. Replies: 4
    Last Post: 9th June 2006, 20:22

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.