foo.cpp 906 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 "foo.h"
  12. #include <stdio.h>
  13. class FooFoo : public QObject
  14. {
  15. Q_OBJECT
  16. public:
  17. FooFoo():QObject() {}
  18. public slots:
  19. int getValue() const { return 12; }
  20. };
  21. Foo::Foo()
  22. :QObject()
  23. {
  24. }
  25. void Foo::doFoo()
  26. {
  27. FooFoo ff;
  28. printf("Hello automoc: %d\n", ff.getValue());
  29. }
  30. #include "foo.moc"