mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-07 11:01:01 -08:00
add cpp-lib example; some fixes
This commit is contained in:
parent
7a4bff3c20
commit
eb54b6fd41
12 changed files with 144 additions and 11 deletions
28
cpp-lib/cpp/lib.h
Normal file
28
cpp-lib/cpp/lib.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef LIB_H
|
||||
#define LIB_H
|
||||
|
||||
#include <QtCore>
|
||||
|
||||
#ifdef Q_CC_MSVC
|
||||
#define LIB_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define LIB_EXPORT
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
extern "C" { LIB_EXPORT QObject* ini(); }
|
||||
|
||||
class CPP : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// max. 10 arguments of type QVariant
|
||||
// return type must also be a QVariant
|
||||
Q_INVOKABLE QVariant hello(const QVariant&);
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue