mirror of
https://github.com/status-im/dotherside.git
synced 2025-02-06 17:53:34 +00:00
feat: add signal handler for status-go
This commit is contained in:
parent
4d0d6a353c
commit
3ecf2595f1
@ -90,6 +90,10 @@ DOS_API void DOS_CALL dos_qapplication_create(void);
|
||||
/// \note A QApplication should have been already created through dos_qapplication_create()
|
||||
DOS_API void DOS_CALL dos_qapplication_exec(void);
|
||||
|
||||
/// \brief Invokes a QObject's slot by passing a string containing a signal
|
||||
/// \note This method was created because status-go has a non-QT event loop
|
||||
DOS_API void DOS_CALL dos_signal(DosQObject *vptr, const char *signal, const char *slot);
|
||||
|
||||
/// \brief Calls the QApplication::quit() function of the current QGuiApplication
|
||||
/// \note A QApplication should have been already created through dos_qapplication_create()
|
||||
DOS_API void DOS_CALL dos_qapplication_quit(void);
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <QtCore/QResource>
|
||||
#include <QtGui/QGuiApplication>
|
||||
#include <QtQml/QQmlContext>
|
||||
#include <QtCore>
|
||||
#include <QtQml/QQmlApplicationEngine>
|
||||
#include <QtQuick/QQuickView>
|
||||
#include <QtQuick/QQuickImageProvider>
|
||||
@ -717,6 +718,12 @@ bool dos_qurl_isValid(const ::DosQUrl *vptr)
|
||||
return new DOS::DosIQMetaObjectHolder(std::move(metaObject));
|
||||
}
|
||||
|
||||
void dos_signal(::DosQObject *vptr, const char *signal, const char *slot) //
|
||||
{
|
||||
auto qobject = static_cast<QObject *>(vptr);
|
||||
QMetaObject::invokeMethod(qobject, slot, Qt::QueuedConnection, Q_ARG(QString, signal));
|
||||
}
|
||||
|
||||
void dos_qmetaobject_delete(::DosQMetaObject *vptr)
|
||||
{
|
||||
auto factory = static_cast<DOS::DosIQMetaObjectHolder *>(vptr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user