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


Python QtCore.QObject方法代码示例

本文整理汇总了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) 
开发者ID:dreamworksanimation,项目名称:usdmanager,代码行数:18,代码来源:highlighter.py

示例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 
开发者ID:microelly2,项目名称:NodeEditor,代码行数:9,代码来源:dragger.py

示例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 
开发者ID:microelly2,项目名称:NodeEditor,代码行数:11,代码来源:keyboard.py

示例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 
开发者ID:wonderworks-software,项目名称:PyFlow,代码行数:5,代码来源:LoggerTool.py

示例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 
开发者ID:cineuse,项目名称:CNCGToolKit,代码行数:30,代码来源:dropable.py

示例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() 
开发者ID:mottosso,项目名称:Qt.py,代码行数:11,代码来源:tests.py

示例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) 
开发者ID:mottosso,项目名称:Qt.py,代码行数:9,代码来源:tests.py


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