當前位置: 首頁>>代碼示例>>Python>>正文


Python sip.delete方法代碼示例

本文整理匯總了Python中PyQt5.sip.delete方法的典型用法代碼示例。如果您正苦於以下問題:Python sip.delete方法的具體用法?Python sip.delete怎麽用?Python sip.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt5.sip的用法示例。


在下文中一共展示了sip.delete方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _pyqt5

# 需要導入模塊: from PyQt5 import sip [as 別名]
# 或者: from PyQt5.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

示例2: remove_selected

# 需要導入模塊: from PyQt5 import sip [as 別名]
# 或者: from PyQt5.sip import delete [as 別名]
def remove_selected(self):
        keys = set(self.selected_keys())
        if not keys:
            return error_dialog(self, _('No entries selected'), _(
                'You must select an entry to remove'))
        changed = False
        for key in keys:
            if question_dialog(self, _('Are you sure?'), _(
                    'Are you sure you want to permanently delete all data for: <b>{0}</b>').format(key)):
                del self.db[key]
                changed = True
        if changed:
            self.model.refresh(self.db) 
開發者ID:kovidgoyal,項目名稱:vise,代碼行數:15,代碼來源:gui.py

示例3: standalone

# 需要導入模塊: from PyQt5 import sip [as 別名]
# 或者: from PyQt5.sip import delete [as 別名]
def standalone(password, path=None):
    from ..main import Application
    db = PasswordDB(password, path)
    app = Application([])
    d = PasswordManager(db)
    d.exec_()
    sip.delete(d)
    sip.delete(app) 
開發者ID:kovidgoyal,項目名稱:vise,代碼行數:10,代碼來源:gui.py

示例4: run_app

# 需要導入模塊: from PyQt5 import sip [as 別名]
# 或者: from PyQt5.sip import delete [as 別名]
def run_app(
        urls=(), callback=None, callback_wait=0,
        master_password=None, new_instance=False, shutdown=False, restart_state=None, no_session=False, startup_session=None):
    env = os.environ.copy()
    app = Application(
        master_password=master_password, urls=urls, new_instance=new_instance, shutdown=shutdown, restart_state=restart_state, no_session=no_session)
    os.environ['QTWEBENGINE_DICTIONARIES_PATH'] = os.path.join(config_dir, 'spell')
    app.original_env = env
    style = Style()
    app.setStyle(style)
    try:
        if startup_session is not None:
            with open(startup_session, 'rb') as f:
                app.unserialize_state(pickle.load(f))
        elif restart_state is not None:
            app.unserialize_state(restart_state)
        else:
            last_session = last_saved_session(no_session)
            if last_session is None or urls:
                app.open_urls(urls)
            else:
                app.unserialize_state(last_session)
        if callback is not None:
            QTimer.singleShot(callback_wait, callback)
        app.exec_()
    finally:
        app.break_cycles()
        delete_profile()
        places.close()
        app.sendPostedEvents()
        restart_state = getattr(app, 'restart_state', None)
        original_env = app.original_env
        sip.delete(app)
        del app
        gc.collect(), gc.collect(), gc.collect()
        if restart_state is not None:
            restart(restart_state, original_env) 
開發者ID:kovidgoyal,項目名稱:vise,代碼行數:39,代碼來源:main.py

示例5: _pyqt5

# 需要導入模塊: from PyQt5 import sip [as 別名]
# 或者: from PyQt5.sip import delete [as 別名]
def _pyqt5():
    """Initialise PyQt5"""

    import PyQt5 as module
    extras = ["uic"]

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

        try:
            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:mottosso,項目名稱:Qt.py,代碼行數:43,代碼來源:Qt.py

示例6: _pyside2

# 需要導入模塊: from PyQt5 import sip [as 別名]
# 或者: from PyQt5.sip import delete [as 別名]
def _pyside2():
    """Initialise PySide2

    These functions serve to test the existence of a binding
    along with set it up in such a way that it aligns with
    the final step; adding members from the original binding
    to Qt.py

    """

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

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

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

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

    if hasattr(Qt, "_QtCore"):
        Qt.__qt_version__ = Qt._QtCore.qVersion()
        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("PySide2")
    _build_compatibility_members("PySide2") 
開發者ID:nilouco,項目名稱:dpAutoRigSystem,代碼行數:49,代碼來源:Qt.py

示例7: _pyside

# 需要導入模塊: from PyQt5 import sip [as 別名]
# 或者: from PyQt5.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()
        Qt.QtCompat.dataChanged = (
            lambda self, topleft, bottomright, roles=None:
            self.dataChanged.emit(topleft, bottomright)
        )

    _reassign_misplaced_members("PySide")
    _build_compatibility_members("PySide") 
開發者ID:nilouco,項目名稱:dpAutoRigSystem,代碼行數:47,代碼來源:Qt.py


注:本文中的PyQt5.sip.delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。