mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-06 10:31:34 -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
27
cpp-lib/cpp/lib.cpp
Normal file
27
cpp-lib/cpp/lib.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#include "lib.h"
|
||||
#include <QtDebug>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QObject* ini() {
|
||||
// any QObject inherited class will do
|
||||
static QObject* cpp = 0;
|
||||
if(!cpp) {
|
||||
cpp = new CPP;
|
||||
}
|
||||
return cpp;
|
||||
}
|
||||
|
||||
// insert here your function implementations
|
||||
|
||||
QVariant CPP::hello(const QVariant& arg) {
|
||||
QString msg;
|
||||
QDebug debug(&msg);
|
||||
debug << arg;
|
||||
|
||||
qDebug() << "hello" << arg;
|
||||
|
||||
return arg;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
Loading…
Add table
Add a link
Reference in a new issue