Python PyQt5.QtGui.QIntValidator() Examples

The following are code examples for showing how to use PyQt5.QtGui.QIntValidator(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: Pythonic   Author: hANSIc99   File: basic_ta.py    GNU General Public License v3.0 7 votes vote down vote up
def stoInput(self):

        self.sto_input = QWidget()
        self.sto_layout = QHBoxLayout(self.sto_input)

        self.sto_range_txt = QLabel()
        self.sto_range_txt.setText(QC.translate('', 'Enter MA period'))

        self.sto_range_input = QLineEdit()
        self.sto_range_input.setValidator(QIntValidator(1, 999))
        self.sto_range_input.setPlaceholderText(QC.translate('', 'Default value: 3'))

        self.sto_layout.addWidget(self.sto_range_txt)
        self.sto_layout.addWidget(self.sto_range_input)

        self.variable_box.addWidget(self.sto_input) 
Example 2
Project: openocd-svd   Author: esynr3z   File: ui_widgets.py    MIT License 6 votes vote down vote up
def setDisplayValidator(self, base):
        if base == 10:
            max_int = 2**self.numBitWidth()
            self.setValidator(QIntValidator(0, max_int - 1))
        elif base == 16:
            high_part = ""
            low_part = ""
            if self.numBitWidth() % 4 > 0:
                high_part = "[0-%d]" % (2**(self.numBitWidth() % 4) - 1)
            if int(self.numBitWidth() / 4) > 0:
                low_part = "[0-9A-Fa-f]{%d}" % int(self.numBitWidth() / 4)
            allowed_symbols = "0x" + high_part + low_part
            self.setValidator(QRegExpValidator(QtCore.QRegExp(allowed_symbols)))
        elif base == 2:
            high_part = ""
            low_part = ""
            if self.numBitWidth() % 4 > 0:
                high_part = "(0|1){%d}" % (self.numBitWidth() % 4)
            if int(self.numBitWidth() / 4) > 0:
                low_part = "((\s|)(0|1){4}){%d}" % int(self.numBitWidth() / 4)
            allowed_symbols = "^" + high_part + low_part + "$"
            self.setValidator(QRegExpValidator(QtCore.QRegExp(allowed_symbols))) 
Example 3
Project: htm-teul   Author: sebnarvaez   File: MainWindow.py    GNU General Public License v2.0 6 votes vote down vote up
def configFrame(self):

        self.frame.virtualWorld = self.world

        # Init the table of inputs widget
        self.frame.tblWdgt_trainingList.setColumnCount(3)
        self.frame.tblWdgt_trainingList.setHorizontalHeaderLabels(
            ['Frase', 'Accion', 'Argumento']
        )
        self.frame.tblWdgt_trainingList.horizontalHeader().setStretchLastSection(
            True)

        self.frame.lnEdt_iterations.setValidator(QIntValidator(0, 1000,
            self.frame))

        self.initEvents() 
Example 4
Project: AutoSplit64   Author: Kainev   File: capture_editor_dialog.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, title, parent=None):
        super().__init__(parent)

        # Layout
        self.main_layout = QtWidgets.QGridLayout(self)

        # Widgets
        self.title_lb = QtWidgets.QLabel(title)
        self.xoffset_lb = QtWidgets.QLabel("X Offset:")
        self.yoffset_lb = QtWidgets.QLabel("Y Offset:")
        self.width_lb = QtWidgets.QLabel("Width:")
        self.height_lb = QtWidgets.QLabel("Height:")
        self.xoffset_le = QtWidgets.QLineEdit()
        self.yoffset_le = QtWidgets.QLineEdit()
        self.width_le = QtWidgets.QLineEdit()
        self.height_le = QtWidgets.QLineEdit()

        self.int_validator = QtGui.QIntValidator()

        self.initialize() 
Example 5
Project: parsec-cloud   Author: Scille   File: network_settings_widget.py    GNU Affero General Public License v3.0 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.setupUi(self)
        self.radio_upload_no_limit.toggled.connect(
            self.switch_network_limits(self.radio_upload_limit)
        )
        self.radio_upload_limit.toggled.connect(
            self.switch_network_limits(self.radio_upload_no_limit)
        )
        self.radio_download_no_limit.toggled.connect(
            self.switch_network_limits(self.radio_download_limit)
        )
        self.radio_download_limit.toggled.connect(
            self.switch_network_limits(self.radio_download_no_limit)
        )

        self.line_edit_proxy_port.setValidator(NetworkPortValidator())
        self.line_edit_upload_limit.setValidator(QIntValidator(1, 10000))
        self.line_edit_download_limit.setValidator(QIntValidator(1, 10000))
        self.combo_proxy_type.currentIndexChanged.connect(self.proxy_type_changed)
        self.button_save.clicked.connect(self.save_clicked)
        self.init() 
Example 6
Project: Pythonic   Author: hANSIc99   File: basic_ta.py    GNU General Public License v3.0 6 votes vote down vote up
def maInput(self):

        self.ma_input = QWidget()
        self.ma_layout = QHBoxLayout(self.ma_input)

        self.ma_range_txt = QLabel()
        self.ma_range_txt.setText(QC.translate('', 'Enter time range MA'))

        self.ma_range_input = QLineEdit()
        self.ma_range_input.setValidator(QIntValidator(1, 999))
        self.ma_range_input.setPlaceholderText(QC.translate('', 'Default value: 3'))

        self.ma_layout.addWidget(self.ma_range_txt)
        self.ma_layout.addWidget(self.ma_range_input)


        self.variable_box.addWidget(self.ma_input) 
Example 7
Project: Pythonic   Author: hANSIc99   File: basic_ta.py    GNU General Public License v3.0 6 votes vote down vote up
def emaInput(self):

        self.ema_input = QWidget()
        self.ema_layout = QHBoxLayout(self.ema_input)

        self.ema_range_txt = QLabel()
        self.ema_range_txt.setText(QC.translate('', 'Enter time range EMA'))

        self.ema_range_input = QLineEdit()
        self.ema_range_input.setValidator(QIntValidator(1, 999))
        self.ema_range_input.setPlaceholderText(QC.translate('', 'Default value: 3'))

        self.ema_layout.addWidget(self.ema_range_txt)
        self.ema_layout.addWidget(self.ema_range_input)

        self.variable_box.addWidget(self.ema_input) 
Example 8
Project: Pythonic   Author: hANSIc99   File: basic_ta.py    GNU General Public License v3.0 6 votes vote down vote up
def rsiInput(self):

        self.rsi_input = QWidget()
        self.rsi_layout = QHBoxLayout(self.rsi_input)

        self.rsi_range_txt = QLabel()
        self.rsi_range_txt.setText(QC.translate('', 'Enter periods'))

        self.rsi_range_input = QLineEdit()
        self.rsi_range_input.setValidator(QIntValidator(1, 999))
        self.rsi_range_input.setPlaceholderText(QC.translate('', 'Default value: 3'))

        self.rsi_layout.addWidget(self.rsi_range_txt)
        self.rsi_layout.addWidget(self.rsi_range_input)

        self.variable_box.addWidget(self.rsi_input) 
Example 9
Project: idasec   Author: RobinDavid   File: MainWidget.py    GNU Lesser General Public License v2.1 5 votes vote down vote up
def OnCreate(self, _):
        self.setupUi(self)
        self.binsec_connect_button.clicked.connect(self.connect_binsec)
        self.dba_decode_button.clicked.connect(self.decode_button_clicked)
        self.here_decode_button.clicked.connect(self.decode_here_clicked)
        self.pinsec_ip_field.setText("192.168.56.101")
        self.pinsec_port_field.setText("5555")
        self.binsec_port_field.setValidator(QtGui.QIntValidator(0, 65535))
        self.pinsec_port_field.setValidator(QtGui.QIntValidator(0, 65535))
        self.ok = QtGui.QPixmap(":/icons/icons/oxygen/22x22/ok.png")
        self.ko = QtGui.QPixmap(":/icons/icons/oxygen/22x22/ko.png")
        self.prev_modules = sys.modules.keys()
        self.set_pinsec_visible(False) 
Example 10
Project: eddy   Author: obdasystems   File: fields.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        """
        Initialize the integer input field.
        """
        super().__init__(*args, **kwargs)
        self.setAttribute(QtCore.Qt.WA_MacShowFocusRect, 0)
        self.setValidator(QtGui.QIntValidator(self)) 
Example 11
Project: plexdesktop   Author: coryo   File: extra_widgets.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        s = plexdesktop.settings.Settings()
        self.setWindowTitle('Preferences')
        self.form = QtWidgets.QFormLayout(self)

        i = QtWidgets.QComboBox()
        i.addItems(plexdesktop.style.Style.Instance().themes)
        i.setCurrentIndex(i.findText(s.value('theme')))
        self.form.addRow(QtWidgets.QLabel('theme'), i)

        bf = QtWidgets.QSpinBox()
        bf.setValue(int(s.value('browser_font', 9)))
        self.form.addRow(QtWidgets.QLabel('browser font size'), bf)

        icon_size = QtWidgets.QLineEdit(str(s.value('thumb_size', 240)))
        icon_size.setValidator(QtGui.QIntValidator(0, 300))
        self.form.addRow(QtWidgets.QLabel('thumbnail size'), icon_size)

        widget_player = QtWidgets.QCheckBox()
        widget_player.setCheckState(QtCore.Qt.Checked if bool(int(s.value('widget_player', 0))) else QtCore.Qt.Unchecked)
        self.form.addRow(QtWidgets.QLabel('use widget player'), widget_player)

        self.buttons = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel,
            QtCore.Qt.Horizontal, self)
        self.form.addRow(self.buttons)
        self.buttons.rejected.connect(self.reject)
        self.buttons.accepted.connect(self.accept)

        if self.exec_() == QtWidgets.QDialog.Accepted:
            # s = Settings()
            theme = i.currentText()
            s.setValue('theme', theme)
            plexdesktop.style.Style.Instance().theme(theme)

            s.setValue('browser_font', bf.value())

            s.setValue('thumb_size', int(icon_size.text()))

            s.setValue('widget_player', 1 if widget_player.checkState() == QtCore.Qt.Checked else 0) 
Example 12
Project: Cocktailmaker_AW   Author: AndreWohnsland   File: setupui.py    MIT License 5 votes vote down vote up
def __init__(self, devenvironment, DB=None, parent=None):
        """ Init. Many of the button and List connects are in pass_setup. """
        super(MainScreen, self).__init__(parent)
        self.setupUi(self)
        # as long as its not devenvironment (usually touchscreen) hide the cursor
        if not devenvironment:
            self.setCursor(Qt.BlankCursor)
        self.devenvironment = devenvironment
        # connect to the DB, if one is given (you should always give one!)
        if DB is not None:
            self.DB = sqlite3.connect(DB)
            self.c = self.DB.cursor()
        self.handaddlist = []
        # the connection method here is defined in a seperate file "clickablelineedit.py"
        # even if it belongs to the UI if its moved there, there will be an import error.
        # Till this problem is resolved, this file will stay in the main directory
        self.LEpw.clicked.connect(lambda: self.passwordwindow(self.LEpw))
        self.LEpw2.clicked.connect(lambda: self.passwordwindow(self.LEpw2))
        self.LECleanMachine.clicked.connect(lambda: self.passwordwindow(self.LECleanMachine))
        self.LECocktail.clicked.connect(lambda: self.keyboard(self.LECocktail))
        self.LEGehaltRezept.clicked.connect(lambda: self.passwordwindow(self.LEGehaltRezept, y_pos=50, headertext="Alkoholgehalt eingeben!"))
        self.LEZutatRezept.clicked.connect(lambda: self.keyboard(self.LEZutatRezept, max_char_len=20))
        self.LEKommentar.clicked.connect(self.handwindow)
        self.PBAvailable.clicked.connect(self.availablewindow)
        # connects all the Lineedits from the Recipe amount and gives them the validator
        LER_obj = [getattr(self, "LER" + str(x)) for x in range(1,9)]
        for obj in LER_obj:
            obj.clicked.connect(lambda o=obj: self.passwordwindow(le_to_write=o, x_pos=400, y_pos=50, headertext="Zutatenmenge eingeben!"))
            obj.setValidator(QIntValidator(0,300))
            obj.setMaxLength(3)
        # Setting up Validators for all the the fields (length and/or Types):
        self.LEGehaltRezept.setValidator(QIntValidator(0,99))
        self.LEGehaltRezept.setMaxLength(2)
        self.LEZutatRezept.setMaxLength(20)
        self.LEFlaschenvolumen.setValidator(QIntValidator(100,2000))
        self.LECocktail.setMaxLength(30) 
Example 13
Project: GeoMop   Author: GeoMop   File: surfaces.py    GNU General Public License v3.0 5 votes vote down vote up
def _make_skip_lines_le(self):
        le = QtWidgets.QLineEdit()
        le.setToolTip("Skip given number of lines at the file beginning.")
        le.editingFinished.connect(self.set_skip_lines)
        validator = QtGui.QIntValidator()
        validator.setBottom(0)
        le.setValidator(validator)
        return le 
Example 14
Project: GeoMop   Author: GeoMop   File: surfaces.py    GNU General Public License v3.0 5 votes vote down vote up
def _make_nuv_edit(self):
        """
        EditLine box for a int (part of nuv).
        """
        edit = QtWidgets.QLineEdit()
        edit.editingFinished.connect(self.nuv_changed)
        nuv_validator = QtGui.QIntValidator()
        nuv_validator.setRange(2, 600)
        edit.setValidator(nuv_validator)
        return edit 
Example 15
Project: ColiCoords   Author: Jhsmit   File: images_select.py    MIT License 5 votes vote down vote up
def __init__(self, *args, parent=None, title='PaintOptions', **kwargs):
        super(PaintOptionsWindow, self).__init__(parent, *args, **kwargs)
        self.setWindowTitle(title)
        self.brush_size_edit = QLineEdit()
        self.brush_size_edit.setValidator(QtGui.QIntValidator())

        vb = QVBoxLayout()
        self.paint_rb = QRadioButton('Paint')
        self.paint_rb.setChecked(True)
        self.zoom_rb = QRadioButton('Zoom')
        vb.addWidget(self.paint_rb)
        vb.addWidget(self.zoom_rb)

        self.alpha_slider = QSlider(QtCore.Qt.Horizontal)
        self.alpha_slider.setMinimum(0)
        self.alpha_slider.setMaximum(100)
        self.alpha_slider.setTickInterval(100)

        self.autosave_cb = QCheckBox()

        form = QFormLayout()
        form.addRow(QLabel('Brush size'), self.brush_size_edit)
        form.addRow(QLabel('Mouse mode'), vb)
        form.addRow(QLabel('Alpha'), self.alpha_slider)

        w = QWidget()
        w.setLayout(form)
        self.setCentralWidget(w) 
Example 16
Project: ColiCoords   Author: Jhsmit   File: images_select.py    MIT License 5 votes vote down vote up
def __init__(self):
        super(NavigationWindow, self).__init__()
        self.setWindowTitle('Navigation')

        self.first_button = QPushButton('<<')
        self.prev_button = QPushButton('<')
        self.current_frame_text = QLineEdit()
        self.current_frame_text.setValidator(QtGui.QIntValidator())
        self.current_frame_text.setText('0')
        self.next_button = QPushButton('>')
        self.last_button = QPushButton('>>')

        hbox_top = QHBoxLayout()
        hbox_top.addWidget(self.first_button)
        hbox_top.addWidget(self.prev_button)
        hbox_top.addWidget(self.current_frame_text)
        hbox_top.addWidget(self.next_button)
        hbox_top.addWidget(self.last_button)

        hbox_bottom = QHBoxLayout()
        self.exclude_cb = QCheckBox('Exclude')
        self.done_button = QPushButton('Done!')

        hbox_bottom.addWidget(self.exclude_cb)
        hbox_bottom.addStretch(1)
        hbox_bottom.addWidget(self.done_button)

        vbox_overall = QVBoxLayout()
        vbox_overall.addLayout(hbox_top)
        vbox_overall.addLayout(hbox_bottom)

        w = QWidget()
        w.setLayout(vbox_overall)
        self.setCentralWidget(w) 
Example 17
Project: AutoSplit64   Author: Kainev   File: settings_dialog.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(title="Thresholds", parent=parent)

        # Layouts
        self.menu_layout = QtWidgets.QGridLayout()

        # Widgets
        self.prob_lb = QtWidgets.QLabel("Probability Threshold:")
        self.prob_le = QtWidgets.QLineEdit("")
        self.reset_lb = QtWidgets.QLabel("Reset Threshold:")
        self.reset_le = QtWidgets.QLineEdit("")
        self.confirmation_lb = QtWidgets.QLabel("Confirmation Threshold:")
        self.confirmation_le = QtWidgets.QLineEdit("")

        self.black_lb = QtWidgets.QLabel("Black Threshold:")
        self.black_le = QtWidgets.QLineEdit("")
        self.white_lb = QtWidgets.QLabel("White Threshold:")
        self.white_le = QtWidgets.QLineEdit("")

        self.xcam_bg_lb = QtWidgets.QLabel("X-Cam B-G Threshold:")
        self.xcam_bg_le = QtWidgets.QLineEdit("")
        self.xcam_bg_activation_lb = QtWidgets.QLabel("X-Cam B-G Activation:")
        self.xcam_bg_activation_le = QtWidgets.QLineEdit("")
        self.xcam_rg_lb = QtWidgets.QLabel("X-Cam R-G Threshold:")
        self.xcam_rg_le = QtWidgets.QLineEdit("")
        self.xcam_rg_activation_lb = QtWidgets.QLabel("X-Cam R-G Activation:")
        self.xcam_rg_activation_le = QtWidgets.QLineEdit("")
        self.xcam_pixel_lb = QtWidgets.QLabel("X-Cam Pixel Threshold:")
        self.xcam_pixel_le = QtWidgets.QLineEdit("")

        self.undo_lb = QtWidgets.QLabel("Undo Threshold:")
        self.undo_le = QtWidgets.QLineEdit()

        self.double_validator = QtGui.QDoubleValidator(0, 1, 3)
        self.double_validator.setRange(0, 1, 3)
        self.int_validator = QtGui.QIntValidator()

        self.init() 
Example 18
Project: AutoSplit64   Author: Kainev   File: settings_dialog.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, label, config_section, config_key, parent=None):
        super().__init__(parent=parent)

        self._config_section = config_section
        self._config_key = config_key

        self.label = QtWidgets.QLabel(label)
        self.red = QtWidgets.QLineEdit()
        self.green = QtWidgets.QLineEdit()
        self.blue = QtWidgets.QLineEdit()

        self.int_validator = QtGui.QIntValidator()

        self.initialize() 
Example 19
Project: AutoSplit64   Author: Kainev   File: settings_dialog.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(title="Connection", parent=parent)

        # Layouts
        self.menu_layout = QtWidgets.QGridLayout()

        # Widgets
        self.host_lb = QtWidgets.QLabel("LiveSplit Host:")
        self.host_le = QtWidgets.QLineEdit("")
        self.port_lb = QtWidgets.QLabel("LiveSplit Port:")
        self.port_le = QtWidgets.QLineEdit("")

        self.int_validator = QtGui.QIntValidator()

        self.init() 
Example 20
Project: AutoSplit64   Author: Kainev   File: settings_dialog.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(title="Error Correction", parent=parent)

        # Layouts
        self.menu_layout = QtWidgets.QGridLayout()

        # Widgets
        self.processing_lb = QtWidgets.QLabel("Processing Length:")
        self.processing_le = QtWidgets.QLineEdit("")
        self.undo_count_lb = QtWidgets.QLabel("Undo Minimum Length:")
        self.undo_count_le = QtWidgets.QLineEdit("")

        self.undo_threshold_lb = QtWidgets.QLabel("Undo Average Threshold:")
        self.undo_threshold_le = QtWidgets.QLineEdit("")

        self.star_skip_lb = QtWidgets.QLabel("Star Skip Enabled:")
        self.star_skip_cb = QtWidgets.QCheckBox()
        self.max_skip_lb = QtWidgets.QLabel("Max Star Skip:")
        self.max_skip_le = QtWidgets.QLineEdit("")
        self.skip_count_lb = QtWidgets.QLabel("Consecutive Predictions:")
        self.skip_count_le = QtWidgets.QLineEdit("")

        self.double_validator = QtGui.QDoubleValidator(0, 1, 3)
        self.double_validator.setRange(0, 1, 3)
        self.int_validator = QtGui.QIntValidator()

        self.init() 
Example 21
Project: duendecat   Author: patarapolw   File: preferences.py    MIT License 5 votes vote down vote up
def showUI(self):
        param = OrderedDict(sorted(loadConfig().items()))

        self.text = dict()
        self.textEdit = dict()
        overall = QVBoxLayout()
        for key, value in param.items():
            self.text[key] = QLabel(key)
            if type(value) is bool:
                self.textEdit[key] = QCheckBox()
                self.textEdit[key].setChecked(value)
            elif type(value) is int:
                self.textEdit[key] = QLineEdit(str(value))
                self.textEdit[key].setValidator(QIntValidator())
                self.textEdit[key].setMaxLength(2)
            else:
                self.textEdit[key] = QLineEdit(value)

            item = QHBoxLayout()
            item.addWidget(self.text[key])
            item.addWidget(self.textEdit[key])

            overall.addLayout(item)

        submit = QPushButton('Update Preferences')
        submit.clicked.connect(self.saveConfig)
        overall.addWidget(submit)

        self.setLayout(overall)

        self.show() 
Example 22
Project: eddy   Author: danielepantaleone   File: fields.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        """
        Initialize the integer input field.
        """
        super().__init__(*args, **kwargs)
        self.setAttribute(QtCore.Qt.WA_MacShowFocusRect, 0)
        self.setValidator(QtGui.QIntValidator(self)) 
Example 23
Project: FakemonCreator   Author: Jerakin   File: stats_calculator.py    MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(StatsCalculator, self).__init__()
        self.parent = parent
        uic.loadUi(root / 'res/ui/StatsCalculator.ui', self)  # Load the .ui file
        exit_shortcut = QtWidgets.QShortcut(QtGui.QKeySequence("Esc"), self)
        exit_shortcut.activated.connect(self.close)
        self.strength_overruled = False
        self.dexterity_overruled = False
        self.constitution_overruled = False

        self.health.textEdited.connect(self.recalculate_stat)
        self.attack.textEdited.connect(self.recalculate_stat)
        self.defense.textEdited.connect(self.recalculate_stat)
        self.s_attack.textEdited.connect(self.recalculate_stat)
        self.s_defense.textEdited.connect(self.recalculate_stat)
        self.speed.textEdited.connect(self.recalculate_stat)

        self.copy_stats.clicked.connect(self.copy_to_active_pokemon)

        self.health.setValidator(QtGui.QIntValidator())
        self.attack.setValidator(QtGui.QIntValidator())
        self.defense.setValidator(QtGui.QIntValidator())
        self.s_attack.setValidator(QtGui.QIntValidator())
        self.s_defense.setValidator(QtGui.QIntValidator())
        self.speed.setValidator(QtGui.QIntValidator())

        self.STR.textEdited.connect(lambda: self.overrule_value("strength_overruled", self.STR_label))
        self.DEX.textEdited.connect(lambda: self.overrule_value("dexterity_overruled", self.DEX_label))
        self.CON.textEdited.connect(lambda: self.overrule_value("constitution_overruled", self.CON_label))
        self.AC.textEdited.connect(lambda: self.overrule_value("ac_overruled", self.AC_label))
        self.STR.setValidator(QtGui.QIntValidator())
        self.DEX.setValidator(QtGui.QIntValidator())
        self.CON.setValidator(QtGui.QIntValidator())
        self.AC.setValidator(QtGui.QIntValidator())

        self.STR_label.clicked.connect(lambda: self.restore_value("strength_overruled", self.STR_label))
        self.DEX_label.clicked.connect(lambda: self.restore_value("dexterity_overruled", self.DEX_label))
        self.CON_label.clicked.connect(lambda: self.restore_value("constitution_overruled", self.CON_label))
        self.AC_label.clicked.connect(lambda: self.restore_value("ac_overruled", self.AC_label)) 
Example 24
Project: MindPong   Author: PolyCortex   File: SettingsTab.py    MIT License 5 votes vote down vote up
def _init_muse_configs(self):
        muse_label = QLabel("Muse")
        muse_label.setFont(TITLE_FONT)
        self.centralLayout.addWidget(muse_label)

        player_one_label = QLabel("Player One")
        player_one_label.setFont(SUBTITLE_FONT)
        self.centralLayout.addWidget(player_one_label)
        self.port_line_edit_p1 = self._create_player_form_layout("Port :", QIntValidator(1, 65535),  self.delegate.game.players[0].port)

        player_two_label = QLabel("Player Two")
        player_two_label.setFont(SUBTITLE_FONT)
        self.centralLayout.addWidget(player_two_label)
        self.port_line_edit_p2 = self._create_player_form_layout("Port :", QIntValidator(1, 65535),  self.delegate.game.players[1].port)
        self.registered_widgets.extend([muse_label, player_one_label, player_two_label]) 
Example 25
Project: sane-subfeed   Author: BluABK   File: config_view.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def add_config_tab_gui(self):
        self.add_option_line_edit('Videos to load by default', 'Model', 'loaded_videos',
                                  cfg_validator=QIntValidator())
        self.add_option_checkbox('Grey background on old (1d+) videos', 'Gui', 'grey_old_videos')
        self.add_option_line_edit('Grid tile height (px)', 'Gui', 'tile_pref_height', cfg_validator=QIntValidator())
        self.add_option_line_edit('Grid tile width (px)', 'Gui', 'tile_pref_width', cfg_validator=QIntValidator())
        self.add_option_line_edit('Grid tile overlay height (%)', 'Gui', 'tile_overlay_height_pct',
                                  cfg_validator=QIntValidator())
        self.add_option_line_edit('Grid tile overlay width (%)', 'Gui', 'tile_overlay_width_pct',
                                  cfg_validator=QIntValidator())
        self.add_option_checkbox('Embed thumbnails in tooltips', 'Gui', 'tooltip_pictures')
        tooltip_thumb_disabled = not read_config('Gui', 'tooltip_pictures')
        self.add_option_line_edit('\tTooltip picture width', 'Gui', 'tooltip_picture_width',
                                  cfg_validator=QIntValidator(), disabled=tooltip_thumb_disabled)
        self.add_option_line_edit('\tTooltip picture height', 'Gui', 'tooltip_picture_height',
                                  cfg_validator=QIntValidator(), disabled=tooltip_thumb_disabled)
        self.add_option_combobox('\tTooltip picture font size', 'Gui', 'tooltip_picture_size',
                                 TT_FONT_SIZES, disabled=tooltip_thumb_disabled)
        self.add_option_checkbox('Keep Aspect Ratio on resized thumbnails', 'Gui', 'keep_thumb_ar', restart_check=False)
        self.add_option_checkbox('Auto copy to clipboard', 'Gui', 'enable_auto_copy_to_clipboard', restart_check=False)
        self.add_section('{}Theme{}'.format(self.deco_l, self.deco_r))
        self.add_option_line_edit('Set custom background color hexadecimal <br/>'
                                  '(only works in default theme. Ex: #ffffff for white bg)',
                                  'Gui', 'bgcolor',
                                  cfg_validator=QRegExpValidator(QRegExp(HEXADECIMAL_COLOR_REGEX)))
        self.add_option_button('Clear bgcolor', 'Clears the background color setting ', 'Gui', 'bgcolor',
                               tooltip='(required due to validator shenanigans)', clear=True)
        self.add_option_checkbox('Use darkmode icon set', 'Gui', 'darkmode_icons')
        self.add_option_line_edit('Toolbar icon size modifier (Useful on High DPI displays)',
                                  'Gui', 'toolbar_icon_size_modifier', actions=[self.root.update_toolbar_size,
                                                                                self.root.respawn_menubar_and_toolbar])
        self.add_option_info_restart_required() 
Example 26
Project: sane-subfeed   Author: BluABK   File: config_view.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def add_config_tab_logging(self):
        self.add_option_checkbox('Use socket instead of file', 'Logging', 'use_socket_log')
        self.add_option_line_edit('Log level', 'Logging', 'log_level', cfg_validator=QIntValidator())
        self.add_option_line_edit('Port', 'Logging', 'logging_port', cfg_validator=QIntValidator())
        self.add_option_info('Level\t Name', None)
        for level, value in self.logger.my_log_levels.items():
            self.add_option_info('{}\t{}'.format(value, level), None)
        self.add_option_info_restart_required() 
Example 27
Project: PvsNP   Author: smu160   File: data_dialogs.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super(AxisDialog, self).__init__(parent)

        self.vert_layout = QtWidgets.QVBoxLayout()

        self.hbox = QtWidgets.QHBoxLayout()

        lower_axis_label = QtWidgets.QLabel("Lower bound:")
        self.lower_axis = QtWidgets.QLineEdit()
        self.lower_axis.setValidator(QtGui.QIntValidator())

        upper_axis_label = QtWidgets.QLabel("Upper bound:")
        self.upper_axis = QtWidgets.QLineEdit()
        self.upper_axis.setValidator(QtGui.QIntValidator())

        self.hbox.addWidget(lower_axis_label)
        self.hbox.addWidget(self.lower_axis)
        self.hbox.addWidget(upper_axis_label)
        self.hbox.addWidget(self.upper_axis)

        self.vert_layout.addLayout(self.hbox)

        self.ok_button = QtWidgets.QPushButton("Ok")
        self.ok_button.clicked.connect(self.on_ok)

        self.cancel_button = QtWidgets.QPushButton("Cancel")
        self.cancel_button.clicked.connect(self.on_cancel)

        self.button_box = QtWidgets.QHBoxLayout()
        self.button_box.addWidget(self.ok_button)
        self.button_box.addWidget(self.cancel_button)

        self.vert_layout.addLayout(self.button_box)
        self.setLayout(self.vert_layout)

        self.exit_status = 0

        self.lower_bound = None
        self.upper_bound = None 
Example 28
Project: quick   Author: szsdk   File: quick.py    GNU General Public License v3.0 5 votes vote down vote up
def to_widget(self, opt):
        return GStringLineEditor.to_widget(self, opt,
                validator=QtGui.QIntValidator()) 
Example 29
Project: quick   Author: szsdk   File: quick.py    GNU General Public License v3.0 5 votes vote down vote up
def select_type_validator(tp: click.types.ParamType)-> QtGui.QValidator:
    """ select the right validator for `tp`"""
    if isinstance(tp, click.types.IntParamType):
        return QtGui.QIntValidator()
    elif isinstance(tp, click.types.FloatParamType):
        return QtGui.QDoubleValidator()
    return None 
Example 30
Project: USBIPManager   Author: lompal   File: ModalSoftwareSettings.py    MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        # noinspection PyArgumentList
        super(SoftwareSettingUI, self).__init__(parent)
        self.setAttribute(Qt.WA_DeleteOnClose)
        uic.loadUi("ui/ModalSoftwareSettings.ui", self)

        # Getting the configuration from config.ini file
        self.config = config.get_config()
        # Interface
        self.language_index = int(self.config["SETTINGS"]["software_language"])
        self.language.setCurrentIndex(self.language_index)
        self.language.currentIndexChanged.connect(self.language_alert)
        #
        self.default_port.setText(self.config["SETTINGS"]["server_default_port"])
        self.socket_timeout.setText(self.config["SETTINGS"]["server_socket_timeout"].replace(".", ","))
        self.polling_time.setText(self.config["SETTINGS"]["server_polling_time"].replace(".", ","))
        self.connecting_timeout.setText(self.config["SETTINGS"]["connecting_timeout"].replace(".", ","))
        self.updating_time.setText(self.config["SETTINGS"]["device_updating_time"].replace(".", ","))

        # Obligatory line edit list
        self.linedit_list = [self.default_port, self.socket_timeout, self.polling_time, self.updating_time]
        #
        for linedit in self.linedit_list:
            linedit.textChanged.connect(partial(text_changed, linedit))

        # Setting input validation for line edits
        self.default_port.setValidator(QIntValidator())
        self.socket_timeout.setValidator(QDoubleValidator())
        self.polling_time.setValidator(QDoubleValidator())
        self.connecting_timeout.setValidator(QDoubleValidator())
        self.updating_time.setValidator(QDoubleValidator())

        #
        self.apply_button.clicked.connect(self.apply_action)
        self.cancel_button.clicked.connect(self.close)

    # 
Example 31
Project: pyvisualcompare   Author: nspo   File: main.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super(UrlDialog, self).__init__(parent)
        self.setWindowTitle("Enter URL")

        vbox = QVBoxLayout(self)

        grid = QGridLayout()
        vbox.addLayout(grid)

        grid.addWidget(QLabel("URL of web page"), 0, 0)

        self.url_edit = QLineEdit(self)
        self.url_edit.setPlaceholderText("https://duckduckgo.com")
        grid.addWidget(self.url_edit, 0, 1)

        grid.addWidget(QLabel("Static size"), 1, 0)
        self.static_size_edit = QCheckBox()
        self.static_size_edit.stateChanged.connect(self.setSizeFieldsEnabled)
        grid.addWidget(self.static_size_edit, 1, 1)

        grid.addWidget(QLabel("Width of page"), 2, 0)
        self.width_edit = QLineEdit()
        self.width_edit.setText("1280")
        self.width_edit.setValidator(QIntValidator(0, 99999))
        self.width_edit.setDisabled(True)
        grid.addWidget(self.width_edit, 2, 1)

        grid.addWidget(QLabel("Height of page"), 3, 0)
        self.height_edit = QLineEdit()
        self.height_edit.setText("1024")
        self.height_edit.setValidator(QIntValidator(0, 99999))
        self.height_edit.setDisabled(True)
        grid.addWidget(self.height_edit, 3, 1)

        # OK and Cancel buttons
        buttons = QDialogButtonBox(
            QDialogButtonBox.Ok | QDialogButtonBox.Cancel,
            Qt.Horizontal, self)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)
        vbox.addWidget(buttons) 
Example 32
Project: Cocktailmaker_AW   Author: AndreWohnsland   File: setupui.py    MIT License 4 votes vote down vote up
def __init__(self, parent):
        super(HandaddWidget, self).__init__(parent)
        self.setupUi(self)
        self.setWindowFlags(
            Qt.Window |
            Qt.CustomizeWindowHint |
            Qt.WindowTitleHint |
            Qt.WindowCloseButtonHint |
            Qt.WindowStaysOnTopHint
            )
        self.ms = parent
        self.setWindowIcon(QIcon("Cocktail-icon.png"))
        # get all ingredients from the DB (all of them, handadd and normal, bc you may want to add normal as well)
        # first get a sortet list of all hand ingredients
        handingredients = self.ms.c.execute("SELECT Name FROM Zutaten WHERE Hand = 1")
        hand_list = []
        for ingredient in handingredients:
            hand_list.append(ingredient[0])
        hand_list.sort()
        # then get a sorted list of all normal ingredients
        normalingredients = self.ms.c.execute("SELECT Name FROM Zutaten WHERE Hand = 0")
        normal_list = []
        for ingredient in normalingredients:
            normal_list.append(ingredient[0])
        normal_list.sort()
        # combines both list, the normal at the bottom, since you want use them as often as the hand ones
        ing_list = hand_list + normal_list
        # goes through all CB and assign a empty value and all other listvalies
        for i in range(1, 6):
            CBhand = getattr(self, "CBHandadd" + str(i))
            CBhand.addItem("")
            for ing in ing_list:
                CBhand.addItem(ing)
        # connect the buttons
        self.PBAbbrechen.clicked.connect(self.abbrechen_clicked)
        self.PBEintragen.clicked.connect(self.eintragen_clicked)
        for i in range(1,6):
            LEHand = getattr(self, "LEHandadd" + str(i))
            LEHand.clicked.connect((lambda o=LEHand: self.ms.passwordwindow(le_to_write=o, x_pos=400, y_pos=50, headertext="Menge eingeben!")))
            LEHand.setValidator(QIntValidator(0, 300))
            LEHand.setMaxLength(3)
        for i, row in enumerate(self.ms.handaddlist):
            ing_name = self.ms.c.execute("SELECT Name FROM Zutaten WHERE ID = ?", (row[0],)).fetchone()[0]
            cb_obj = getattr(self, "CBHandadd" + str(i+1))
            le_obj = getattr(self, "LEHandadd" + str(i+1))
            index = cb_obj.findText(ing_name, Qt.MatchFixedString)
            cb_obj.setCurrentIndex(index)
            le_obj.setText(str(row[1]))
        self.move(0, 100) 
Example 33
Project: AutoSplit64   Author: Kainev   File: settings_dialog.py    GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(title="Advanced", parent=parent)

        # Layouts
        self.menu_layout = QtWidgets.QGridLayout()

        # Widgets
        self.reset_one_lb = QtWidgets.QLabel("Reset Frame One:")
        self.reset_one_le = QtWidgets.QLineEdit("")
        self.reset_one_btn = QtWidgets.QPushButton("Browse")

        self.reset_two_lb = QtWidgets.QLabel("Reset Frame Two:")
        self.reset_two_le = QtWidgets.QLineEdit("")
        self.reset_two_btn = QtWidgets.QPushButton("Browse")

        self.restart_delay_lb = QtWidgets.QLabel("Restart Split Offset:")
        self.restart_delay_sb = QtWidgets.QSpinBox()

        self.file_select_offset_lb = QtWidgets.QLabel("File Select Offset:")
        self.file_select_offset_sb = QtWidgets.QSpinBox()

        self.star_delay_lb = QtWidgets.QLabel("Star Frame Rate:")
        self.star_delay_le = QtWidgets.QLineEdit("")

        self.fadeout_delay_lb = QtWidgets.QLabel("Fadeout Frame Rate:")
        self.fadeout_delay_le = QtWidgets.QLineEdit("")

        self.model_lb = QtWidgets.QLabel("Detection Model:")
        self.model_le = QtWidgets.QLineEdit("")
        self.model_btn = QtWidgets.QPushButton("Browse")

        self.model_width_lb = QtWidgets.QLabel("Model Width:")
        self.model_width_le = QtWidgets.QLineEdit()
        self.model_height_lb = QtWidgets.QLabel("Model Height:")
        self.model_height_le = QtWidgets.QLineEdit()

        self.int_validator = QtGui.QIntValidator()

        self.int_validator = QtGui.QIntValidator()
        self.double_validator = QtGui.QDoubleValidator()

        self.init() 
Example 34
Project: AutoSplit64   Author: Kainev   File: output_dialog.py    GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowCloseButtonHint)
        self.window_title = "Output"
        self.setWindowIcon(QtGui.QIcon(resource_utils.base_path(ICON_PATH)))

        # Output Reader
        self.output_reader = None

        #
        self._update_rate = config.get("general", "output_update_rate")

        # Layouts
        self.primary_layout = QtWidgets.QGridLayout()

        # Widgets
        self.fade_status_lb = QtWidgets.QLabel("Fade Status:")
        self.fade_out_lb = QtWidgets.QLabel("Fade-out Count:")
        self.fade_in_lb = QtWidgets.QLabel("Fade-in Count:")
        self.xcam_percent_lb = QtWidgets.QLabel("X-Cam Percent:")
        self.xcam_lb = QtWidgets.QLabel("X-Cam Count:")
        self.xcam_status_lb = QtWidgets.QLabel("X-Cam Status:")
        self.prediction_lb = QtWidgets.QLabel("Prediction:")
        self.probability_lb = QtWidgets.QLabel("Probability:")
        self.execution_lb = QtWidgets.QLabel("Execution Time:")
        self.update_lb = QtWidgets.QLabel("Update Rate:")

        self.fade_status_le = QtWidgets.QLineEdit()
        self.fade_out_le = QtWidgets.QLineEdit()
        self.fade_in_le = QtWidgets.QLineEdit()
        self.xcam_percent_le = QtWidgets.QLineEdit()
        self.xcam_le = QtWidgets.QLineEdit()
        self.xcam_status_le = QtWidgets.QLineEdit()
        self.prediction_le = QtWidgets.QLineEdit()
        self.probability_le = QtWidgets.QLineEdit()
        self.execution_le = QtWidgets.QLineEdit()
        self.update_le = QtWidgets.QLineEdit()

        self.update_enabled = True

        # Validators
        self._int_validator = QtGui.QIntValidator(0, 30)

        self.initialize_window() 
Example 35
Project: base   Author: JdeRobot   File: controlWidget.py    GNU General Public License v3.0 4 votes vote down vote up
def rgbButtonState(self):
        if self.rgbButton.isChecked():
            self.winParent.setFilterName('RGB')

            rmin,gmin,bmin = RGBMIN
            rmax,gmax,bmax = RGBMAX
            rd, gd, bd = self.rgbdwn
            ru, gu, bu = self.rgbup
            self.hminLabel.setText('Rmin')
            self.hminValue.setText(str(rd))
            self.hminValue.setValidator(QIntValidator(rmin, rmax, self));
            self.hminSlider.setMinimum(rmin)
            self.hminSlider.setMaximum(rmax)
            self.hminSlider.setValue(rd)

            self.hmaxLabel.setText("RMax")
            self.hmaxValue.setText(str(ru))
            self.hmaxValue.setValidator(QIntValidator(rmin, rmax, self));
            self.hmaxSlider.setMinimum(rmin)
            self.hmaxSlider.setMaximum(rmax)
            self.hmaxSlider.setValue(ru)

            self.sminLabel.setText("GMin")
            self.sminValue.setText(str(gd))
            self.sminValue.setValidator(QIntValidator(gmin, gmax, self));
            self.sminSlider.setMinimum(gmin)
            self.sminSlider.setMaximum(gmax)
            self.sminSlider.setValue(gd)

            self.smaxLabel.setText("GMax")
            self.smaxValue.setText(str(gu))
            self.smaxValue.setValidator(QIntValidator(gmin, gmax, self));
            self.smaxSlider.setMinimum(gmin)
            self.smaxSlider.setMaximum(gmax)
            self.smaxSlider.setValue(gu)

            self.vminLabel.setText("BMin")
            self.vminValue.setText(str(bd))
            self.vminValue.setValidator(QIntValidator(bmin, bmax, self));
            self.vminSlider.setMinimum(bmin)
            self.vminSlider.setMaximum(bmax)
            self.vminSlider.setValue(bd)

            self.vmaxLabel.setText("BMax")
            self.vmaxValue.setText(str(bu))
            self.vmaxValue.setValidator(QIntValidator(bmin, bmax, self));
            self.vmaxSlider.setMinimum(bmin)
            self.vmaxSlider.setMaximum(bmax)
            self.vmaxSlider.setValue(bu) 
Example 36
Project: base   Author: JdeRobot   File: controlWidget.py    GNU General Public License v3.0 4 votes vote down vote up
def hsvButtonState(self):
        if self.hsvButton.isChecked():
            self.winParent.setFilterName('HSV')

            hmin,smin,vmin = HSVMIN
            hmax,smax,vmax = HSVMAX

            hd, sd, vd = self.hsvdwn
            hu, su, vu = self.hsvup
            
            self.hminLabel.setText("HMin")
            self.hminValue.setText(str(hd))
            self.hminValue.setValidator(QIntValidator(hmin, hmax, self));
            self.hminSlider.setMinimum(hmin)
            self.hminSlider.setMaximum(hmax)
            self.hminSlider.setValue(hd)

            self.hmaxLabel.setText("HMax")
            self.hmaxValue.setText(str(hu))
            self.hmaxValue.setValidator(QIntValidator(hmin, hmax, self));
            self.hmaxSlider.setMinimum(hmin)
            self.hmaxSlider.setMaximum(hmax)
            self.hmaxSlider.setValue(hu)

            self.sminLabel.setText("SMin")
            self.sminValue.setText(str(sd))
            self.sminValue.setValidator(QIntValidator(smin, smax, self));
            self.sminSlider.setMinimum(smin)
            self.sminSlider.setMaximum(smax)
            self.sminSlider.setValue(sd)

            self.smaxLabel.setText("SMax")
            self.smaxValue.setText(str(su))
            self.smaxValue.setValidator(QIntValidator(smin, smax, self)); 
            self.smaxSlider.setMinimum(smin)
            self.smaxSlider.setMaximum(smax)
            self.smaxSlider.setValue(su)

            self.vminLabel.setText("VMin")
            self.vminValue.setText(str(vd))
            self.vminValue.setValidator(QIntValidator(vmin, vmax, self));
            self.vminSlider.setMinimum(vmin)
            self.vminSlider.setMaximum(vmax)
            self.vminSlider.setValue(vd)

            self.vmaxLabel.setText("VMax")
            self.vmaxValue.setText(str(vu))
            self.vmaxValue.setValidator(QIntValidator(vmin, vmax, self));
            self.vmaxSlider.setMinimum(vmin)
            self.vmaxSlider.setMaximum(vmax)
            self.vmaxSlider.setValue(vu) 
Example 37
Project: base   Author: JdeRobot   File: controlWidget.py    GNU General Public License v3.0 4 votes vote down vote up
def yuvButtonState(self):
        if self.yuvButton.isChecked():  
            self.winParent.setFilterName('YUV')

            ymin,umin,vmin = YUVMIN
            ymax,umax,vmax = YUVMAX

            yd, ud, vd = self.yuvdwn
            yu, uu, vu = self.yuvup
            
            self.hminLabel.setText("YMin")
            self.hminValue.setText(str(yd))
            self.hminValue.setValidator(QIntValidator(ymin, ymax, self));
            self.hminSlider.setMinimum(ymin)
            self.hminSlider.setMaximum(ymax)
            self.hminSlider.setValue(yd)

            self.hmaxLabel.setText("YMax")
            self.hmaxValue.setText(str(yu))
            self.hmaxValue.setValidator(QIntValidator(ymin, ymax, self));
            self.hmaxSlider.setMinimum(ymin)
            self.hmaxSlider.setMaximum(ymax)
            self.hmaxSlider.setValue(yu)

            self.sminLabel.setText("UMin")
            self.sminValue.setText(str(ud))
            self.sminValue.setValidator(QIntValidator(umin, umax, self));
            self.sminSlider.setMinimum(umin)
            self.sminSlider.setMaximum(umax)
            self.sminSlider.setValue(ud)

            self.smaxLabel.setText("UMax")
            self.smaxValue.setText(str(uu))
            self.smaxValue.setValidator(QIntValidator(umin, umax, self));
            self.smaxSlider.setMinimum(umin)
            self.smaxSlider.setMaximum(umax)
            self.smaxSlider.setValue(uu)

            self.vminLabel.setText("VMin")
            self.vminValue.setText(str(vd))
            self.vminValue.setValidator(QIntValidator(vmin, vmax, self));
            self.vminSlider.setMinimum(vmin)
            self.vminSlider.setMaximum(vmax)
            self.vminSlider.setValue(vd)

            self.vmaxLabel.setText("VMax")
            self.vmaxValue.setText(str(vu))
            self.vmaxValue.setValidator(QIntValidator(vmin, vmax, self));
            self.vmaxSlider.setMinimum(vmin)
            self.vmaxSlider.setMaximum(vmax)
            self.vmaxSlider.setValue(vu) 
Example 38
Project: Pythonic   Author: hANSIc99   File: basic_stack.py    GNU General Public License v3.0 4 votes vote down vote up
def writeInput(self):

        self.write_input = QWidget()
        self.write_layout = QVBoxLayout(self.write_input)

        self.write_input_line = QWidget()
        self.write_input_layout = QHBoxLayout(self.write_input_line)

        self.array_config = QWidget()
        self.array_config_layout = QHBoxLayout(self.array_config)

        self.outpub_behaviour = QWidget()
        self.output_behaviour_layout = QHBoxLayout()

        self.write_txt = QLabel()
        self.write_txt.setText(QC.translate('', 'Do this with input:'))

        self.select_write_mode = QComboBox()
        self.select_write_mode.addItem(QC.translate('', 'Nothing'), QVariant('none'))
        self.select_write_mode.addItem(QC.translate('', 'Insert'), QVariant('i'))
        self.select_write_mode.addItem(QC.translate('', 'Append'), QVariant('a'))

        # maximum array size
        self.array_limits_cbox = QCheckBox()
        self.array_limits_cbox.stateChanged.connect(self.toggleArrayLimits)

        

        self.array_limit_txt = QLabel()
        self.array_limit_txt.setText(QC.translate('', 'Max. array elements:'))

        self.max_array_elements = QLineEdit()
        self.max_array_elements.setValidator(QIntValidator(1, 999))
        self.max_array_elements.setPlaceholderText(QC.translate('', 'Default value: 20'))


        self.array_config_layout.addWidget(self.array_limits_cbox)
        self.array_config_layout.addWidget(self.array_limit_txt)
        self.array_config_layout.addWidget(self.max_array_elements)



        self.write_input_layout.addWidget(self.write_txt)
        self.write_input_layout.addWidget(self.select_write_mode)
        #self.write_layout.addWidget(self.array_limits)

        self.write_layout.addWidget(self.write_input_line)
        self.write_layout.addWidget(self.array_config)

        #self.variable_box.addWidget(self.write_input)