mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2024-12-02 00:32:24 +08:00
28 lines
696 B
C++
28 lines
696 B
C++
// Copyright (C) 2016 Intel Corporation.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
|
|
#include <QtDBus/QDBusMessage>
|
|
|
|
#define HAS_HOOKSETUPFUNCTION 1
|
|
static void hookSetupFunction();
|
|
|
|
// Ugly hack, look away
|
|
#include "../qdbusconnection/tst_qdbusconnection.cpp"
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
extern Q_DBUS_EXPORT void qDBusAddSpyHook(void (*Hook)(const QDBusMessage&));
|
|
QT_END_NAMESPACE
|
|
|
|
static void hookFunction(const QDBusMessage &)
|
|
{
|
|
// qDebug() << "hook called";
|
|
++tst_QDBusConnection::hookCallCount;
|
|
}
|
|
|
|
static void hookSetupFunction()
|
|
{
|
|
QT_PREPEND_NAMESPACE(qDBusAddSpyHook)(hookFunction);
|
|
}
|
|
|
|
QTEST_MAIN(tst_QDBusConnection_SpyHook)
|