abc.cpp 696 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "abc.h"
  4. #include "abc_p.h"
  5. #include <stdio.h>
  6. class PrintAbc : public QObject
  7. {
  8. Q_OBJECT
  9. public:
  10. PrintAbc()
  11. : QObject()
  12. {
  13. }
  14. public slots:
  15. void print() const { printf("abc\n"); }
  16. };
  17. Abc::Abc()
  18. : QObject()
  19. {
  20. }
  21. void Abc::doAbc()
  22. {
  23. PrintAbc pa;
  24. pa.print();
  25. AbcP abcP;
  26. abcP.doAbcP();
  27. }
  28. // check that including the moc file for the cpp file and the header works:
  29. #include "abc.moc"
  30. #include "moc_abc.cpp"
  31. #include "moc_abc_p.cpp"
  32. // check that including a moc file from another header works:
  33. #include "moc_xyz.cpp"