abc.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2004-2011 Kitware, Inc.
  4. Copyright 2011 Alexander Neundorf ([email protected])
  5. Distributed under the OSI-approved BSD License (the "License");
  6. see accompanying file Copyright.txt for details.
  7. This software is distributed WITHOUT ANY WARRANTY; without even the
  8. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. See the License for more information.
  10. ============================================================================*/
  11. #include "abc.h"
  12. #include <stdio.h>
  13. class PrintAbc : public QObject
  14. {
  15. Q_OBJECT
  16. public:
  17. PrintAbc():QObject() {}
  18. public slots:
  19. void print() const { printf("abc\n"); }
  20. };
  21. Abc::Abc()
  22. :QObject()
  23. {
  24. }
  25. void Abc::doAbc()
  26. {
  27. PrintAbc pa;
  28. pa.print();
  29. }
  30. // check that including the moc file for the cpp file and the header works:
  31. #include "abc.moc"
  32. #include "moc_abc.cpp"
  33. // check that including a moc file from another header works:
  34. #include "moc_xyz.cpp"