Added webengine initializer
This commit is contained in:
1
ui/qt/webengine/all.cpp
Normal file
1
ui/qt/webengine/all.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "cpp/webengine.cpp"
|
6
ui/qt/webengine/cpp/webengine.cpp
Normal file
6
ui/qt/webengine/cpp/webengine.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include <QtWebEngine>
|
||||
#include "webengine.h"
|
||||
|
||||
void webengineInitialize() {
|
||||
QtWebEngine::initialize();
|
||||
}
|
14
ui/qt/webengine/cpp/webengine.h
Normal file
14
ui/qt/webengine/cpp/webengine.h
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef WEBENGINE_H
|
||||
#define WEBENGINE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void webengineInitialize();
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // WEBENGINE_H
|
18
ui/qt/webengine/webengine.go
Normal file
18
ui/qt/webengine/webengine.go
Normal file
@ -0,0 +1,18 @@
|
||||
package webengine
|
||||
|
||||
// #cgo CPPFLAGS: -I./
|
||||
// #cgo CXXFLAGS: -std=c++0x -pedantic-errors -Wall -fno-strict-aliasing
|
||||
// #cgo LDFLAGS: -lstdc++
|
||||
// #cgo pkg-config: Qt5WebEngine
|
||||
//
|
||||
// #include "cpp/webengine.h"
|
||||
import "C"
|
||||
|
||||
import "github.com/obscuren/qml"
|
||||
|
||||
// Initializes the WebEngine extension.
|
||||
func Initialize() {
|
||||
qml.RunMain(func() {
|
||||
C.webengineInitialize()
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user