qobjectconnect.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Copyright (C) 2021 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
  3. #ifndef QOBJECTCONNECT_H
  4. #define QOBJECTCONNECT_H
  5. #include "pysidemacros.h"
  6. #include <sbkpython.h>
  7. #include <QtCore/qmetaobject.h>
  8. QT_FORWARD_DECLARE_CLASS(QObject)
  9. QT_FORWARD_DECLARE_CLASS(QMetaMethod)
  10. namespace PySide
  11. {
  12. /// Helpers for QObject::connect(): Make a string-based connection
  13. PYSIDE_API QMetaObject::Connection
  14. qobjectConnect(QObject *source, const char *signal,
  15. QObject *receiver, const char *slot,
  16. Qt::ConnectionType type);
  17. /// Helpers for QObject::connect(): Make a connection based on QMetaMethod
  18. PYSIDE_API QMetaObject::Connection
  19. qobjectConnect(QObject *source, QMetaMethod signal,
  20. QObject *receiver, QMetaMethod slot,
  21. Qt::ConnectionType type);
  22. /// Helpers for QObject::connect(): Make a connection to a Python callback
  23. PYSIDE_API QMetaObject::Connection
  24. qobjectConnectCallback(QObject *source, const char *signal,
  25. PyObject *callback, Qt::ConnectionType type);
  26. /// Helpers for QObject::connect(): Make a connection to a Python callback and a context object
  27. PYSIDE_API QMetaObject::Connection
  28. qobjectConnectCallback(QObject *source, const char *signal, QObject *context,
  29. PyObject *callback, Qt::ConnectionType type);
  30. /// Helpers for QObject::disconnect(): Disconnect a Python callback
  31. PYSIDE_API bool qobjectDisconnectCallback(QObject *source, const char *signal,
  32. PyObject *callback);
  33. /// Helper for functions that forward arguments to QObject::connect(),
  34. /// for example, QTimer::singleShot().
  35. PYSIDE_API bool callConnect(PyObject *self, const char *signal, PyObject *argument);
  36. } // namespace PySide
  37. #endif // QOBJECTCONNECT_H