aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/qobjectconnect.h
blob: c99b8006ed216398cdaeceafcf851a954dd1336f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef QOBJECTCONNECT_H
#define QOBJECTCONNECT_H

#include "pysidemacros.h"

#include <sbkpython.h>

#include <QtCore/QMetaObject>

QT_FORWARD_DECLARE_CLASS(QObject)
QT_FORWARD_DECLARE_CLASS(QMetaMethod)

namespace PySide
{

/// Helpers for QObject::connect(): Make a string-based connection
PYSIDE_API QMetaObject::Connection
    qobjectConnect(QObject *source, const char *signal,
               QObject *receiver, const char *slot,
               Qt::ConnectionType type);

/// Helpers for QObject::connect(): Make a connection based on QMetaMethod
PYSIDE_API QMetaObject::Connection
    qobjectConnect(QObject *source, QMetaMethod signal,
                   QObject *receiver, QMetaMethod slot,
                   Qt::ConnectionType type);

/// Helpers for QObject::connect(): Make a connection to a Python callback
PYSIDE_API QMetaObject::Connection
    qobjectConnectCallback(QObject *source, const char *signal,
                           PyObject *callback, Qt::ConnectionType type);

/// Helpers for QObject::connect(): Make a connection to a Python callback and a context object
PYSIDE_API QMetaObject::Connection
    qobjectConnectCallback(QObject *source, const char *signal, QObject *context,
                           PyObject *callback, Qt::ConnectionType type);

/// Helpers for QObject::disconnect(): Disconnect a Python callback
PYSIDE_API bool qobjectDisconnectCallback(QObject *source, const char *signal,
                                          PyObject *callback);

} // namespace PySide

#endif // QOBJECTCONNECT_H