ctkSimplePythonQtDecorators.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 __ctkSimplePythonQtDecorators_h
  15. #define __ctkSimplePythonQtDecorators_h
  16. // CTK includes
  17. #include "ctkSimplePythonShellConfigure.h" // For CTK_WRAP_PYTHONQT_LIGHT
  18. #include <ctkAbstractPythonManager.h>
  19. #ifdef CTK_WRAP_PYTHONQT_LIGHT
  20. # include <ctkCorePythonQtDecorators.h>
  21. # include <ctkWidgetsPythonQtDecorators.h>
  22. #endif
  23. // PythonQt includes
  24. #include <PythonQt.h>
  25. // NOTE:
  26. //
  27. // For decorators it is assumed that the methods will never be called
  28. // with the self argument as NULL. The self argument is the first argument
  29. // for non-static methods.
  30. //
  31. class ctkSimplePythonQtDecorators : public QObject
  32. {
  33. Q_OBJECT
  34. public:
  35. ctkSimplePythonQtDecorators(ctkAbstractPythonManager* pythonManager)
  36. {
  37. Q_ASSERT(pythonManager);
  38. #ifdef CTK_WRAP_PYTHONQT_LIGHT
  39. pythonManager->registerPythonQtDecorator(new ctkCorePythonQtDecorators);
  40. pythonManager->registerPythonQtDecorator(new ctkWidgetsPythonQtDecorators);
  41. #else
  42. Q_UNUSED(pythonManager);
  43. #endif
  44. }
  45. public slots:
  46. };
  47. #endif