def paintEvent(self, ev): self.painter = QtGui.QPainter() self.painter.begin(self) self.painter.drawText(15, 15, "Contour Example using PySide ...") os.environ['GKSconid'] = "%x!%x" % ( int(shiboken.getCppPointer(self)[0]), int(shiboken.getCppPointer(self.painter)[0])) gr.updatews() self.painter.end()
def paintEvent(self, ev): self.painter.begin(self) if have_pyside: environ['GKSconid'] = "%x!%x" % ( int(shiboken.getCppPointer(self)[0]), int(shiboken.getCppPointer(self.painter)[0])) else: environ["GKSconid"] = "%x!%x" % (unwrapinstance(self), unwrapinstance(self.painter)) updatews() self.painter.end()
def paintEvent(self, ev) : self.painter = QtGui.QPainter() self.painter.begin(self) self.painter.drawText(15, 15, "Contour Example using PySide ...") os.environ['GKSconid'] = "%x!%x" % (long(shiboken.getCppPointer(self)[0]), long(shiboken.getCppPointer(self.painter)[0])) gr.updatews() self.painter.end()
def _qtAddress(o): global __qtModuleName if "PyQt" in __qtModuleName: import sip return sip.unwrapinstance(o) else: try: import PySide.shiboken as shiboken except ImportError: import shiboken return shiboken.getCppPointer(o)[0]
def _qtAddress( o ) : global __qtModuleName if "PyQt" in __qtModuleName : import sip return sip.unwrapinstance( o ) else : try : import PySide.shiboken as shiboken except ImportError : import shiboken return shiboken.getCppPointer( o )[0]
def WidgetCreate(self, wParentWidget): #=== Loading Ui ===# loader = QtUiTools.QUiLoader() uiFile = QtCore.QFile("TakeName.ui") uiFile.open(QtCore.QFile.ReadOnly) self.ui = loader.load(uiFile) self.oToolWidget = QtGui.QWidget() self.oLayout = QtGui.QVBoxLayout() self.oLayout.addWidget(self.ui) self.oToolWidget.setLayout(self.oLayout) uiFile.close() return shiboken.getCppPointer(self.oToolWidget)[0]
def WidgetCreate(self, pWidgetParent): # # IN parameter pWidgetparent is the memory address of the parent Qt widget. # here we should PySide.shiboken.wrapInstance() function to convert it to PySide.QtWidget object. # and use it the as the parent for native Qt widgets created via Python. # Similiar approach is available in the sip python module for PyQt # # Only a single widget is allowed to be the *direct* child of the IN parent widget. # self.mNativeQtWidget = ReferencingSample.MainForm(shiboken.wrapInstance(pWidgetParent, QtGui.QWidget)) # # return the memory address of the *single direct* child QWidget. # return shiboken.getCppPointer(self.mNativeQtWidget)[0]
def WidgetCreate(self, pWidgetParent): # # IN parameter pWidgetparent is the memory address of the parent Qt widget. # here we should PySide.shiboken.wrapInstance() function to convert it to PySide.QtWidget object. # and use it the as the parent for native Qt widgets created via Python. # Similiar approach is available in the sip python module for PyQt # # Only a single widget is allowed to be the *direct* child of the IN parent widget. # self.mNativeQtWidget = ReferencingSample.MainForm( shiboken.wrapInstance(pWidgetParent, QtGui.QWidget)) # # return the memory address of the *single direct* child QWidget. # return shiboken.getCppPointer(self.mNativeQtWidget)[0]
def getGKSConnectionId(widget, painter): return "%x!%x" % (long(shiboken.getCppPointer(widget)[0]), long(shiboken.getCppPointer(painter)[0]))
def WidgetCreate(self, widgetParent): global the_window self.widget = VRayWindow(shiboken.wrapInstance(widgetParent, QtGui.QWidget)) the_window = self.widget return shiboken.getCppPointer(self.widget)[0]
def WidgetCreate(self, pWidgetParent): self.mNativeQtWidget = Ui_TabWidget(shiboken.wrapInstance(pWidgetParent, QtGui.QWidget)) return shiboken.getCppPointer(self.mNativeQtWidget)[0]
def WidgetCreate(self, pWidgetParent): self.mNativeQtWidget = WaitDialog() return shiboken.getCppPointer(self.mNativeQtWidget)[0]
def WidgetCreate(self, pWidgetParent): # self.mNativeQtWidget = AGraphPySide.Widget.GraphWidget('in mobu') self.mNativeQtWidget = W() return shiboken.getCppPointer(self.mNativeQtWidget)[0]