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


Python QObject.__init__方法代码示例

本文整理汇总了Python中PyQt5.QtCore.QObject.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QObject.__init__方法的具体用法?Python QObject.__init__怎么用?Python QObject.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtCore.QObject的用法示例。


在下文中一共展示了QObject.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self, canvas):
        """Constructor
        :param canvas:
        """
        QObject.__init__(self)
        self.canvas = canvas
        # Set up slots so we can mimic the behaviour of QGIS when layers
        # are added.
        LOGGER.debug('Initialising canvas...')
        # noinspection PyArgumentList
        QgsMapLayerRegistry.instance().layersAdded.connect(self.addLayers)
        # noinspection PyArgumentList
        QgsMapLayerRegistry.instance().layerWasAdded.connect(self.addLayer)
        # noinspection PyArgumentList
        QgsMapLayerRegistry.instance().removeAll.connect(self.removeAllLayers)

        # For processing module
        self.destCrs = None 
开发者ID:azavea,项目名称:raster-vision-qgis,代码行数:20,代码来源:qgis_interface.py

示例2: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self, parent=None):
        QThread.__init__(self, parent)
        self.stopped = False

        self.mid = None
        self.uid = None
        self.fid = None
        self.cmbid = None
        self.ambid = None
        self.iid = None

        self.parent = self.parent()
        self.fetching_completed.connect(self.parent.work_received)
        self.combobox_results.connect(self.parent.change_combobox_backgrounds)
        self.progress_number.connect(self.parent.set_progress_number)
        self.query_completed.connect(self.parent.query_finished) 
开发者ID:MTG,项目名称:dunya-desktop,代码行数:18,代码来源:query.py

示例3: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self,
                 get_hw_client_function: Callable[[], object],
                 hw_connect_function: Callable[[object], None],
                 hw_disconnect_function: Callable[[], None],
                 app_config: object,
                 dashd_intf: object):
        QObject.__init__(self)

        self.__locks = {}  # key: hw_client, value: EnhRLock
        self.__app_config = app_config
        self.__dashd_intf = dashd_intf
        self.__get_hw_client_function = get_hw_client_function
        self.__hw_connect_function: Callable = hw_connect_function
        self.__hw_disconnect_function: Callable = hw_disconnect_function
        self.__base_bip32_path: str = ''
        self.__base_public_key: bytes = ''
        self.__hd_tree_ident: str = '' 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:19,代码来源:hw_common.py

示例4: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self, parent = None) -> None:
        QObject.__init__(self, parent)
        Extension.__init__(self)
        self.setMenuName(i18n_catalog.i18nc("@item:inmenu", "Post Processing"))
        self.addMenuItem(i18n_catalog.i18nc("@item:inmenu", "Modify G-Code"), self.showPopup)
        self._view = None

        # Loaded scripts are all scripts that can be used
        self._loaded_scripts = {}  # type: Dict[str, Type[Script]]
        self._script_labels = {}  # type: Dict[str, str]

        # Script list contains instances of scripts in loaded_scripts.
        # There can be duplicates, which will be executed in sequence.
        self._script_list = []  # type: List[Script]
        self._selected_script_index = -1
        self._global_container_stack = Application.getInstance().getGlobalContainerStack()
        if self._global_container_stack:
            self._global_container_stack.metaDataChanged.connect(self._restoreScriptInforFromMetadata)

        Application.getInstance().getOutputDeviceManager().writeStarted.connect(self.execute)
        Application.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerStackChanged)  # When the current printer changes, update the list of scripts.
        CuraApplication.getInstance().mainWindowChanged.connect(self._createView)  # When the main window is created, create the view so that we can display the post-processing icon if necessary. 
开发者ID:Ultimaker,项目名称:Cura,代码行数:24,代码来源:PostProcessingPlugin.py

示例5: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self, view):
        QObject.__init__(self, view)
        self.view = view
        self.model = QStandardItemModel()
        self.view.setModel(self.model)
        self.nodesets = []
        self.server_mgr = None
        self.view.header().setSectionResizeMode(1)
        
        addNodeSetAction = QAction("Add Reference Node Set", self.model)
        addNodeSetAction.triggered.connect(self.add_nodeset)
        self.removeNodeSetAction = QAction("Remove Reference Node Set", self.model)
        self.removeNodeSetAction.triggered.connect(self.remove_nodeset)

        self.view.setContextMenuPolicy(Qt.CustomContextMenu)
        self.view.customContextMenuRequested.connect(self.showContextMenu)
        self._contextMenu = QMenu()
        self._contextMenu.addAction(addNodeSetAction)
        self._contextMenu.addAction(self.removeNodeSetAction) 
开发者ID:FreeOpcUa,项目名称:opcua-modeler,代码行数:21,代码来源:refnodesets_widget.py

示例6: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self, view):
        QObject.__init__(self, view)
        self.view = view
        self.model = QStandardItemModel()
        self.view.setModel(self.model)
        delegate = MyDelegate(self.view, self)
        delegate.error.connect(self.error.emit)
        self.view.setItemDelegate(delegate)
        self.node = None
        self.view.header().setSectionResizeMode(1)
        
        self.addNamespaceAction = QAction("Add Namespace", self.model)
        self.addNamespaceAction.triggered.connect(self.add_namespace)
        self.removeNamespaceAction = QAction("Remove Namespace", self.model)
        self.removeNamespaceAction.triggered.connect(self.remove_namespace)

        self.view.setContextMenuPolicy(Qt.CustomContextMenu)
        self.view.customContextMenuRequested.connect(self.showContextMenu)
        self._contextMenu = QMenu()
        self._contextMenu.addAction(self.addNamespaceAction)
        self._contextMenu.addAction(self.removeNamespaceAction) 
开发者ID:FreeOpcUa,项目名称:opcua-modeler,代码行数:23,代码来源:namespace_widget.py

示例7: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self, container_id: str, i18n_catalog: i18nCatalog = None, parent: QObject = None, *args, **kwargs) -> None:
        """Constructor

        :param container_id: A unique, machine readable/writable ID for this container.
        """

        super().__init__()
        QQmlEngine.setObjectOwnership(self, QQmlEngine.CppOwnership)

        self._metadata = {"id": container_id,
                          "name": container_id,
                          "container_type": DefinitionContainer,
                          "version": self.Version} # type: Dict[str, Any]
        self._definitions = []                     # type: List[SettingDefinition]
        self._inherited_files = []                 # type: List[str]
        self._i18n_catalog = i18n_catalog          # type: Optional[i18nCatalog]

        self._definition_cache = {}                # type: Dict[str, SettingDefinition]
        self._path = "" 
开发者ID:Ultimaker,项目名称:Uranium,代码行数:21,代码来源:DefinitionContainer.py

示例8: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self, parent=None, flags=Qt.Dialog | Qt.WindowCloseButtonHint):
        super(ConsoleWidget, self).__init__(parent, flags)
        self.parent = parent
        self.edit = VideoConsole(self)
        buttons = QDialogButtonBox()
        buttons.setCenterButtons(True)
        clearButton = buttons.addButton('Clear', QDialogButtonBox.ResetRole)
        clearButton.clicked.connect(self.edit.clear)
        closeButton = buttons.addButton(QDialogButtonBox.Close)
        closeButton.clicked.connect(self.close)
        closeButton.setDefault(True)
        layout = QVBoxLayout()
        layout.addWidget(self.edit)
        layout.addWidget(buttons)
        self.setLayout(layout)
        self.setWindowTitle('{0} Console'.format(qApp.applicationName()))
        self.setWindowModality(Qt.NonModal) 
开发者ID:ozmartian,项目名称:vidcutter,代码行数:19,代码来源:videoconsole.py

示例9: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self, client, *args, **kwargs):
        self.client = client
        QWidget.__init__(self, *args, **kwargs)

        self.setLayout(QVBoxLayout())
        self.layout().setContentsMargins(0, 0, 0, 0)
        self.tab_widg = QTabWidget()

        self.active_widg = ActiveMacroWidget(client)
        self.active_ind = self.tab_widg.count()
        self.tab_widg.addTab(self.active_widg, "Active")

        self.int_widg = IntMacroWidget(client)
        self.int_ind = self.tab_widg.count()
        self.tab_widg.addTab(self.int_widg, "Intercepting")

        self.warning_widg = QLabel("<h1>Warning! Macros may cause instability</h1><p>Macros load and run python files into the Guppy process. If you're not careful when you write them you may cause Guppy to crash. If an active macro ends up in an infinite loop you may need to force kill the application when you quit.</p><p><b>PROCEED WITH CAUTION</b></p>")
        self.warning_widg.setWordWrap(True)
        self.tab_widg.addTab(self.warning_widg, "Warning")

        self.layout().addWidget(self.tab_widg) 
开发者ID:roglew,项目名称:guppy-proxy,代码行数:23,代码来源:macros.py

示例10: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self, *args, **kwargs):
        QWidget.__init__(self, *args, **kwargs)
        self.str2_shown = False
        self.str1 = StringCmpWidget()
        self.str2 = StringCmpWidget()
        self.str1.returnPressed.connect(self.returnPressed)
        self.str2.returnPressed.connect(self.returnPressed)
        self.toggle_button = QToolButton()
        self.toggle_button.setText("+")

        self.toggle_button.clicked.connect(self._show_hide_str2)

        layout = QHBoxLayout()
        layout.addWidget(self.str1)
        layout.addWidget(self.str2)
        layout.addWidget(self.toggle_button)

        self.str2.setVisible(self.str2_shown)
        self.setLayout(layout)
        self.layout().setContentsMargins(0, 0, 0, 0) 
开发者ID:roglew,项目名称:guppy-proxy,代码行数:22,代码来源:reqlist.py

示例11: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self, canvas: QgsMapCanvas):
        """Constructor
        :param canvas:
        """
        QObject.__init__(self)
        self.canvas = canvas
        # Set up slots so we can mimic the behaviour of QGIS when layers
        # are added.
        LOGGER.debug('Initialising canvas...')
        # noinspection PyArgumentList
        QgsProject.instance().layersAdded.connect(self.addLayers)
        # noinspection PyArgumentList
        QgsProject.instance().layerWasAdded.connect(self.addLayer)
        # noinspection PyArgumentList
        QgsProject.instance().removeAll.connect(self.removeAllLayers)

        # For processing module
        self.destCrs = None

        self.message_bar = QgsMessageBar() 
开发者ID:ghtmtt,项目名称:DataPlotly,代码行数:22,代码来源:qgis_interface.py

示例12: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self, logger, parent=None):
        QObject.__init__(self, parent)
        self._logger = logger
        self._socket = None
        self._server = parent and isinstance(parent, ServerSocket)

        self._read_buffer = bytearray()
        self._read_notifier = None
        self._read_packet = None

        self._write_buffer = bytearray()
        self._write_cursor = 0
        self._write_notifier = None
        self._write_packet = None

        self._connected = False
        self._outgoing = collections.deque()
        self._incoming = collections.deque() 
开发者ID:IDArlingTeam,项目名称:IDArling,代码行数:20,代码来源:sockets.py

示例13: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self, ip, port):
        QObject.__init__(self)

        self.ip = ip
        self.port = port
        self.udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        self.udp_socket.settimeout(1)

        self.signal = self.SIG_NORMAL 
开发者ID:rookiepeng,项目名称:socket-test,代码行数:11,代码来源:udp.py

示例14: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self, ip, port):
        QObject.__init__(self)

        self.ip = ip
        self.port = port
        self.tcp_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.tcp_socket.settimeout(1)

        self.signal = self.SIG_NORMAL 
开发者ID:rookiepeng,项目名称:socket-test,代码行数:11,代码来源:tcpclient.py

示例15: __init__

# 需要导入模块: from PyQt5.QtCore import QObject [as 别名]
# 或者: from PyQt5.QtCore.QObject import __init__ [as 别名]
def __init__(self, docid, step, n_progress):
        QObject.__init__(self)

        self.docid = docid
        self.step = step
        self.n_progress = n_progress 
开发者ID:MTG,项目名称:dunya-desktop,代码行数:8,代码来源:utilities.py


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