Python PyQt5.QtWidgets.QDialog.__init__() Examples

The following are 30 code examples of PyQt5.QtWidgets.QDialog.__init__(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt5.QtWidgets.QDialog , or try the search function .
Example #1
Source File: ORStoolsDialogConfig.py    From orstools-qgis-plugin with MIT License 6 votes vote down vote up
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) 
Example #2
Source File: WGuiOption.py    From pyleecan with Apache License 2.0 6 votes vote down vote up
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")) 
Example #3
Source File: view_graph_original.py    From QualCoder with MIT License 6 votes vote down vote up
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) 
Example #4
Source File: revoke_mn_dlg.py    From dash-masternode-tool with MIT License 6 votes vote down vote up
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() 
Example #5
Source File: propellantMenu.py    From openMotor with GNU General Public License v3.0 6 votes vote down vote up
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() 
Example #6
Source File: hw_common.py    From dash-masternode-tool with MIT License 6 votes vote down vote up
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 = '' 
Example #7
Source File: cmd_console_dlg.py    From dash-masternode-tool with MIT License 6 votes vote down vote up
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() 
Example #8
Source File: upd_mn_service_dlg.py    From dash-masternode-tool with MIT License 6 votes vote down vote up
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() 
Example #9
Source File: macros.py    From guppy-proxy with MIT License 6 votes vote down vote up
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) 
Example #10
Source File: predefined_label.py    From CNNArt with Apache License 2.0 6 votes vote down vote up
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) 
Example #11
Source File: predefined_networks.py    From CNNArt with Apache License 2.0 6 votes vote down vote up
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) 
Example #12
Source File: connection_dialog.py    From opcua-client-gui with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #13
Source File: ExistingRedditObjectAddDialog.py    From DownloaderForReddit with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #14
Source File: Messages.py    From DownloaderForReddit with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        """
        A small class to display an unfinished dialog message to the user.  It is made into its own class so the names
        of the buttons can be renamed to be better understood in the situation it is used in
        """
        QDialog.__init__(self)
        self.setupUi(self)

        self.button_box.button(QDialogButtonBox.Ok).setText('Close Anyway')
        self.button_box.button(QDialogButtonBox.Cancel).setText('Do Not Close')

        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.close) 
Example #15
Source File: imageExporter.py    From openMotor with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, manager):
        super().__init__(manager, 'Image File',
                         'Exports the results of a simulation in a graph.', {'.png': 'Portable network graphic'})
        self.menu = ImageExportMenu(self)
        self.reqNotMet = "Must have run a simulation to export a .PNG file." 
Example #16
Source File: engExporter.py    From openMotor with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        super().__init__()
        self.props['diameter'] = FloatProperty('Motor Diameter', 'm', 0, 1)
        self.props['length'] = FloatProperty('Motor Length', 'm', 0, 4)
        self.props['hardwareMass'] = FloatProperty('Hardware Mass', 'kg', 0, 1000)
        self.props['designation'] = StringProperty('Motor Designation')
        self.props['manufacturer'] = StringProperty('Motor Manufacturer') 
Example #17
Source File: simulationProgressDialog.py    From openMotor with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        QDialog.__init__(self)
        self.ui = Ui_SimProgressDialog()
        self.ui.setupUi(self)

        self.ui.buttonBox.rejected.connect(self.closeEvent) 
Example #18
Source File: dlg_mnStatus.py    From PIVX-SPMT with MIT License 5 votes vote down vote up
def __init__(self, main_wnd, mnAlias, statusData):
        QDialog.__init__(self, parent=main_wnd)
        self.main_wnd = main_wnd
        self.mnAlias = mnAlias
        self.statusData = statusData
        self.setWindowTitle('Masternode Details')
        self.setupUI() 
Example #19
Source File: simulationAlertsDialog.py    From openMotor with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        QDialog.__init__(self)
        self.ui = Ui_SimAlertsDialog()
        self.ui.setupUi(self)

        header = self.ui.tableWidgetAlerts.horizontalHeader()
        header.setSectionResizeMode(0, QHeaderView.ResizeToContents)
        header.setSectionResizeMode(1, QHeaderView.ResizeToContents)
        header.setSectionResizeMode(2, QHeaderView.ResizeToContents)
        header.setSectionResizeMode(3, QHeaderView.Stretch)

        self.hide() 
Example #20
Source File: csvExporter.py    From openMotor with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, converter):
        QDialog.__init__(self)
        self.ui = Ui_CSVExporter()
        self.ui.setupUi(self)
        self.converter = converter 
Example #21
Source File: macros.py    From guppy-proxy with MIT License 5 votes vote down vote up
def __init__(self, parent, filename='', resultSlot=None):
        QObject.__init__(self)
        self.fname = filename or None # filename we load from
        self.source = None
        self.parent = parent
        self.cached_args = {}
        self.load() 
Example #22
Source File: macros.py    From guppy-proxy with MIT License 5 votes vote down vote up
def __init__(self, parent, client, filename):
        InterceptMacro.__init__(self)
        QObject.__init__(self)
        self.fname = filename or None # name from the file
        self.source = None
        self.client = client
        self.parent = parent
        self.mclient = MacroClient(self.client)
        self.cached_args = {}
        self.used_args = {}

        if filename:
            self.load(filename) 
Example #23
Source File: macros.py    From guppy-proxy with MIT License 5 votes vote down vote up
def __init__(self, client):
        QObject.__init__(self)
        self._client = client 
Example #24
Source File: view_graph_original.py    From QualCoder with MIT License 5 votes vote down vote up
def __init__(self, app):
        """ Set up the dialog. """

        sys.excepthook = exception_handler
        QDialog.__init__(self)
        self.app = app
        self.settings = app.settings
        self.conn = app.conn
        # Set up the user interface from Designer.
        self.ui = Ui_Dialog_visualiseGraph_original()
        self.ui.setupUi(self)
        fsize_list = []
        for i in range(8, 22, 2):
            fsize_list.append(str(i))
        self.ui.comboBox_fontsize.addItems(fsize_list)
        # set the scene
        self.scene = GraphicsScene()
        self.ui.graphicsView.setScene(self.scene)
        self.ui.graphicsView.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
        self.ui.checkBox_blackandwhite.stateChanged.connect(self.show_graph_type)
        self.ui.checkBox_listview.stateChanged.connect(self.show_graph_type)
        self.ui.comboBox_fontsize.currentIndexChanged.connect(self.show_graph_type)
        self.code_names, self.categories = app.get_data()

        self.ui.comboBox.currentIndexChanged.connect(self.show_graph_type)
        combobox_list = ['All']
        for c in self.categories:
            combobox_list.append(c['name'])
        self.ui.comboBox.addItems(combobox_list) 
Example #25
Source File: predefined_label.py    From CNNArt with Apache License 2.0 5 votes vote down vote up
def __init__(self, parent=None):
        super(Window, self).__init__(parent)

        factory = QItemEditorFactory()
        factory.registerEditor(QVariant.Color, ColorListItemEditorCreator())
        QItemEditorFactory.setDefaultFactory(factory)

        self.labelHist = []
        self.loadPredefinedClasses('configGUI/predefined_classes.txt')
        self.createGUI() 
Example #26
Source File: predefined_label.py    From CNNArt with Apache License 2.0 5 votes vote down vote up
def __init__(self, widget=None):
        super(ColorListEditor, self).__init__(widget)

        self.populateList() 
Example #27
Source File: predefined_networks.py    From CNNArt with Apache License 2.0 5 votes vote down vote up
def __init__(self, parent=None):
        super(Window, self).__init__(parent)

        self.createGUI() 
Example #28
Source File: view_graph_original.py    From QualCoder with MIT License 5 votes vote down vote up
def __init__ (self, parent=None):
        super(GraphicsScene, self).__init__ (parent)
        self.setSceneRect(QtCore.QRectF(0, 0, self.sceneWidth, self.sceneHeight)) 
Example #29
Source File: view_graph_original.py    From QualCoder with MIT License 5 votes vote down vote up
def __init__(self, from_widget, to_widget):
        super(LinkGraphicsItem, self).__init__(None)

        self.from_widget = from_widget
        self.to_widget = to_widget
        #self.setFlag(self.ItemIsSelectable, True)
        self.setFlags(QtWidgets.QGraphicsItem.ItemIsSelectable)
        self.calculatePointsAndDraw() 
Example #30
Source File: macros.py    From guppy-proxy with MIT License 5 votes vote down vote up
def __init__(self, parent, client, *args, **kwargs):
        self.client = client
        QAbstractTableModel.__init__(self, *args, **kwargs)
        self.macros = []
        self.int_conns = {}
        self.conn_ids = count()
        self.parent = parent
        self.headers = ["On", "Path"]