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. How to exclude generated moc_files from direct compilation?
Forum Updated to NodeBB v4.3 + New Features

How to exclude generated moc_files from direct compilation?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 211 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.
  • H Offline
    H Offline
    Hamilton_Wang
    wrote on last edited by
    #1

    I have one qtcreator project which use the private class XXXPrivate and the private class XXXPrivate have some slot functions, such as f1,f2, ....,etc.

    declare the private slot in XXX header file, such as,
    class XXXPrivate;
    Class XXX{
    .......

    Q_PRIVATE_SLOT(d_func(), void f1(void))
    .......
    }

    but get Compiler Error C2027 from generated moc file.
    Is anyone help to solve the question that how to exclude the generated moc file from direct compilation.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      If you declare slots, you need to have them implemented even if the method is empty.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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