本文整理汇总了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')
示例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)
示例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)
示例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)
示例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')
示例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")
示例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")