mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 10:56:11 +00:00
Expose CutterApplication to Python and add accessor
This commit is contained in:
parent
14f830dd81
commit
47e92a373f
@ -7,6 +7,7 @@
|
||||
#include "../core/Cutter.h"
|
||||
#include "../common/Configuration.h"
|
||||
#include "../core/MainWindow.h"
|
||||
#include "../CutterApplication.h"
|
||||
#include "../widgets/CutterDockWidget.h"
|
||||
#include "../plugins/CutterPlugin.h"
|
||||
|
||||
|
@ -13,6 +13,9 @@
|
||||
<object-type name="MainWindow" >
|
||||
<enum-type name="MenuType" />
|
||||
</object-type>
|
||||
<object-type name="CutterApplication">
|
||||
<modify-function signature="CutterApplication(int &, char **)" remove="all"/>
|
||||
</object-type>
|
||||
<object-type name="BasicBlockHighlighter" />
|
||||
<object-type name="CutterDockWidget" />
|
||||
|
||||
|
@ -6,6 +6,14 @@ try:
|
||||
|
||||
def core():
|
||||
return CutterCore.instance()
|
||||
|
||||
def app():
|
||||
# see https://forums.autodesk.com/t5/3ds-max-programming/qapplication-instance-returns-qcoreapplication-instance/td-p/9035295
|
||||
import shiboken2
|
||||
from PySide2 import QtCore
|
||||
coreapp = QtCore.QCoreApplication.instance()
|
||||
ptr = shiboken2.getCppPointer(coreapp)[0]
|
||||
return shiboken2.wrapInstance(ptr, CutterApplication)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user