本文整理匯總了Python中Qt.QtCore.QObject方法的典型用法代碼示例。如果您正苦於以下問題:Python QtCore.QObject方法的具體用法?Python QtCore.QObject怎麽用?Python QtCore.QObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Qt.QtCore
的用法示例。
在下文中一共展示了QtCore.QObject方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from Qt import QtCore [as 別名]
# 或者: from Qt.QtCore import QObject [as 別名]
def __init__(self, parent=None, master=None):
""" Syntax highlighter for an individual document in the app.
:Parameters:
parent : `QtCore.QObject`
Can install to a `QTextEdit` or `QTextDocument` to apply highlighting.
master : `MasterHighlighter` | None
Master object containing shared highlighting rules.
"""
super(Highlighter, self).__init__(parent)
self.master = master or self.masterClass(self)
self.findPhrase = None
self.dirty = False
# Connect this directly to self.rehighlight if we can ever manage to thread or speed that up.
self.master.dirtied.connect(self.setDirty)
示例2: __init__
# 需要導入模塊: from Qt import QtCore [as 別名]
# 或者: from Qt.QtCore import QObject [as 別名]
def __init__(self):
QtCore.QObject.__init__(self)
self.on=False
self.displayObjects=False
self.t=[]
self.z=0
self.LMpress=False
示例3: __init__
# 需要導入模塊: from Qt import QtCore [as 別名]
# 或者: from Qt.QtCore import QObject [as 別名]
def __init__(self):
QtCore.QObject.__init__(self)
self.on=False
self.displayObjects=False
self.t=[]
self.z=0
self.LMpress=False
self.released=0
self.count=0
示例4: __init__
# 需要導入模塊: from Qt import QtCore [as 別名]
# 或者: from Qt.QtCore import QObject [as 別名]
def __init__(self, parent):
QtCore.QObject.__init__(self, parent)
sys.stdout = self
示例5: dropable
# 需要導入模塊: from Qt import QtCore [as 別名]
# 或者: from Qt.QtCore import QObject [as 別名]
def dropable(widget):
class Filter(QtCore.QObject):
drop_in = QtCore.Signal(list)
def eventFilter(self, obj, event):
if obj == widget:
if event.type() in [QtCore.QEvent.DragEnter, QtCore.QEvent.DragMove]:
if event.mimeData().hasUrls():
event.acceptProposedAction()
return True
else:
event.ignore()
return False
if event.type() == QtCore.QEvent.Drop:
in_paths = []
for url in event.mimeData().urls():
path = url.toLocalFile()
in_paths.append(path)
self.drop_in.emit(in_paths)
return True
return False
if hasattr(widget, "setAcceptDrops"):
widget.setAcceptDrops(True)
obj = Filter(widget)
widget.installEventFilter(obj)
return obj.drop_in
示例6: test_load_ui_returntype
# 需要導入模塊: from Qt import QtCore [as 別名]
# 或者: from Qt.QtCore import QObject [as 別名]
def test_load_ui_returntype():
"""load_ui returns an instance of QObject"""
import sys
from Qt import QtWidgets, QtCore, QtCompat
app = QtWidgets.QApplication(sys.argv)
obj = QtCompat.loadUi(self.ui_qwidget)
assert isinstance(obj, QtCore.QObject)
app.exit()
示例7: test_isValid
# 需要導入模塊: from Qt import QtCore [as 別名]
# 或者: from Qt.QtCore import QObject [as 別名]
def test_isValid():
""".isValid and .delete work in all bindings"""
from Qt import QtCompat, QtCore
obj = QtCore.QObject()
assert QtCompat.isValid(obj)
QtCompat.delete(obj)
assert not QtCompat.isValid(obj)