Python sip 模块,unwrapinstance() 实例源码

我们从Python开源项目中,提取了以下49个代码示例,用于说明如何使用sip.unwrapinstance()

项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def getViewWidget(self):
        return self.views()[0]

    #def getViewWidget(self, widget):
        ### same pyqt bug -- mouseEvent.widget() doesn't give us the original python object.
        ### [[doesn't seem to work correctly]]
        #if HAVE_SIP and isinstance(self, sip.wrapper):
            #addr = sip.unwrapinstance(sip.cast(widget, QtGui.QWidget))
            ##print "convert", widget, addr
            #for v in self.views():
                #addr2 = sip.unwrapinstance(sip.cast(v, QtGui.QWidget))
                ##print "   check:", v, addr2
                #if addr2 == addr:
                    #return v
        #else:
            #return widget
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def qt_to_mui(self, qt_obj):
        if hostMode != "maya":
            return
        ref = None
        if qtMode in (0,2):
            # ==== for pyside ====
            ref = long(shiboken.getCppPointer(qt_obj)[0])
        elif qtMode in (1,3):
            # ==== for PyQt====
            ref = long(sip.unwrapinstance(qt_obj))
        if ref is not None:
            return mui.MQtUtil.fullName(ref)

    #=======================================
    # widget specific functions
    #=======================================
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def qt_to_mui(self, qt_obj):
        if hostMode != "maya":
            return
        ref = None
        if qtMode in (0,2):
            # ==== for pyside ====
            ref = long(shiboken.getCppPointer(qt_obj)[0])
        elif qtMode in (1,3):
            # ==== for PyQt====
            ref = long(sip.unwrapinstance(qt_obj))
        if ref is not None:
            return mui.MQtUtil.fullName(ref)

#############################################
# window instance creation
#############################################
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def qt_to_mui(self, qt_obj):
        if hostMode != "maya":
            return
        ref = None
        if qtMode in (0,2):
            # ==== for pyside ====
            ref = long(shiboken.getCppPointer(qt_obj)[0])
        elif qtMode in (1,3):
            # ==== for PyQt====
            ref = long(sip.unwrapinstance(qt_obj))
        if ref is not None:
            return mui.MQtUtil.fullName(ref)

    #------------------------------
    # TreeWidget Process Functions
    #------------------------------
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def qt_to_mui(self, qt_obj):
        if hostMode != "maya":
            return
        ref = None
        if qtMode in (0,2):
            # ==== for pyside ====
            ref = long(shiboken.getCppPointer(qt_obj)[0])
        elif qtMode in (1,3):
            # ==== for PyQt====
            ref = long(sip.unwrapinstance(qt_obj))
        if ref is not None:
            return mui.MQtUtil.fullName(ref)

#############################################
# User Class creation
#############################################

# --------------------
#  user module list
# --------------------
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def qt_to_mui(self, qt_obj):
        if hostMode != "maya":
            return
        ref = None
        if qtMode in (0,2):
            # ==== for pyside ====
            ref = long(shiboken.getCppPointer(qt_obj)[0])
        elif qtMode in (1,3):
            # ==== for PyQt====
            ref = long(sip.unwrapinstance(qt_obj))
        if ref is not None:
            return mui.MQtUtil.fullName(ref)

#############################################
# User Class creation
#############################################

# --------------------
#  user module list
# --------------------
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def qt_to_mui(self, qt_obj):
        if hostMode != "maya":
            return
        ref = None
        if qtMode in (0,2):
            # ==== for pyside ====
            ref = long(shiboken.getCppPointer(qt_obj)[0])
        elif qtMode in (1,3):
            # ==== for PyQt====
            ref = long(sip.unwrapinstance(qt_obj))
        if ref is not None:
            return mui.MQtUtil.fullName(ref)

#############################################
# window instance creation
#############################################
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def qt_to_mui(self, qt_obj):
        if hostMode != "maya":
            return
        ref = None
        if qtMode in (0,2):
            # ==== for pyside ====
            ref = long(shiboken.getCppPointer(qt_obj)[0])
        elif qtMode in (1,3):
            # ==== for PyQt====
            ref = long(sip.unwrapinstance(qt_obj))
        if ref is not None:
            return mui.MQtUtil.fullName(ref)

    #------------------------------
    # TreeWidget Process Functions
    #------------------------------
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def listQThreads():
    """Prints Thread IDs (Qt's, not OS's) for all QThreads."""
    thr = findObj('[Tt]hread')
    thr = [t for t in thr if isinstance(t, QtCore.QThread)]
    import sip
    for t in thr:
        print("--> ", t)
        print("     Qt ID: 0x%x" % sip.unwrapinstance(t))
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def registerObject(cls, obj):
        """
        Workaround for PyQt bug in qgraphicsscene.items()
        All subclasses of QGraphicsObject must register themselves with this function.
        (otherwise, mouse interaction with those objects will likely fail)
        """
        if HAVE_SIP and isinstance(obj, sip.wrapper):
            cls._addressCache[sip.unwrapinstance(sip.cast(obj, QtGui.QGraphicsItem))] = obj
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def items(self, *args):
        #print 'args:', args
        items = QtGui.QGraphicsScene.items(self, *args)
        ## PyQt bug: items() returns a list of QGraphicsItem instances. If the item is subclassed from QGraphicsObject,
        ## then the object returned will be different than the actual item that was originally added to the scene
        items2 = list(map(self.translateGraphicsItem, items))
        #if HAVE_SIP and isinstance(self, sip.wrapper):
            #items2 = []
            #for i in items:
                #addr = sip.unwrapinstance(sip.cast(i, QtGui.QGraphicsItem))
                #i2 = GraphicsScene._addressCache.get(addr, i)
                ##print i, "==>", i2
                #items2.append(i2)
        #print 'items:', items
        return items2
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def selectedItems(self, *args):
        items = QtGui.QGraphicsScene.selectedItems(self, *args)
        ## PyQt bug: items() returns a list of QGraphicsItem instances. If the item is subclassed from QGraphicsObject,
        ## then the object returned will be different than the actual item that was originally added to the scene
        #if HAVE_SIP and isinstance(self, sip.wrapper):
            #items2 = []
            #for i in items:
                #addr = sip.unwrapinstance(sip.cast(i, QtGui.QGraphicsItem))
                #i2 = GraphicsScene._addressCache.get(addr, i)
                ##print i, "==>", i2
                #items2.append(i2)
        items2 = list(map(self.translateGraphicsItem, items))

        #print 'items:', items
        return items2
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def itemAt(self, *args):
        item = QtGui.QGraphicsScene.itemAt(self, *args)

        ## PyQt bug: items() returns a list of QGraphicsItem instances. If the item is subclassed from QGraphicsObject,
        ## then the object returned will be different than the actual item that was originally added to the scene
        #if HAVE_SIP and isinstance(self, sip.wrapper):
            #addr = sip.unwrapinstance(sip.cast(item, QtGui.QGraphicsItem))
            #item = GraphicsScene._addressCache.get(addr, item)
        #return item
        return self.translateGraphicsItem(item)
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def translateGraphicsItem(item):
        ## for fixing pyqt bugs where the wrong item is returned
        if HAVE_SIP and isinstance(item, sip.wrapper):
            addr = sip.unwrapinstance(sip.cast(item, QtGui.QGraphicsItem))
            item = GraphicsScene._addressCache.get(addr, item)
        return item
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def listQThreads():
    """Prints Thread IDs (Qt's, not OS's) for all QThreads."""
    thr = findObj('[Tt]hread')
    thr = [t for t in thr if isinstance(t, QtCore.QThread)]
    import sip
    for t in thr:
        print("--> ", t)
        print("     Qt ID: 0x%x" % sip.unwrapinstance(t))
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def registerObject(cls, obj):
        """
        Workaround for PyQt bug in qgraphicsscene.items()
        All subclasses of QGraphicsObject must register themselves with this function.
        (otherwise, mouse interaction with those objects will likely fail)
        """
        if HAVE_SIP and isinstance(obj, sip.wrapper):
            cls._addressCache[sip.unwrapinstance(sip.cast(obj, QtGui.QGraphicsItem))] = obj
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def items(self, *args):
        #print 'args:', args
        items = QtGui.QGraphicsScene.items(self, *args)
        ## PyQt bug: items() returns a list of QGraphicsItem instances. If the item is subclassed from QGraphicsObject,
        ## then the object returned will be different than the actual item that was originally added to the scene
        items2 = list(map(self.translateGraphicsItem, items))
        #if HAVE_SIP and isinstance(self, sip.wrapper):
            #items2 = []
            #for i in items:
                #addr = sip.unwrapinstance(sip.cast(i, QtGui.QGraphicsItem))
                #i2 = GraphicsScene._addressCache.get(addr, i)
                ##print i, "==>", i2
                #items2.append(i2)
        #print 'items:', items
        return items2
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def selectedItems(self, *args):
        items = QtGui.QGraphicsScene.selectedItems(self, *args)
        ## PyQt bug: items() returns a list of QGraphicsItem instances. If the item is subclassed from QGraphicsObject,
        ## then the object returned will be different than the actual item that was originally added to the scene
        #if HAVE_SIP and isinstance(self, sip.wrapper):
            #items2 = []
            #for i in items:
                #addr = sip.unwrapinstance(sip.cast(i, QtGui.QGraphicsItem))
                #i2 = GraphicsScene._addressCache.get(addr, i)
                ##print i, "==>", i2
                #items2.append(i2)
        items2 = list(map(self.translateGraphicsItem, items))

        #print 'items:', items
        return items2
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def translateGraphicsItem(item):
        ## for fixing pyqt bugs where the wrong item is returned
        if HAVE_SIP and isinstance(item, sip.wrapper):
            addr = sip.unwrapinstance(sip.cast(item, QtGui.QGraphicsItem))
            item = GraphicsScene._addressCache.get(addr, item)
        return item
项目:zoocore    作者:dsparrow27    | 项目源码 | 文件源码
def _pyqt5():
    """Initialise PyQt5"""

    import PyQt5 as module
    _setup(module, ["uic"])

    try:
        import sip
        Qt.QtCompat.wrapInstance = (
            lambda ptr, base=None: _wrapinstance(
                sip.wrapinstance, ptr, base)
        )
        Qt.QtCompat.getCppPointer = lambda object: \
            sip.unwrapinstance(object)

    except ImportError:
        pass  # Optional

    if hasattr(Qt, "_uic"):
        Qt.QtCompat.loadUi = _loadUi

    if hasattr(Qt, "_QtCore"):
        Qt.__binding_version__ = Qt._QtCore.PYQT_VERSION_STR
        Qt.__qt_version__ = Qt._QtCore.QT_VERSION_STR
        Qt.QtCompat.translate = Qt._QtCore.QCoreApplication.translate

    if hasattr(Qt, "_QtWidgets"):
        Qt.QtCompat.setSectionResizeMode = \
            Qt._QtWidgets.QHeaderView.setSectionResizeMode

    _reassign_misplaced_members("pyqt5")
项目:maya-pulse    作者:bohdon    | 项目源码 | 文件源码
def _pyqt5():
    """Initialise PyQt5"""

    import PyQt5 as module
    _setup(module, ["uic"])

    try:
        import sip
        Qt.QtCompat.wrapInstance = (
            lambda ptr, base=None: _wrapinstance(
                sip.wrapinstance, ptr, base)
        )
        Qt.QtCompat.getCppPointer = lambda object: \
            sip.unwrapinstance(object)

    except ImportError:
        pass  # Optional

    if hasattr(Qt, "_uic"):
        Qt.QtCompat.loadUi = _loadUi

    if hasattr(Qt, "_QtCore"):
        Qt.__binding_version__ = Qt._QtCore.PYQT_VERSION_STR
        Qt.__qt_version__ = Qt._QtCore.QT_VERSION_STR
        Qt.QtCompat.translate = Qt._QtCore.QCoreApplication.translate

    if hasattr(Qt, "_QtWidgets"):
        Qt.QtCompat.setSectionResizeMode = \
            Qt._QtWidgets.QHeaderView.setSectionResizeMode

    _reassign_misplaced_members("PyQt5")
    _build_compatibility_members('PyQt5')
项目:surume    作者:tm8r    | 项目源码 | 文件源码
def _pyqt5():
    """Initialise PyQt5"""

    import PyQt5 as module
    _setup(module, ["uic"])

    try:
        import sip
        Qt.QtCompat.wrapInstance = (
            lambda ptr, base=None: _wrapinstance(
                sip.wrapinstance, ptr, base)
        )
        Qt.QtCompat.getCppPointer = lambda object: \
            sip.unwrapinstance(object)

    except ImportError:
        pass  # Optional

    if hasattr(Qt, "_uic"):
        Qt.QtCompat.loadUi = _loadUi

    if hasattr(Qt, "_QtCore"):
        Qt.__binding_version__ = Qt._QtCore.PYQT_VERSION_STR
        Qt.__qt_version__ = Qt._QtCore.QT_VERSION_STR
        Qt.QtCompat.translate = Qt._QtCore.QCoreApplication.translate

    if hasattr(Qt, "_QtWidgets"):
        Qt.QtCompat.setSectionResizeMode = \
            Qt._QtWidgets.QHeaderView.setSectionResizeMode

    _reassign_misplaced_members("PyQt5")
    _build_compatibility_members('PyQt5')
项目:coconodz    作者:rkoschmitzky    | 项目源码 | 文件源码
def _pyqt5():
    """Initialise PyQt5"""

    import PyQt5 as module
    _setup(module, ["uic"])

    try:
        import sip
        Qt.QtCompat.wrapInstance = (
            lambda ptr, base=None: _wrapinstance(
                sip.wrapinstance, ptr, base)
        )
        Qt.QtCompat.getCppPointer = lambda object: \
            sip.unwrapinstance(object)

    except ImportError:
        pass  # Optional

    if hasattr(Qt, "_uic"):
        Qt.QtCompat.loadUi = _loadUi

    if hasattr(Qt, "_QtCore"):
        Qt.__binding_version__ = Qt._QtCore.PYQT_VERSION_STR
        Qt.__qt_version__ = Qt._QtCore.QT_VERSION_STR
        Qt.QtCompat.translate = Qt._QtCore.QCoreApplication.translate

    if hasattr(Qt, "_QtWidgets"):
        Qt.QtCompat.setSectionResizeMode = \
            Qt._QtWidgets.QHeaderView.setSectionResizeMode

    _reassign_misplaced_members("PyQt5")
    _build_compatibility_members('PyQt5')
项目:dm2skin    作者:duncanskertchly    | 项目源码 | 文件源码
def _pyqt5():
    """Initialise PyQt5"""

    import PyQt5 as module
    _setup(module, ["uic"])

    try:
        import sip
        Qt.QtCompat.wrapInstance = (
            lambda ptr, base=None: _wrapinstance(
                sip.wrapinstance, ptr, base)
        )
        Qt.QtCompat.getCppPointer = lambda object: \
            sip.unwrapinstance(object)

    except ImportError:
        pass  # Optional

    if hasattr(Qt, "_uic"):
        Qt.QtCompat.loadUi = _loadUi

    if hasattr(Qt, "_QtCore"):
        Qt.__binding_version__ = Qt._QtCore.PYQT_VERSION_STR
        Qt.__qt_version__ = Qt._QtCore.QT_VERSION_STR
        Qt.QtCompat.translate = Qt._QtCore.QCoreApplication.translate

    if hasattr(Qt, "_QtWidgets"):
        Qt.QtCompat.setSectionResizeMode = \
            Qt._QtWidgets.QHeaderView.setSectionResizeMode

    _reassign_misplaced_members("pyqt5")
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def qt_to_mui(self, qt_obj):
        ref = None
        if qtMode == 0:
            # ==== for pyside ====
            ref = long(shiboken.getCppPointer(qt_obj)[0])
        elif qtMode == 1:
            # ==== for PyQt====
            ref = long(sip.unwrapinstance(qt_obj))
        if ref is not None:
            return mui.MQtUtil.fullName(ref)

#############################################
# window instance creation
#############################################
# If you want to be able to Keep only one copy of windows ui in Maya, use code below
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def qt_to_mui(self, qt_obj):
        if hostMode != "maya":
            return
        ref = None
        if qtMode in (0,2):
            # ==== for pyside ====
            ref = long(shiboken.getCppPointer(qt_obj)[0])
        elif qtMode in (1,3):
            # ==== for PyQt====
            ref = long(sip.unwrapinstance(qt_obj))
        if ref is not None:
            return mui.MQtUtil.fullName(ref)
#############################################
# window instance creation
#############################################
项目:core    作者:getavalon    | 项目源码 | 文件源码
def _pyqt5():
    """Initialise PyQt5"""

    import PyQt5 as module
    _setup(module, ["uic"])

    try:
        import sip
        Qt.QtCompat.wrapInstance = (
            lambda ptr, base=None: _wrapinstance(
                sip.wrapinstance, ptr, base)
        )
        Qt.QtCompat.getCppPointer = lambda object: \
            sip.unwrapinstance(object)

    except ImportError:
        pass  # Optional

    if hasattr(Qt, "_uic"):
        Qt.QtCompat.loadUi = _loadUi

    if hasattr(Qt, "_QtCore"):
        Qt.__binding_version__ = Qt._QtCore.PYQT_VERSION_STR
        Qt.__qt_version__ = Qt._QtCore.QT_VERSION_STR
        Qt.QtCompat.translate = Qt._QtCore.QCoreApplication.translate

    if hasattr(Qt, "_QtWidgets"):
        Qt.QtCompat.setSectionResizeMode = \
            Qt._QtWidgets.QHeaderView.setSectionResizeMode

    _reassign_misplaced_members("pyqt5")
项目:Qt.py    作者:mottosso    | 项目源码 | 文件源码
def _pyqt5():
    """Initialise PyQt5"""

    import PyQt5 as module
    _setup(module, ["uic"])

    try:
        import sip
        Qt.QtCompat.wrapInstance = (
            lambda ptr, base=None: _wrapinstance(
                sip.wrapinstance, ptr, base)
        )
        Qt.QtCompat.getCppPointer = lambda object: \
            sip.unwrapinstance(object)

    except ImportError:
        pass  # Optional

    if hasattr(Qt, "_uic"):
        Qt.QtCompat.loadUi = _loadUi

    if hasattr(Qt, "_QtCore"):
        Qt.__binding_version__ = Qt._QtCore.PYQT_VERSION_STR
        Qt.__qt_version__ = Qt._QtCore.QT_VERSION_STR
        Qt.QtCompat.qInstallMessageHandler = _qInstallMessageHandler
        Qt.QtCompat.translate = Qt._QtCore.QCoreApplication.translate

    if hasattr(Qt, "_QtWidgets"):
        Qt.QtCompat.setSectionResizeMode = \
            Qt._QtWidgets.QHeaderView.setSectionResizeMode

    _reassign_misplaced_members("PyQt5")
    _build_compatibility_members('PyQt5')
项目:auri    作者:Sookhaal    | 项目源码 | 文件源码
def _pyqt5():
    """Initialise PyQt5"""

    import PyQt5 as module
    _setup(module, ["uic"])

    try:
        import sip
        Qt.QtCompat.wrapInstance = (
            lambda ptr, base=None: _wrapinstance(
                sip.wrapinstance, ptr, base)
        )
        Qt.QtCompat.getCppPointer = lambda object: \
            sip.unwrapinstance(object)

    except ImportError:
        pass  # Optional

    if hasattr(Qt, "_uic"):
        Qt.QtCompat.loadUi = _loadUi

    if hasattr(Qt, "_QtCore"):
        Qt.__binding_version__ = Qt._QtCore.PYQT_VERSION_STR
        Qt.__qt_version__ = Qt._QtCore.QT_VERSION_STR
        Qt.QtCompat.translate = Qt._QtCore.QCoreApplication.translate

    if hasattr(Qt, "_QtWidgets"):
        Qt.QtCompat.setSectionResizeMode = \
            Qt._QtWidgets.QHeaderView.setSectionResizeMode

    _reassign_misplaced_members("PyQt5")
    _build_compatibility_members('PyQt5')
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")
项目:vulkan-tutorial    作者:mackst    | 项目源码 | 文件源码
def __createSurface(self):
        if sys.platform == 'win32':
            vkCreateWin32SurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateWin32SurfaceKHR')

            hwnd = self.winId()
            hinstance = Win32misc.getInstance(hwnd)
            createInfo = VkWin32SurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
                hinstance=hinstance,
                hwnd=hwnd
            )
            self.__surface = vkCreateWin32SurfaceKHR(self.__instance, createInfo, None)
        elif sys.platform == 'linux' or sys.platform == 'linux2':
            from PyQt5 import QtX11Extras
            import sip

            vkCreateXcbSurfaceKHR = vkGetInstanceProcAddr(self.__instance, 'vkCreateXcbSurfaceKHR')

            connection = sip.unwrapinstance(QtX11Extras.QX11Info.connection())
            createInfo = VkXcbSurfaceCreateInfoKHR(
                sType=VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
                connection=connection,
                window=self.winId()
            )
            self.__surface = vkCreateXcbSurfaceKHR(self.__instance, createInfo, None)
        if self.__surface is None:
            raise Exception("failed to create window surface!")