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


Python QDialog.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, machine_setup, matlib):
        """
        WGuiOption enable to modify some option in the GUI such as:
            - units
            - material library folder
        
        Parameters:
        machine_setup: DMachineSetup
            Machine widget
        matlib : MatLib
            Material Library 
        """
        QDialog.__init__(self)
        self.setupUi(self)
        self.le_matlib_path.setText(MATLIB_DIR)
        self.machine_setup = machine_setup  # DMachineSetup to access to the machine
        self.matlib = matlib  # dmatlib to access to the material library
        self.c_unit_m.setCurrentIndex(gui_option.unit.unit_m)
        self.c_unit_m2.setCurrentIndex(gui_option.unit.unit_m2)

        # Connections
        self.b_matlib_path.clicked.connect(self.b_define_matlib_dir)
        self.le_matlib_path.textChanged.connect(self.change_matlib_dir)
        self.c_unit_m.currentTextChanged.connect(lambda: self.change_unit(unit="m"))
        self.c_unit_m2.currentTextChanged.connect(lambda: self.change_unit(unit="m2")) 
开发者ID:Eomys,项目名称:pyleecan,代码行数:27,代码来源:WGuiOption.py

示例2: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog 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

示例3: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self,
                 main_dlg,
                 app_config: AppConfig,
                 dashd_intf: DashdInterface,
                 masternode: MasternodeConfig):
        QDialog.__init__(self, main_dlg)
        ui_revoke_mn_dlg.Ui_RevokeMnDlg.__init__(self)
        WndUtils.__init__(self, main_dlg.app_config)
        self.main_dlg = main_dlg
        self.masternode = masternode
        self.app_config = app_config
        self.dashd_intf = dashd_intf
        self.dmn_protx_hash = self.masternode.dmn_tx_hash
        self.dmn_actual_operator_pubkey = ""
        self.revocation_reason = 0
        self.show_manual_commands = False
        self.setupUi() 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:19,代码来源:revoke_mn_dlg.py

示例4: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, main_dlg, app_config):
        QDialog.__init__(self, main_dlg)
        ui_cmd_console_dlg.Ui_CmdConsoleDlg.__init__(self)
        self.main_dlg = main_dlg
        self.app_config = app_config

        # user will be able to configure only those loggers, that exist in the known loggers list
        self.known_loggers = []
        for kl in sorted(get_known_loggers(), key = lambda x: (x.external, x.name)):
            self.known_loggers.append(kl.name)

        self.last_commands = []
        self.last_command_index = None
        self.saved_command_text = ''

        self.setupUi() 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:18,代码来源:cmd_console_dlg.py

示例5: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self,
                 main_dlg,
                 app_config: AppConfig,
                 dashd_intf: DashdInterface,
                 masternode: MasternodeConfig,
                 on_mn_config_updated_callback: Callable):
        QDialog.__init__(self, main_dlg)
        ui_upd_mn_service_dlg.Ui_UpdMnServiceDlg.__init__(self)
        WndUtils.__init__(self, main_dlg.app_config)
        self.main_dlg = main_dlg
        self.masternode = masternode
        self.app_config = app_config
        self.dashd_intf = dashd_intf
        self.on_mn_config_updated_callback = on_mn_config_updated_callback
        self.dmn_protx_hash = self.masternode.dmn_tx_hash
        self.dmn_actual_operator_pubkey = ""
        self.dmn_actual_operator_reward = 0
        self.dmn_new_operator_payout_address = ''
        self.dmn_prev_ip_port = self.masternode.ip + ':' + str(self.masternode.port)
        self.dmn_new_ip = ''
        self.dmn_new_port = ''
        self.upd_payout_active = False
        self.show_manual_commands = False
        self.setupUi() 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:26,代码来源:upd_mn_service_dlg.py

示例6: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, object_name, object_type):
        QDialog.__init__(self)
        self.object_name = object_name
        self.object_type = object_type

        self.label = QLabel(
            f'{self.object_name} is already in the list.\n'
            f'Would you like to run a download for this {self.object_type.lower()}'
        )

        self.download_button = QPushButton(f'Download {self.object_type.lower()}')
        self.close_button = QPushButton('Close')
        self.download_button.clicked.connect(self.accept)
        self.close_button.clicked.connect(self.close)

        button_box = QHBoxLayout()
        button_box.setSpacing(15)
        button_box.addWidget(self.download_button)
        button_box.addWidget(self.close_button)
        layout = QVBoxLayout()
        layout.setSpacing(10)
        layout.addWidget(self.label)
        layout.addItem(button_box)
        self.setLayout(layout) 
开发者ID:MalloyDelacroix,项目名称:DownloaderForReddit,代码行数:26,代码来源:ExistingRedditObjectAddDialog.py

示例7: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, parent=None):
        """
        :param parent: Parent window for modality.
        :type parent: QDialog
        """
        QDialog.__init__(self, parent)

        self.setupUi(self)

        # Temp storage for config dict
        self.temp_config = configmanager.read_config()

        self._build_ui()
        self._collapse_boxes()

        self.provider_add.clicked.connect(self._add_provider)
        self.provider_remove.clicked.connect(self._remove_provider) 
开发者ID:GIScience,项目名称:orstools-qgis-plugin,代码行数:19,代码来源:ORStoolsDialogConfig.py

示例8: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, parent, uri):
        QDialog.__init__(self)
        self.ui = Ui_ConnectionDialog()
        self.ui.setupUi(self)

        self.uaclient = parent.uaclient
        self.uri = uri
        self.parent = parent
        
        self.ui.modeComboBox.addItem("None")
        self.ui.modeComboBox.addItem("Sign")
        self.ui.modeComboBox.addItem("SignAndEncrypt")

        self.ui.policyComboBox.addItem("None")
        self.ui.policyComboBox.addItem("Basic128Rsa15")
        self.ui.policyComboBox.addItem("Basic256")

        self.ui.closeButton.clicked.connect(self.accept)
        self.ui.certificateButton.clicked.connect(self.get_certificate)
        self.ui.privateKeyButton.clicked.connect(self.get_private_key)
        self.ui.queryButton.clicked.connect(self.query) 
开发者ID:FreeOpcUa,项目名称:opcua-client-gui,代码行数:23,代码来源:connection_dialog.py

示例9: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self,name):
        QDialog.__init__(self)

        self.setMinimumSize(QSize(320, 140))
        self.setWindowTitle("Type in a Network Name")

        self.text = name

        self.nameLabel = QLabel(self)
        self.nameLabel.setText('Name:')
        self.line = QLineEdit(self)

        self.line.move(80, 20)
        self.line.resize(200, 32)
        self.nameLabel.move(20, 20)

        pybutton = QPushButton('OK', self)
        pybutton.clicked.connect(self.accept)
        pybutton.resize(200,32)
        pybutton.move(80, 60) 
开发者ID:thomaskuestner,项目名称:CNNArt,代码行数:22,代码来源:predefined_networks.py

示例10: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self,name):
        QDialog.__init__(self)

        self.setMinimumSize(QSize(320, 140))
        self.setWindowTitle("Type in a Label Name")

        self.text = name

        self.nameLabel = QLabel(self)
        self.nameLabel.setText('Name:')
        self.line = QLineEdit(self)

        self.line.move(80, 20)
        self.line.resize(200, 32)
        self.nameLabel.move(20, 20)

        pybutton = QPushButton('OK', self)
        pybutton.clicked.connect(self.accept)
        pybutton.resize(200,32)
        pybutton.move(80, 60) 
开发者ID:thomaskuestner,项目名称:CNNArt,代码行数:22,代码来源:predefined_label.py

示例11: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog 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

示例12: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, manager):
        QDialog.__init__(self)
        self.ui = Ui_PropellantDialog()
        self.ui.setupUi(self)

        self.manager = manager

        self.setupPropList()
        self.ui.listWidgetPropellants.currentItemChanged.connect(self.propSelected)

        self.ui.propEditor.changeApplied.connect(self.propEdited)
        self.ui.propEditor.closed.connect(self.editorClosed)

        self.ui.pushButtonNewPropellant.pressed.connect(self.newPropellant)
        self.ui.pushButtonDelete.pressed.connect(self.deleteProp)
        self.ui.pushButtonEdit.pressed.connect(self.editProp)

        self.ui.propEditor.addButtons()

        self.setupButtons() 
开发者ID:reilleya,项目名称:openMotor,代码行数:22,代码来源:propellantMenu.py

示例13: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, app, data):
        super(TextGraphicsItem, self).__init__(None)

        self.app = app
        self.conn = app.conn
        self.settings = app.settings
        self.project_path = app.project_path
        self.data = data
        self.setFlags (QtWidgets.QGraphicsItem.ItemIsMovable | QtWidgets.QGraphicsItem.ItemIsFocusable | QtWidgets.QGraphicsItem.ItemIsSelectable)
        self.setTextInteractionFlags(QtCore.Qt.TextEditable)
        if self.data['cid'] is not None:
            self.font = QtGui.QFont(self.settings['font'], self.data['fontsize'], QtGui.QFont.Normal)
            self.setFont(self.font)
            self.setPlainText(self.data['name'])
        if self.data['cid'] is None:
            self.font = QtGui.QFont(self.settings['font'], self.data['fontsize'], QtGui.QFont.Bold)
            self.setFont(self.font)
            self.setPlainText(self.data['name'])
        self.setPos(self.data['x'], self.data['y'])
        self.document().contentsChanged.connect(self.text_changed)
        #self.border_rect = QtWidgets.QGraphicsRectItem(0, 0, rect.width(), rect.height())
        #self.border_rect.setParentItem(self) 
开发者ID:ccbogel,项目名称:QualCoder,代码行数:24,代码来源:view_graph_original.py

示例14: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self):
        QDialog.__init__(self)
        self.setWindowFlags(QtCore.Qt.FramelessWindowHint |
                            QtCore.Qt.SplashScreen)

        self.setFixedSize(680, 380)
        set_css(self, CSS_PATH) 
开发者ID:MTG,项目名称:dunya-desktop,代码行数:9,代码来源:splashscreen_design.py

示例15: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialog [as 别名]
# 或者: from PyQt5.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, parent=None):
        QDialog.__init__(self, parent)
        self.attribute = None
        self.setFixedSize(200, 300)

        self.setWindowFlags(Qt.FramelessWindowHint | Qt.Popup)

        v_layout = QVBoxLayout(self)
        self.filtering_edit = QLineEdit()
        self.table_attribute = TableView()

        self.button_box = QDialogButtonBox(self)
        self.button_box.addButton('OK', QDialogButtonBox.AcceptRole)
        self.button_box.addButton('Cancel', QDialogButtonBox.RejectRole)

        v_layout.addWidget(self.filtering_edit)
        v_layout.addWidget(self.table_attribute)
        v_layout.addWidget(self.button_box)

        self.setLayout(v_layout)

        self.filtering_model = FilteringModel(self)

        self.proxy_model = SortFilterProxyModel(self)
        self.proxy_model.setSourceModel(self.filtering_model)
        self.proxy_model.setFilterKeyColumn(-1)

        self.table_attribute.horizontalHeader().hide()
        self.table_attribute.setModel(self.proxy_model)
        self.table_attribute.setColumnWidth(0, 28)

        self.filtering_edit.setPlaceholderText('Type here to filter...')
        self.selection = -1

        self.filtering_edit.textChanged.connect(
            lambda: self.proxy_model.filter_table(self.filtering_edit.text()))

        self.button_box.rejected.connect(self.clicked_cancel)
        self.table_attribute.doubleClicked.connect(
            self.get_selected_item_index)
        self.button_box.accepted.connect(self.get_selected_item_index) 
开发者ID:MTG,项目名称:dunya-desktop,代码行数:43,代码来源:filteringdialog.py


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