mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-06 10:31:34 -08:00
review cpp-lib example
This commit is contained in:
parent
eb54b6fd41
commit
2e67185cd2
3 changed files with 18 additions and 21 deletions
|
|
@ -1,4 +1,4 @@
|
|||
QT += core
|
||||
QT += widgets
|
||||
TEMPLATE = lib
|
||||
CONFIG += plugin release
|
||||
DESTDIR = ../
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
#include "lib.h"
|
||||
#include <QApplication>
|
||||
#include <QMessageBox>
|
||||
#include <QtDebug>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
|
@ -8,18 +10,21 @@ QObject* ini() {
|
|||
static QObject* cpp = 0;
|
||||
if(!cpp) {
|
||||
cpp = new CPP;
|
||||
|
||||
// needed for QMessageBox
|
||||
static int argc = 1;
|
||||
static char* argv[] = {"cpp"};
|
||||
new QApplication(argc, argv);
|
||||
}
|
||||
return cpp;
|
||||
}
|
||||
|
||||
// insert here your function implementations
|
||||
|
||||
QVariant CPP::hello(const QVariant& arg) {
|
||||
QString msg;
|
||||
QDebug debug(&msg);
|
||||
debug << arg;
|
||||
|
||||
qDebug() << "hello" << arg;
|
||||
QMessageBox::information(nullptr, "hello", msg);
|
||||
|
||||
return arg;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue