qskinny/playground/invoker/Invoker.h

35 lines
919 B
C
Raw Normal View History

2018-02-26 08:39:53 +00:00
/******************************************************************************
2024-01-17 13:31:45 +00:00
* QSkinny - Copyright (C) The authors
2023-04-06 07:23:37 +00:00
* SPDX-License-Identifier: BSD-3-Clause
2018-02-26 08:39:53 +00:00
*****************************************************************************/
2021-08-04 08:11:12 +00:00
#pragma once
2018-02-26 08:39:53 +00:00
#include "Callback.h"
2018-02-26 08:39:53 +00:00
#include <QskMetaFunction.h>
#include <QObject>
#include <QVector>
class Invoker : public QObject
{
2018-08-03 06:15:28 +00:00
public:
2018-02-26 08:39:53 +00:00
Invoker( QObject* parent = nullptr );
void addFunctionCall( const QskMetaFunction& );
void addFunctionCall( const QObject*, const QskMetaFunction& );
void addMethodCall( const QObject*, const char* methodName );
void addPropertyCall( const QObject*, const char* property );
2018-02-26 08:39:53 +00:00
void invoke( qreal d, int i, Qt::ConnectionType );
2018-02-26 08:39:53 +00:00
2018-08-03 06:15:28 +00:00
private:
QVector< Callback > m_callbacks;
2018-02-26 08:39:53 +00:00
};
inline void Invoker::addFunctionCall( const QskMetaFunction& function )
2018-02-26 08:39:53 +00:00
{
addFunctionCall( this, function );
2018-02-26 08:39:53 +00:00
}