Samples/Referencing/MBFileRefDemo.py
13 from pyfbsdk_additions
import *
14 from PySide2
import QtWidgets, shiboken2
15 import sys, inspect, os
18 lCurFilePath = inspect.currentframe().f_code.co_filename
19 sys.path.append( os.path.dirname(lCurFilePath) )
20 sys.path.append( os.path.join( os.path.dirname(lCurFilePath),
'MBFileRefDemo' ) )
21 import ReferencingSample
32 def WidgetCreate(self, pWidgetParent):
42 self.mNativeQtWidget = ReferencingSample.MainForm(shiboken2.wrapInstance(pWidgetParent, QtWidgets.QWidget))
47 return shiboken2.getCppPointer(self.mNativeQtWidget)[0]
49 class FileReferenceTool(
FBTool):
50 def BuildLayout(self):
55 self.AddRegion(
"main",
"main", x, y, w, h)
56 self.SetControl(
"main", self.mNativeWidgetHolder)
58 def __init__(self, name):
60 self.mNativeWidgetHolder = NativeWidgetHolder();
67 gToolName =
"File Reference Tool"
75 if gToolName
in FBToolList:
76 tool = FBToolList[gToolName]
79 tool=FileReferenceTool(gToolName)
85 sys.path.remove( os.path.join( os.path.dirname(lCurFilePath),
'MBFileRefDemo' ) )
86 sys.path.remove( os.path.dirname(lCurFilePath) )