當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。