Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. VS2013 + QT Addin: No way to generate moc files

VS2013 + QT Addin: No way to generate moc files

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fenrix
    wrote on last edited by
    #1

    Hi,
    after 4 hours of trying to solve this issue I am at the moment in at a point where I want to throw my laptop out of the window so hopefully someone has an idea.

    I have Visual Studio 2013, QT Library 5.4 and the QT5 Visual Studio Add-in 1.2.4.
    I have one moc file in my Project it is the moc file from the MainWindow which I think was automatically created during project creation.

    This moc.file works pretty well everything works fine and I can create fully functional signal slot connections.
    I can also create new slots and signals and connect them.

    The problem is if i create a new header file (listmodel for my listview) and try to build slots the project doesn't compile because (I think) of the missing moc file.

    This is my test header file:
    @#include "qobject.h"

    class Foo : public QObject{

    Q_OBJECT
    public:
    Foo();
    ~Foo();

    public slots:
    void test();

    };@

    I read a couple of blog entries about that topic and all the advises I could find.
    I tried to delete, save and enter the Q_OBJECT macro again.
    I tried to delete the debug folder, the generated files folder.
    I tried to clean and rebuild the solution also with qmake and nothing worked.

    The reinstallation of QT Library and Plugin were also unsuccessfull.

    If you have an idea or a way to make it work please let me know.
    I found one blog post about manually create the moc files with build scripts and cmd line but it didn't work but I am still a rookie in C++ maybe I did something wrong I never used build scripts before and the guide was not very rookie friendly.

    Regards
    Fenrix

    J 1 Reply Last reply
    0
    • F Fenrix

      Hi,
      after 4 hours of trying to solve this issue I am at the moment in at a point where I want to throw my laptop out of the window so hopefully someone has an idea.

      I have Visual Studio 2013, QT Library 5.4 and the QT5 Visual Studio Add-in 1.2.4.
      I have one moc file in my Project it is the moc file from the MainWindow which I think was automatically created during project creation.

      This moc.file works pretty well everything works fine and I can create fully functional signal slot connections.
      I can also create new slots and signals and connect them.

      The problem is if i create a new header file (listmodel for my listview) and try to build slots the project doesn't compile because (I think) of the missing moc file.

      This is my test header file:
      @#include "qobject.h"

      class Foo : public QObject{

      Q_OBJECT
      public:
      Foo();
      ~Foo();

      public slots:
      void test();

      };@

      I read a couple of blog entries about that topic and all the advises I could find.
      I tried to delete, save and enter the Q_OBJECT macro again.
      I tried to delete the debug folder, the generated files folder.
      I tried to clean and rebuild the solution also with qmake and nothing worked.

      The reinstallation of QT Library and Plugin were also unsuccessfull.

      If you have an idea or a way to make it work please let me know.
      I found one blog post about manually create the moc files with build scripts and cmd line but it didn't work but I am still a rookie in C++ maybe I did something wrong I never used build scripts before and the guide was not very rookie friendly.

      Regards
      Fenrix

      J Offline
      J Offline
      Jorgen
      wrote on last edited by
      #2

      @Fenrix I have a similar problem.
      I moved from VS2008 + Qt4.8.0 to VS2013 + Qt5.5.0
      The most of it worked fine with VS Add-In 1.2.4.

      But There is a problem, that new files and also existing files with custom build steps (moc, uic, qrc, ...) are not automatically called before compiler.

      Hope someone has a solution for this, because now I have manually compile the headers (with Q_OBJECT) or the ui files to get moc and ui_xyz.h files generated.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved