当前位置: 首页>>代码示例>>Python>>正文


Python sip.delete方法代码示例

本文整理汇总了Python中sip.delete方法的典型用法代码示例。如果您正苦于以下问题:Python sip.delete方法的具体用法?Python sip.delete怎么用?Python sip.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sip的用法示例。


在下文中一共展示了sip.delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: toggleFullscreen

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def toggleFullscreen(self) -> None:
        if self.mediaAvailable:
            pause = self.mpvWidget.property('pause')
            mute = self.mpvWidget.property('mute')
            vol = self.mpvWidget.property('volume')
            pos = self.seekSlider.value() / 1000
            if self.mpvWidget.originalParent is not None:
                self.mpvWidget.shutdown()
                sip.delete(self.mpvWidget)
                del self.mpvWidget
                self.mpvWidget = self.getMPV(parent=self, file=self.currentMedia, start=pos, pause=pause, mute=mute,
                                             volume=vol)
                self.videoplayerLayout.insertWidget(0, self.mpvWidget)
                self.mpvWidget.originalParent = None
                self.parent.show()
            elif self.mpvWidget.parentWidget() != 0:
                self.parent.hide()
                self.mpvWidget.shutdown()
                self.videoplayerLayout.removeWidget(self.mpvWidget)
                sip.delete(self.mpvWidget)
                del self.mpvWidget
                self.mpvWidget = self.getMPV(file=self.currentMedia, start=pos, pause=pause, mute=mute, volume=vol)
                self.mpvWidget.originalParent = self
                self.mpvWidget.setGeometry(qApp.desktop().screenGeometry(self))
                self.mpvWidget.showFullScreen() 
开发者ID:ozmartian,项目名称:vidcutter,代码行数:27,代码来源:videocutter.py

示例2: _showSomething

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def _showSomething(self, **kwgs):
        MW = self.parent()

        if MW.objectName() == "MainWindow":

            try:
                #                    MW.Buttom_Vbox.setParent(None)#这是个严重的问题,如果用这个函数会造成78L无法成功
                _parent = MW.Buttom_Vbox.parent()  # 获取下面窗体对象的指针
                for obj in _parent.children():
                    #print(obj)
                    sip.delete(obj)

                MW.Buttom_Vbox = QVBoxLayout(_parent)
                MW.Buttom_Vbox.setContentsMargins(0, 0, 0, 0)
                MW.Buttom_Vbox.setSpacing(0)
                MW.Buttom_Vbox.setObjectName("Buttom_Vbox")

            except:
                showERROR() 
开发者ID:dongzhang0725,项目名称:PhyloSuite,代码行数:21,代码来源:CustomWidget.py

示例3: unload

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def unload(self, mod: "str"):
        """
        3. 卸载插件 , 移除模块.
        """
        if mod in sys.modules:
            self.pluginsInfo["StartModule"][mod]["active"] = False
            #删除对象
            objInfo = self.findOldObj(mod)
            oldObj  = objInfo["oldObj"] 
            oldObj.flag="unload"
            sip.delete(oldObj)

            self.pluginsInfo["StartModule"][mod]["old"] = None
            sys.modules.pop(mod)
        
        return True
        
    # 卸载所有插件 
开发者ID:PyQt5,项目名称:PyQt,代码行数:20,代码来源:PluginManager.py

示例4: tearDown

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def tearDown(self):
        if hasattr(self, "dialog"):
            self.dialog.close()

            try:
                sip.delete(self.dialog)
            except TypeError:
                pass
            self.dialog = None

        if hasattr(self, "form"):
            self.form.close_all_files()
            self.form.close()

            try:
                sip.delete(self.form)
            except TypeError:
                pass
            self.form = None

        gc.collect() 
开发者ID:jopohl,项目名称:urh,代码行数:23,代码来源:QtTestCase.py

示例5: convert_app_for_timing

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def convert_app_for_timing(app: QApplication) -> QApplication:
    """If necessary replace existing app with our special perfmon one.

    Parameters
    ----------
    app : QApplication
        The existing application if any.
    """
    if isinstance(app, QApplicationWithTiming):
        # We're already using QApplicationWithTiming so there is nothing
        # to do. This happens when napari is launched from the command
        # line because we create a QApplicationWithTiming in gui_qt.
        return app

    if app is not None:

        # Because we can't monkey patch QApplication.notify, since it's a
        # SIP wrapped C++ method, we delete the current app and create a new one.
        # This must be done very early before any Qt objects are created.
        import sip

        sip.delete(app)

    # Is it right to pass in sys.argv here? I think so if there are any
    # Qt flags on there?
    return QApplicationWithTiming(sys.argv) 
开发者ID:napari,项目名称:napari,代码行数:28,代码来源:qt_event_timing.py

示例6: test_deleted_object

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def test_deleted_object(qtbot):
    class Obj(QObject):

        def func(self):
            self.setObjectName("test")

    obj = Obj()

    throttled = throttle.Throttle(obj.func, DELAY, parent=obj)
    throttled()
    throttled()

    sip.delete(obj)

    qtbot.wait(int(1.5 * DELAY)) 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:17,代码来源:test_throttle.py

示例7: _pyside

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def _pyside():
    """Initialise PySide"""

    import PySide as module
    extras = ["QtUiTools"]
    try:
        try:
            # Before merge of PySide and shiboken
            import shiboken
        except ImportError:
            # After merge of PySide and shiboken, May 2017
            from PySide import shiboken
        extras.append("shiboken")
    except ImportError:
        pass

    _setup(module, extras)
    Qt.__binding_version__ = module.__version__

    if hasattr(Qt, "_shiboken"):
        Qt.QtCompat.wrapInstance = _wrapinstance
        Qt.QtCompat.getCppPointer = _getcpppointer
        Qt.QtCompat.delete = shiboken.delete

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

    if hasattr(Qt, "_QtGui"):
        setattr(Qt, "QtWidgets", _new_module("QtWidgets"))
        setattr(Qt, "_QtWidgets", Qt._QtGui)
        if hasattr(Qt._QtGui, "QX11Info"):
            setattr(Qt, "QtX11Extras", _new_module("QtX11Extras"))
            Qt.QtX11Extras.QX11Info = Qt._QtGui.QX11Info

        Qt.QtCompat.setSectionResizeMode = Qt._QtGui.QHeaderView.setResizeMode

    if hasattr(Qt, "_QtCore"):
        Qt.__qt_version__ = Qt._QtCore.qVersion()

    _reassign_misplaced_members("PySide")
    _build_compatibility_members("PySide") 
开发者ID:getavalon,项目名称:core,代码行数:43,代码来源:Qt.py

示例8: _pyqt5

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def _pyqt5():
    """Initialise PyQt5"""

    import PyQt5 as module
    extras = ["uic"]
    try:
        import sip
        extras.append(sip.__name__)
    except ImportError:
        sip = None

    _setup(module, extras)
    if hasattr(Qt, "_sip"):
        Qt.QtCompat.wrapInstance = _wrapinstance
        Qt.QtCompat.getCppPointer = _getcpppointer
        Qt.QtCompat.delete = sip.delete

    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

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

    _reassign_misplaced_members("PyQt5")
    _build_compatibility_members('PyQt5') 
开发者ID:getavalon,项目名称:core,代码行数:32,代码来源:Qt.py

示例9: _pyqt5

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def _pyqt5():
    """Initialise PyQt5"""

    import PyQt5 as module
    extras = ["uic"]

    try:
        import sip
        extras += ["sip"]
    except ImportError:

        # Relevant to PyQt5 5.11 and above
        try:
            from PyQt5 import sip
            extras += ["sip"]
        except ImportError:
            sip = None

    _setup(module, extras)
    if hasattr(Qt, "_sip"):
        Qt.QtCompat.wrapInstance = _wrapinstance
        Qt.QtCompat.getCppPointer = _getcpppointer
        Qt.QtCompat.delete = sip.delete

    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.dataChanged = (
            lambda self, topleft, bottomright, roles=None:
            self.dataChanged.emit(topleft, bottomright, roles or [])
        )

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

    _reassign_misplaced_members("PyQt5")
    _build_compatibility_members('PyQt5') 
开发者ID:nilouco,项目名称:dpAutoRigSystem,代码行数:43,代码来源:Qt.py

示例10: __cleanupCanvas

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def __cleanupCanvas(self):
        """Cleans up the canvas"""
        if self.__canvas is not None:
            self.__canvas.cleanup()
            self.__canvas = None
        for item in self.scene().items():
            sip.delete(item)
        self.scene().clear() 
开发者ID:SergeySatskiy,项目名称:codimension,代码行数:10,代码来源:flowuiwidget.py

示例11: eraseItem

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def eraseItem(self):
        for x in self.ui.treeWidget_2.selectedItems():#delete with write click menu
            #item = self.ui.treewidget.takeItem(self.ui.treewidget.currentRow())
            sip.delete(x)
            #item.delete 
开发者ID:Seedarchangel,项目名称:TuChart,代码行数:7,代码来源:main.py

示例12: __init__

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def __init__(self, *args):
        super(SearchQLineEdit, self).__init__(*args)
        self.buttonSearch = QToolButton(self)
        self.buttonSearch.setAutoRaise(True)
        self.buttonSearch.setToolTip("Search")
        self.buttonSearch.setCursor(Qt.PointingHandCursor)
        self.buttonSearch.setFocusPolicy(Qt.NoFocus)
        self.buttonSearch.setIcon(QIcon(":/picture/resourses/search.png"))
        self.buttonSearch.setStyleSheet("QToolButton {border: none;}")
        self.buttonStop = QToolButton(self)
        self.buttonStop.setAutoRaise(True)
        self.buttonStop.setToolTip("Stop")
        self.buttonStop.setCursor(Qt.PointingHandCursor)
        self.buttonStop.setFocusPolicy(Qt.NoFocus)
        self.buttonStop.setIcon(QIcon(":/picture/resourses/delete.png"))
        self.buttonStop.setStyleSheet("QToolButton {border: none;}")
        self.buttonStop.setDisabled(True)
        # self.buttonSearch.clicked.connect(self.viewFileContent)
        layout = QHBoxLayout(self)
        layout.addStretch()
        layout.addWidget(self.buttonSearch, 0, Qt.AlignRight)
        layout.addWidget(self.buttonStop, 0, Qt.AlignRight)
        layout.setSpacing(6)
        layout.setContentsMargins(5, 0, 5, 0)
        frameWidth = self.style().pixelMetric(QStyle.PM_DefaultFrameWidth)
        rightButtonWidth1 = self.buttonSearch.sizeHint().width()
        rightButtonWidth2 = self.buttonStop.sizeHint().width()
        self.setTextMargins(5, 0, rightButtonWidth1 + rightButtonWidth2 + frameWidth + 7, 0) ##这里设置一下距离 
开发者ID:dongzhang0725,项目名称:PhyloSuite,代码行数:30,代码来源:CustomWidget.py

示例13: reload

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def reload(self, mod):
        """
        2.2 重载插件.
        """
        if mod in sys.modules:
            #TODO: 旧对象替换
            print("reload")
            importlib.reload(sys.modules[mod])
            moduleObj = sys.modules[mod]
            try:
                objInfo = self.findOldObj(mod, moduleObj , True)
            except:
                errmsg = traceback.format_exc()
                
                QMessageBox.information(self.__mw,
                                        "模块导入异常",
                                        "%s,请在%s.py检查模块."%(errmsg,mod ))
                
            oldObj, newObj, layout = objInfo["oldObj"],\
                                     objInfo["newObj"],\
                                     objInfo["layout"]
                                     
            # 新对象替换旧对象 , 并把地址赋值给旧对象
            layout.replaceWidget(oldObj, newObj )
            self.pluginsInfo["StartModule"][mod]["old"] = newObj
            oldObj.flag="reload"
            sip.delete(oldObj)
        else:
            self.load(mod) 
开发者ID:PyQt5,项目名称:PyQt,代码行数:31,代码来源:PluginManager.py

示例14: onPrepareQA

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def onPrepareQA(self, html, card, context):
        if self.settings['prioEnabled']:
            answerShortcuts = ['1', '2', '3', '4']
        else:
            answerShortcuts = ['4']

        activeAnswerShortcuts = [
            next(
                (s for s in mw.stateShortcuts if s.key().toString() == i), None
            )
            for i in answerShortcuts
        ]

        if isIrCard(card):
            if context == 'reviewQuestion':
                self.qshortcuts = mw.applyShortcuts(self.shortcuts)
                mw.stateShortcuts += self.qshortcuts
            for shortcut in activeAnswerShortcuts:
                if shortcut:
                    mw.stateShortcuts.remove(shortcut)
                    sip.delete(shortcut)
        else:
            for shortcut in answerShortcuts:
                if not activeAnswerShortcuts[answerShortcuts.index(shortcut)]:
                    mw.stateShortcuts += mw.applyShortcuts(
                        [
                            (
                                shortcut,
                                lambda: mw.reviewer._answerCard(int(shortcut)),
                            )
                        ]
                    )

        return html 
开发者ID:luoliyan,项目名称:incremental-reading,代码行数:36,代码来源:main.py

示例15: onShowAnswer

# 需要导入模块: import sip [as 别名]
# 或者: from sip import delete [as 别名]
def onShowAnswer(self):
        for qs in self.qshortcuts:
            mw.stateShortcuts.remove(qs)
            sip.delete(qs) 
开发者ID:luoliyan,项目名称:incremental-reading,代码行数:6,代码来源:main.py


注:本文中的sip.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。