ctkVTKObjectTestHelper.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0.txt
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkVTKObjectTestHelper_h
  15. #define __ctkVTKObjectTestHelper_h
  16. // Qt includes
  17. #include <QObject>
  18. // CTK includes
  19. #include <ctkPimpl.h>
  20. // CTKVTK includes
  21. #include "ctkVTKObject.h"
  22. class ctkVTKObjectTestPrivate;
  23. class ctkVTKObjectTest: public QObject
  24. {
  25. Q_OBJECT
  26. QVTK_OBJECT
  27. public:
  28. ctkVTKObjectTest(QObject* parent = 0);
  29. virtual ~ctkVTKObjectTest();
  30. bool test();
  31. bool isPublicSlotCalled()const;
  32. bool isProtectedSlotCalled()const;
  33. bool isPrivateSlotCalled()const;
  34. void resetSlotCalls();
  35. void emitSignalEmitted();
  36. public Q_SLOTS:
  37. void onVTKObjectModifiedPublic();
  38. void deleteConnection();
  39. protected Q_SLOTS:
  40. void onVTKObjectModifiedProtected();
  41. private Q_SLOTS:
  42. void onVTKObjectModifiedPrivate();
  43. Q_SIGNALS:
  44. void signalEmitted();
  45. protected:
  46. QScopedPointer<ctkVTKObjectTestPrivate> d_ptr;
  47. private:
  48. Q_DECLARE_PRIVATE(ctkVTKObjectTest);
  49. Q_DISABLE_COPY(ctkVTKObjectTest);
  50. };
  51. #endif