Created
July 7, 2020 09:20
-
-
Save daxim/17ba671f0c42ac5b5677953e6cfc1382 to your computer and use it in GitHub Desktop.
FFI::Platypus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qmake-qt5 && make -j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <testapp.h> | |
#include <QApplication> | |
#include <wobjectimpl.h> | |
W_OBJECT_IMPL(Testapp) | |
Testapp::Testapp(QWidget *parent) : QMainWindow(parent) { | |
} | |
Testapp::~Testapp() { | |
} | |
int main(int argc, char *argv[]) { | |
QApplication a(argc, argv); | |
Testapp w; | |
w.show(); | |
return a.exec(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef TESTAPP_H_INCLUDED | |
#define TESTAPP_H_INCLUDED | |
#include <wobjectdefs.h> | |
#include <QObject> | |
#include <QMainWindow> | |
class Testapp : public QMainWindow { | |
W_OBJECT(Testapp) | |
public: | |
Testapp(QWidget *parent = nullptr); | |
~Testapp(); | |
}; | |
#endif // TESTAPP_H_INCLUDED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Testapp; | |
use FFI::Platypus; | |
use FFI::Platypus::Memory qw(free malloc); | |
my $ffi = FFI::Platypus->new; | |
$ffi->lang('CPP'); | |
$ffi->lib('./testapp.o'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QT += core gui widgets | |
CONFIG += c++14 | |
DEFINES += QT_DEPRECATED_WARNINGS | |
SOURCES += \ | |
testapp.cpp | |
HEADERS += \ | |
testapp.h | |
INCLUDEPATH += ../verdigris/src # https://github.com/woboq/verdigris |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment