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