Python PyQt5.QtWidgets.QCheckBox() Examples

The following are code examples for showing how to use PyQt5.QtWidgets.QCheckBox(). 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: ANGRYsearch   Author: DoTheEvo   File: angrysearch.py    GNU General Public License v2.0 6 votes vote down vote up
def __init__(self, setting_params=None):
        super().__init__()
        self.setting_params = setting_params
        self.search_input = Qw.QLineEdit()
        self.table = AngryTableView(self.setting_params['angrysearch_lite'],
                                    self.setting_params['row_height'])
        self.upd_button = Qw.QPushButton('update')
        self.fts_checkbox = Qw.QCheckBox()

        grid = Qw.QGridLayout()
        grid.setSpacing(10)

        grid.addWidget(self.search_input, 1, 1)
        grid.addWidget(self.fts_checkbox, 1, 3)
        grid.addWidget(self.upd_button, 1, 4)
        grid.addWidget(self.table, 2, 1, 4, 4)
        self.setLayout(grid)

        self.setTabOrder(self.search_input, self.table)
        self.setTabOrder(self.table, self.upd_button)


# THE MAIN APPLICATION WINDOW WITH THE STATUS BAR AND LOGIC
# LOADS AND SAVES QSETTINGS FROM ~/.config/angrysearch
# INITIALIZES AND SETS GUI, WAITING FOR USER INPUTS 
Example 2
Project: LeitnerEmulator   Author: lovac42   File: plan0.py    GNU General Public License v3.0 6 votes vote down vote up
def dconfsetupUi(self, Dialog):
    r=self.gridLayout_3.rowCount()

    self.sm0emu = QtWidgets.QCheckBox(self.tab_3)
    self.sm0emu.setObjectName(_fromUtf8("sm0emu"))
    self.sm0emu.setText(_('Use Custom Intervals'))
    self.gridLayout_3.addWidget(self.sm0emu, r, 0, 1, 3)
    self.sm0emu.toggled.connect(lambda:togglesm0emuCB(self))
    r+=1

    self.sm2HLayout = QtWidgets.QHBoxLayout()
    self.sm2HLayout.setObjectName(_fromUtf8("sm2HLayout"))
    self.sm0StepsLabel = QtWidgets.QLabel(Dialog)
    self.sm0StepsLabel.setObjectName(_fromUtf8("sm0StepsLabel"))
    self.sm0StepsLabel.setText(_("Ivl Steps:"))
    self.sm2HLayout.addWidget(self.sm0StepsLabel)

    self.sm0Steps = QtWidgets.QLineEdit(self.tab_3)
    self.sm0Steps.setObjectName(_fromUtf8("sm0Steps"))
    self.sm2HLayout.addWidget(self.sm0Steps)
    self.gridLayout_3.addLayout(self.sm2HLayout, r, 0, 1, 2) 
Example 3
Project: QuantStudio   Author: Scorpi000   File: ResultDlg.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None, data_range=[], data=None):
        super().__init__(parent)
        self.DataRange = data_range
        self.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
        self.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        nData = len(data_range)
        self.setRowCount(nData)
        self.setColumnCount(1)
        self.setHorizontalHeaderLabels(['参数值'])
        self.setVerticalHeaderLabels([str(iData) for iData in data_range])
        if data is None:
            for i in range(nData):
                iWidget = QtWidgets.QCheckBox(None)
                iWidget.setChecked(True)
                self.setCellWidget(i,0,iWidget)
        else:
            for i,iData in enumerate(data_range):
                iWidget = QtWidgets.QCheckBox(None)
                iWidget.setChecked((iData in data))
                self.setCellWidget(i,0,iWidget)
        # 设置弹出菜单
        self.addAction(QtWidgets.QAction('全选', self, triggered=self.selectAll))
        self.addAction(QtWidgets.QAction('全不选', self, triggered=self.selectNone))
        self.addAction(QtWidgets.QAction('反选', self, triggered=self.selectOpposite))
        return 
Example 4
Project: cct   Author: awacha   File: settingspage.py    BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def fromConfig(self, config:Config):
        for widget, configname in self._trackedWidgets:
            if isinstance(widget, QtWidgets.QComboBox):
                idx = widget.findText(getattr(config, configname))
                if idx<0:
                    raise ValueError('Cannot find config value {} for item {} in the list for the combo box.'.format(getattr(config, configname), configname))
                widget.setCurrentIndex(idx)
            elif isinstance(widget, QtWidgets.QSpinBox) or isinstance(widget, QtWidgets.QDoubleSpinBox):
                widget.setValue(getattr(config, configname))
            elif isinstance(widget, QtWidgets.QCheckBox):
                widget.setChecked(getattr(config, configname))
            elif isinstance(widget, QtWidgets.QLineEdit):
                widget.setText(getattr(config, configname))
            else:
                raise ValueError(
                    'Unknown widget type {} associated with config item {}'.format(type(widget), configname))
        self.resetChangedWidgets() 
Example 5
Project: MeiTingTrunk   Author: Xunius   File: preference_dialog.py    GNU General Public License v3.0 6 votes vote down vote up
def omitKeysGroupChanged(self, on, groupbox):
        '''Change check states in the omit keys checkbox group as a whole'''

        omit_keys=[]

        for box in groupbox.findChildren(QtWidgets.QCheckBox):
            box.stateChanged.disconnect()
            box.setChecked(on)
            box.setEnabled(True)
            box.stateChanged.connect(self.omitKeyChanged)
            if box.isChecked():
                omit_keys.append(box.text())

        self.new_values['export/bib/omit_fields']=omit_keys

        return 
Example 6
Project: Lector   Author: BasioMeusPuga   File: annotations.py    GNU General Public License v3.0 6 votes vote down vote up
def modify_annotation(self):
        sender = self.sender()
        if isinstance(sender, QtWidgets.QCheckBox):
            if not sender.isChecked():
                self.update_preview()
                return

        new_color = None

        if sender == self.foregroundColorButton:
            new_color = self.get_color(self.foregroundColor)
            self.foregroundColor = new_color

        if sender == self.highlightColorButton:
            new_color = self.get_color(self.highlightColor)
            self.highlightColor = new_color

        if sender == self.underlineColorButton:
            new_color = self.get_color(self.underlineColor)
            self.underlineColor = new_color

        if new_color:
            self.set_button_background_color(sender, new_color)
        self.update_preview() 
Example 7
Project: plexdesktop   Author: coryo   File: extra_widgets.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.setWindowTitle('Manual Add Server')
        self.form = QtWidgets.QFormLayout(self)
        self.secure = QtWidgets.QCheckBox()
        self.address = QtWidgets.QLineEdit()
        self.port = QtWidgets.QLineEdit('32400')
        self.token = QtWidgets.QLineEdit()
        self.form.addRow(QtWidgets.QLabel('HTTPS?'), self.secure)
        self.form.addRow(QtWidgets.QLabel('Address'), self.address)
        self.form.addRow(QtWidgets.QLabel('Port'), self.port)
        self.form.addRow(QtWidgets.QLabel('Access Token (optional)'), self.token)
        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) 
Example 8
Project: FIRST-plugin-ida   Author: vrtadmin   File: first.py    GNU General Public License v2.0 6 votes vote down vote up
def init_middle_layout(self):
            if not self.should_show:
                return

            vbox = QtWidgets.QVBoxLayout()
            self.select_all = QtWidgets.QCheckBox('Select All ')
            self.filter_sub_funcs = QtWidgets.QCheckBox('Filter Out "sub_" functions ')
            vbox.addWidget(self.filter_sub_funcs)
            vbox.addWidget(self.select_all)

            format_str = '{} functions'.format(self.total_functions)
            self.function_number = QtWidgets.QLabel(format_str)
            self.function_number.setAlignment(Qt.AlignTop)
            self.middle_layout.addWidget(self.function_number)
            self.middle_layout.addStretch()
            self.middle_layout.addLayout(vbox) 
Example 9
Project: FIRST-plugin-ida   Author: vrtadmin   File: first.py    GNU General Public License v2.0 6 votes vote down vote up
def init_middle_layout(self):
            found = len(self.groups)
            total = len(FIRST.Metadata.get_non_jmp_wrapped_functions())
            s = 's' if 1 != total else ''
            label = 'Matched {0} out of {1} function{2}'

            self.select_highest_ranked = QtWidgets.QCheckBox('Select Highest Ranked ')
            self.filter_sub_funcs_only = QtWidgets.QCheckBox('Show only "sub_" functions')

            vbox = QtWidgets.QVBoxLayout()
            vbox.addWidget(self.filter_sub_funcs_only)
            vbox.addWidget(self.select_highest_ranked)

            self.found_format = label.format('{}', total, s)
            self.found_label = QtWidgets.QLabel(self.found_format.format(found))
            self.found_label.setAlignment(Qt.AlignTop)

            self.middle_layout.addWidget(self.found_label)
            self.middle_layout.addStretch()
            self.middle_layout.addLayout(vbox) 
Example 10
Project: ovs-toolbox   Author: nbonnand   File: ovs-toolbox.py    Apache License 2.0 6 votes vote down vote up
def clear_widgets(wtype):
    if(debug):mydebug(inspect.currentframe())

    for w,default_value in cleanable_widget_list[wtype]:
        if(isinstance(w, QtWidgets.QLineEdit)):
            w.setText(default_value)
        elif(isinstance(w, QtWidgets.QCheckBox)):
            w.setChecked(default_value)
        elif(isinstance(w, QtWidgets.QRadioButton)):
            w.setChecked(default_value)
        elif(isinstance(w, QtWidgets.QLabel)):
            w.setText(default_value)
        elif(isinstance(w, QtWidgets.QComboBox)):
            w.setCurrentIndex(default_value)


                
#--------------------------------------------------------------- 
Example 11
Project: DevilYuan   Author: moyuanz   File: DyStockDataHistDaysManualUpdateDlg.py    MIT License 6 votes vote down vote up
def _createIndicatorGroupBox(self):
        indicatorGroupBox = QGroupBox('指标')

        grid = QGridLayout()
        grid.setSpacing(10)

        rowNbr = 4
        self._indicatorCheckBoxList = []
        for i, indicator in enumerate(DyStockDataCommon.dayIndicators):
            checkBox = QCheckBox(indicator)
            checkBox.setChecked(True)

            grid.addWidget(checkBox, i//rowNbr, i%rowNbr)

            self._indicatorCheckBoxList.append(checkBox)

        indicatorGroupBox.setLayout(grid)

        return indicatorGroupBox 
Example 12
Project: gaitutils   Author: jjnurminen   File: qt_dialogs.py    GNU General Public License v3.0 6 votes vote down vote up
def _create_tab(self, section, secname):
        """Create a tab for the tab widget, according to config items"""
        tab = QtWidgets.QWidget()
        lout = QtWidgets.QFormLayout()
        tab.setLayout(lout)
        # get items sorted by comment
        items = sorted(
            (item for (itname, item) in section),
            key=lambda it: configdot.get_description(it),
        )
        for item in items:
            desc = configdot.get_description(item)
            if isinstance(item.value, bool):
                input_widget = QtWidgets.QCheckBox()
                input_widget.setChecked(item.value)
            else:
                input_widget = QtWidgets.QLineEdit()
                input_widget.setText(item.literal_value)
                input_widget.setCursorPosition(0)  # show beginning of line
            lout.addRow(desc, input_widget)
            self._input_widgets[secname][item.name] = input_widget
        return tab 
Example 13
Project: gaitutils   Author: jjnurminen   File: qt_dialogs.py    GNU General Public License v3.0 6 votes vote down vote up
def _update_cfg(self):
        """Update cfg according to input widgets"""
        for secname, sec in cfg:
            for itemname, item in sec:
                _widget = self._input_widgets[secname][itemname]
                if isinstance(_widget, QtWidgets.QLineEdit):
                    try:
                        item.value = ast.literal_eval(_widget.text())
                    except (SyntaxError, ValueError):
                        return itemname, _widget.text()
                elif isinstance(_widget, QtWidgets.QCheckBox):
                    item.value = _widget.isChecked()
                else:
                    raise RuntimeError('Invalid input widget class, how come?')
        _handle_cfg_defaults(cfg)
        return None, None 
Example 14
Project: kawaii-player   Author: kanishka-linux   File: settings_widget.py    GNU General Public License v3.0 6 votes vote down vote up
def configsettings(self):
        self.line501 = QtWidgets.QTextEdit()
        self.gl7.addWidget(self.line501, 0, 0, 1, 3)
        msg = '<html>Use this config file, otherwise global config file will be used</html>'
        self.checkbox = QtWidgets.QCheckBox("Use This Config File")
        self.checkbox.setMinimumHeight(30)
        self.checkbox.stateChanged.connect(self.use_config_file)
        self.checkbox.setToolTip(msg)
        self.gl7.addWidget(self.checkbox, 1, 0, 1, 1)
        if ui.use_custom_config_file:
            self.checkbox.setChecked(True)
        mpvlist = self.basic_params(player='mpv')
        mpvstr = '\n'.join(mpvlist)
        self.line501.setText(mpvstr) 
        
        self.btn_default_settings = QPushButtonExtra('Default Settings')
        self.gl7.addWidget(self.btn_default_settings, 1, 1, 1, 1)
        self.btn_default_settings.clicked_connect(self.get_default_config_settings)
        self.btn_default_settings.setMinimumHeight(30)
        
        self.btn_confirm = QPushButtonExtra('Save Changes')
        self.gl7.addWidget(self.btn_confirm, 1, 2, 1, 1)
        self.btn_confirm.clicked_connect(self.save_config_settings)
        self.btn_confirm.setMinimumHeight(30) 
Example 15
Project: cct   Author: awacha   File: motorconfig.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def setupUi(self, Form):
        Ui_Form.setupUi(self, Form)
        self.warningIconLabel.setPixmap(
            QtGui.QIcon.fromTheme('dialog-warning').pixmap(
                48, 48
            ))
        self.setWindowTitle('Configure Motor {}'.format(self.motor.name))
        self.applyPushButton.clicked.connect(self.onApply)
        self.calibratePushButton.clicked.connect(self.onCalibrate)
        self.resetPushButton.clicked.connect(self.onReset)
        self.motorNameLabel.setText(self.motor.name)
        self.controllerNameLabel.setText(self.motor._controller.name)
        self.onReset()
        self.leftLimitDoubleSpinBox.valueChanged.connect(self.onSoftLimitChanged)
        self.rightLimitDoubleSpinBox.valueChanged.connect(self.onSoftLimitChanged)
        self.pulseDivisorSpinBox.valueChanged.connect(self.calculateSpeedAndAccel)
        self.rampDivisorSpinBox.valueChanged.connect(self.calculateSpeedAndAccel)
        self.microstepExponentSpinBox.valueChanged.connect(self.calculateSpeedAndAccel)
        self.rawMaxSpeedSpinBox.valueChanged.connect(self.calculateSpeedAndAccel)
        self.rawMaxAccelSpinBox.valueChanged.connect(self.calculateSpeedAndAccel)
        for widget in [self.driveRMSCurrentDoubleSpinBox,
                       self.standbyRMSCurrentDoubleSpinBox,
                       self.freewheelingDelayDoubleSpinBox,
                       self.pulseDivisorSpinBox,
                       self.rampDivisorSpinBox,
                       self.microstepExponentSpinBox,
                       self.rawMaxSpeedSpinBox,
                       self.rawMaxAccelSpinBox,
                       self.leftSwitchEnabledCheckBox,
                       self.rightSwitchEnabledCheckBox,
                       self.leftLimitDoubleSpinBox,
                       self.rightLimitDoubleSpinBox]:
            if isinstance(widget, (QtWidgets.QSpinBox, QtWidgets.QDoubleSpinBox)):
                widget.valueChanged.connect(self.onWidgetChanged)
            elif isinstance(widget, QtWidgets.QCheckBox):
                widget.toggled.connect(self.onWidgetChanged)
            else:
                raise TypeError(type(widget))
        self.adjustSize() 
Example 16
Project: cct   Author: awacha   File: motorconfig.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def onApply(self):
        changes = {}
        for widget, attribute in [
            (self.driveRMSCurrentDoubleSpinBox, 'maxcurrent'),
            (self.standbyRMSCurrentDoubleSpinBox, 'standbycurrent'),
            (self.freewheelingDelayDoubleSpinBox, 'freewheelingdelay'),
            (self.pulseDivisorSpinBox, 'pulsedivisor'),
            (self.rampDivisorSpinBox, 'rampdivisor'),
            (self.microstepExponentSpinBox, 'microstepresolution'),
            (self.rawMaxSpeedSpinBox, 'maxspeedraw'),
            (self.rawMaxAccelSpinBox, 'maxaccelerationraw'),
            (self.leftSwitchEnabledCheckBox, 'leftswitchenable'),
            (self.rightSwitchEnabledCheckBox, 'rightswitchenable'),
            (self.leftLimitDoubleSpinBox, 'softleft'),
            (self.rightLimitDoubleSpinBox, 'softright')]:
            assert isinstance(widget, QtWidgets.QWidget)
            if widget.palette().color(QtGui.QPalette.Base) != QtGui.QColor('yellow'):
                continue
            if isinstance(widget, (QtWidgets.QDoubleSpinBox, QtWidgets.QSpinBox)):
                changes[attribute] = widget.value()
            elif isinstance(widget, QtWidgets.QCheckBox):
                changes[attribute] = widget.isChecked()
        result = QtWidgets.QMessageBox.warning(
            self,
            'Confirm changes',
            'Do you really want to commit the following changes to motor {}?\n'.format(self.motor.name) +
            '\n'.join(['{}: {} -> {}'.format(attr, self.motor.get_variable(attr), changes[attr])
                       for attr in sorted(changes)]),
            QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.No
        )
        if result == QtWidgets.QMessageBox.Yes:
            for attr in changes:
                self.motor.set_variable(attr, changes[attr])
        self.resetEntryBackgrounds() 
Example 17
Project: cct   Author: awacha   File: subtractionparameterdelegate.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, parent):
        super().__init__(parent)
        self.alphaCheckBox = QtWidgets.QCheckBox('α', self)
        self.layout.addWidget(self.alphaCheckBox)
        self.alphaCheckBox.setChecked(False)
        self.alphaSpinBox = QtWidgets.QDoubleSpinBox(self)
        self.alphaSpinBox.setRange(-6, 0)
        self.alphaSpinBox.setDecimals(4)
        self.alphaCheckBox.toggled.connect(self.alphaSpinBox.setEnabled)
        self.alphaCheckBox.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        self.alphaSpinBox.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Minimum)
        self.layout.addWidget(self.alphaCheckBox,0)
        self.alphaSpinBox.setEnabled(False)
        self.layout.addWidget(self.alphaSpinBox,1) 
Example 18
Project: cct   Author: awacha   File: settingspage.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def initSettingsPage(self, widgetsconfigs:List[Tuple[QtWidgets.QWidget, str]]):
        self._changedWidgets = []
        for widget, configname in widgetsconfigs:
            if isinstance(widget, QtWidgets.QComboBox):
                widget.currentIndexChanged.connect(self.onWidgetChanged)
            elif isinstance(widget, QtWidgets.QDoubleSpinBox) or isinstance(widget, QtWidgets.QSpinBox):
                widget.valueChanged.connect(self.onWidgetChanged)
            elif isinstance(widget, QtWidgets.QCheckBox):
                widget.toggled.connect(self.onWidgetChanged)
            elif isinstance(widget, QtWidgets.QLineEdit):
                widget.textChanged.connect(self.onWidgetChanged)
            else:
                raise ValueError('Invalid widget type: {}'.format(type(widget)))
        self._trackedWidgets = widgetsconfigs 
Example 19
Project: musaic   Author: al165   File: main.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, engine, *args, **kwargs):
        super().__init__(*args, **kwargs)

        print('[ClientOptions]', 'init')

        self._engine = engine

        self.setWindowTitle('musAIc options...')

        layout = QtWidgets.QVBoxLayout()
        form_layout = QtWidgets.QFormLayout()
        layout.addLayout(form_layout)

        self._addr = QtWidgets.QLineEdit(str(self._engine.clientOptions['addr']))
        self._addr.setInputMask('000.000.000.000')
        self._port = QtWidgets.QSpinBox()# str(self._engine.clientOptions['port']))
        self._port.setRange(1024, 65535)
        self._port.setValue(self._engine.clientOptions['port'])
        self._clock = QtWidgets.QCheckBox()
        self._clock.setChecked(self._engine.clientOptions['clock'])

        form_layout.addRow('Address:', self._addr)
        form_layout.addRow('Port:', self._port)
        form_layout.addRow('Send clock:', self._clock)


        buttons = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel)
        layout.addWidget(buttons)

        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)

        self.setLayout(layout) 
Example 20
Project: pyaudiorestoration   Author: HENDRIX-ZT2   File: widgets.py    GNU General Public License v2.0 5 votes vote down vote up
def __init__(self,):
		QtWidgets.QWidget.__init__(self,)
		align_l = QtWidgets.QLabel("\nAlignment")
		align_l.setFont(myFont)
		
		self.align_abs_b = QtWidgets.QCheckBox("Absolute match")
		self.align_abs_b.setChecked(False)
		self.align_abs_b.setToolTip("Turn on if phase does not match.")
		
		buttons = ((align_l,), (self.align_abs_b, ), )
		vbox(self, grid(buttons)) 
Example 21
Project: pyaudiorestoration   Author: HENDRIX-ZT2   File: widgets.py    GNU General Public License v2.0 5 votes vote down vote up
def refill(self, num_channels):
		for channel in self.channel_checkboxes:
			self.channel_layout.removeWidget(channel)
			channel.deleteLater()
		self.channel_checkboxes = []
		
		#fill the channel UI
		channel_names = ("Front Left", "Front Right", "Center", "LFE", "Back Left", "Back Right")
		for i in range(0, num_channels):
			name = channel_names[i] if i < 6 else str(i)
			self.channel_checkboxes.append(QtWidgets.QCheckBox(name))
			# set the startup option to just resample channel 0
			self.channel_checkboxes[-1].setChecked(True if i == 0 else False)
			self.channel_layout.addWidget( self.channel_checkboxes[-1] ) 
Example 22
Project: MeiTingTrunk   Author: Xunius   File: _MainFrameLoadData.py    GNU General Public License v3.0 5 votes vote down vote up
def prepareDocs(meta_dict, docids):
    """Format meta data of docs for display in the doc table

    Args:
        meta_dict (dict): dict containing meta data of all docs in the library,
                          in the format:

                    self.meta_dict[doc_id_in_int] = DocMeta

                          where DocMeta is a dict. See sqlitedb.py for details.
        docids (list): list of doc ids to format.

    Returns: data (list): each element is a list containing 10 fields of a
                          doc to feed into the doc_table QTableView.
    """

    data=[]
    for ii in docids:
        entryii=meta_dict[ii]
        fav_check=QtWidgets.QCheckBox()
        read_check=QtWidgets.QCheckBox()
        fav_check.setChecked(True if entryii['favourite']=='true' else False)
        read_check.setChecked(True if entryii['read']=='true' else False)
        aii=[ii,
            fav_check,
            read_check,
            entryii['has_file'],
            '; '.join(entryii['authors_l']),
            entryii['title'],
            entryii['publication'],
            entryii['year'],
            entryii['added'],
            entryii['confirmed']
            ]

        data.append(aii)

    return data

# NOTE: need to put this after prepareDocs to break a cyclic import 
Example 23
Project: MeiTingTrunk   Author: Xunius   File: zim_dialog.py    GNU General Public License v3.0 5 votes vote down vote up
def loadUpdateFromZimOptions(self):

        scroll,va=self.createFrame('Update document notes from Zim')

        va.addWidget(getHLine())
        self.use_zim_default_cb=QtWidgets.QCheckBox('Use zim notes as default note source?')
        if self.settings.value('saving/use_zim_default', type=bool):
            self.use_zim_default_cb.setChecked(True)

        va.addWidget(self.use_zim_default_cb)
        label=QtWidgets.QLabel('''Zim notes saved in %s will be first examined
                when loading the "Notes" tab. If a zim file is not found, it
                will then load data saved in the sqlite database. Changes
                made to the zim files are reflected inside MTT, and also
                get saved into sqlite database.''')
        label.setTextFormat(Qt.RichText)
        label.setWordWrap(True)
        va.addWidget(label)

        self.update_from_zim_button=QtWidgets.QPushButton('Save')
        self.update_from_zim_button.clicked.connect(self.doUpdate)
        va.addWidget(self.update_from_zim_button, 0, Qt.AlignRight)

        va.addStretch()
        self.current_task='update'

        return scroll 
Example 24
Project: MeiTingTrunk   Author: Xunius   File: export_dialog.py    GNU General Public License v3.0 5 votes vote down vote up
def getOmitKeys(self):
        '''Collect check states in the omit key checkbox group'''

        omit_keys=[]

        for box in self.omitkey_groupbox.findChildren(QtWidgets.QCheckBox):
            if box.isChecked():
                omit_keys.append(box.text())

        return omit_keys 
Example 25
Project: MeiTingTrunk   Author: Xunius   File: preference_dialog.py    GNU General Public License v3.0 5 votes vote down vote up
def getOmitKeys(self):
        '''Collect check states in the omit key checkbox group'''

        omit_keys=[]

        for box in self.groupbox.findChildren(QtWidgets.QCheckBox):
            if box.isChecked():
                omit_keys.append(box.text())

        return omit_keys 
Example 26
Project: visma   Author: aerospaceresearch   File: settings.py    GNU General Public License v3.0 5 votes vote down vote up
def buttonState(button, workspace):
    """Takes action according to button and its state change trigger

    Arguments:
        button {QtWidgets.QCheckBox} -- preference checkbox
        workspace {QtWidgets.QWidget} -- main layout
    """

    workspace.clearAll()

    if button.text() == "Quick Simplifier":
        if button.isChecked() is True:
            workspace.showQSolver = True
        else:
            workspace.showQSolver = False

    elif button.text() == "Step-by-step Solution":
        if button.isChecked() is True:
            workspace.showStepByStep = True
        else:
            workspace.showStepByStep = False

    elif button.text() == "Graph Plotter":
        if button.isChecked() is True:
            workspace.showPlotter = True
        else:
            workspace.showPlotter = False 
Example 27
Project: plexdesktop   Author: coryo   File: extra_widgets.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, media_object, parent=None):
        super().__init__(parent)
        self.setWindowTitle('Preferences')
        self.form = QtWidgets.QFormLayout(self)
        server = media_object.container.server
        settings = server.container(media_object.key)
        self.ids = []
        for item in settings['_children']:
            itype = item['type']
            if itype == 'bool':
                input_widget = QtWidgets.QCheckBox()
                input_widget.setCheckState(QtCore.Qt.Checked if item['value'] == 'true' else QtCore.Qt.Unchecked)
            elif itype == 'enum':
                input_widget = QtWidgets.QComboBox()
                input_widget.addItems(item['values'].split('|'))
                input_widget.setCurrentIndex(int(item['value']))
            elif itype == 'text':
                input_widget = QtWidgets.QLineEdit(item['value'])
                if item['secure'] == 'true':
                    input_widget.setEchoMode(QtWidgets.QLineEdit.PasswordEchoOnEdit)
            else:
                input_widget = QtWidgets.QLabel('...')
            self.form.addRow(QtWidgets.QLabel(item['label']), input_widget)
            self.ids.append((item['id'], input_widget))

        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:
            media_object.container.server.request(media_object.key + '/set', params=self.extract_values()) 
Example 28
Project: plexdesktop   Author: coryo   File: extra_widgets.py    GNU General Public License v3.0 5 votes vote down vote up
def extract_values(self):
        values = {}
        for pid, widget in self.ids:
            if isinstance(widget, QtWidgets.QLineEdit):
                values[pid] = widget.text()
            elif isinstance(widget, QtWidgets.QComboBox):
                values[pid] = widget.currentIndex()
            elif isinstance(widget, QtWidgets.QCheckBox):
                values[pid] = 'true' if widget.checkState() == QtCore.Qt.Checked else 'false'
        return values 
Example 29
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 30
Project: modtool_gui   Author: swap-nil7   File: gui.py    GNU General Public License v3.0 5 votes vote down vote up
def setup_update(self):
        """ Setup the update tab in the MainWindow """
        self.update = QtWidgets.QWidget()
        self.update.setObjectName("update")
        self.grid_update = QtWidgets.QGridLayout(self.update)
        self.grid_update.setObjectName("grid_update")
        self.update_candidates = QtWidgets.QGroupBox(self.update)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.update_candidates.setFont(font)
        self.update_candidates.setObjectName("update_candidates")
        self.grid_update.addWidget(self.update_candidates, 0, 1, 1, 1)
        self.update_options = QtWidgets.QGroupBox(self.update)
        font = QtGui.QFont()
        font.setFamily("Carlito")
        font.setPointSize(12)
        font.setBold(False)
        font.setWeight(50)
        self.update_options.setFont(font)
        self.update_options.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.update_options.setObjectName("update_options")
        self.grid_update_options = QtWidgets.QGridLayout(self.update_options)
        self.grid_update_options.setObjectName("grid_update_options")
        self.label_update_blockname = QtWidgets.QLabel(self.update_options)
        self.label_update_blockname.setObjectName("label_update_blockname")
        self.grid_update_options.addWidget(self.label_update_blockname, 0, 0, 1, 1)
        self.update_run = QtWidgets.QPushButton(self.update_options)
        self.update_run.setToolTip("")
        self.update_run.setDefault(False)
        self.update_run.setFlat(False)
        self.update_run.setObjectName("update_run")
        self.grid_update_options.addWidget(self.update_run, 3, 0, 1, 1)
        self.update_blockname = QtWidgets.QLineEdit(self.update_options)
        self.update_blockname.setObjectName("update_blockname")
        self.grid_update_options.addWidget(self.update_blockname, 0, 2, 1, 1)
        self.update_all = QtWidgets.QCheckBox(self.update_options)
        self.update_all.setObjectName("update_all")
        self.grid_update_options.addWidget(self.update_all, 1, 0, 1, 1)
        self.grid_update.addWidget(self.update_options, 0, 0, 1, 1)
        self.commands.addTab(self.update, "") 
Example 31
Project: SeamEater   Author: Entscheider   File: StdEffects.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        StdEffect.__init__(self, "Gray")
        lay = self.lay
        self.chR = gui.QCheckBox("Red")
        lay.addWidget(self.chR)
        self.chB = gui.QCheckBox("Blue")
        lay.addWidget(self.chB)
        self.chG = gui.QCheckBox("Green")
        lay.addWidget(self.chG)
        self._addDiscription("Convert the picture into a grayscale one.")
        self._addStretch() 
Example 32
Project: persepolis   Author: persepolisdm   File: mainwindow.py    GNU General Public License v3.0 5 votes vote down vote up
def deleteSelected(self, menu=None):
        # showing Warning message to the user.
        # checking persepolis_setting first!
        # perhaps user was checking "do not show this message again"
        delete_warning_message = self.persepolis_setting.value(
            'MainWindow/delete-warning', 'yes')

        if delete_warning_message == 'yes':
            self.msgBox = QMessageBox()
            self.msgBox.setText(QCoreApplication.translate("mainwindow_src_ui_tr", "<b><center>This operation will delete \
                    downloaded files from your hard disk<br>PERMANENTLY!</center></b>"))
            self.msgBox.setInformativeText(QCoreApplication.translate(
                "mainwindow_src_ui_tr", "<center>Do you want to continue?</center>"))
            self.msgBox.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
            self.msgBox.setIcon(QMessageBox.Warning)
            dont_show_checkBox = QCheckBox("don't show this message again")
            self.msgBox.setCheckBox(dont_show_checkBox)
            reply = self.msgBox.exec_()

            # if user checks "do not show this message again!", change persepolis_setting!
            if self.msgBox.checkBox().isChecked():
                self.persepolis_setting.setValue(
                    'MainWindow/delete-warning', 'no')

            # do nothing if user clicks NO
            if reply != QMessageBox.Yes:
                return

        # if checking_flag is equal to 1, it means that user pressed remove or
        # delete button or ... . so checking download information must be
        # stopped until job is done!
        if checking_flag != 2:
            wait_check = WaitThread()
            self.threadPool.append(wait_check)
            self.threadPool[len(self.threadPool) - 1].start()
            self.threadPool[len(self.threadPool) -
                            1].QTABLEREADY.connect(self.deleteSelected2)
        else:
            self.deleteSelected2() 
Example 33
Project: FIRST-plugin-ida   Author: vrtadmin   File: first.py    GNU General Public License v2.0 5 votes vote down vote up
def init_middle_layout(self):
            #self.check_on_startup = QtWidgets.QCheckBox("Check FIRST on IDA startup")
            #self.middle_layout.addWidget(self.check_on_startup)
            self.middle_layout.addStretch() 
Example 34
Project: ocelot   Author: ocelot-collab   File: ui_ocl_table.py    GNU General Public License v3.0 5 votes vote down vote up
def setupUi(self, Widget):
        Widget.setObjectName("Widget")
        Widget.resize(400, 300)
        self.gridLayout_2 = QtWidgets.QGridLayout(Widget)
        self.gridLayout_2.setContentsMargins(11, 11, 11, 11)
        self.gridLayout_2.setSpacing(6)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.cb_realtime = QtWidgets.QCheckBox(Widget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.cb_realtime.setFont(font)
        self.cb_realtime.setObjectName("cb_realtime")
        self.gridLayout_2.addWidget(self.cb_realtime, 1, 0, 1, 1)
        self.pb_reset = QtWidgets.QPushButton(Widget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.pb_reset.setFont(font)
        self.pb_reset.setStyleSheet("color: rgb(255, 128, 0); font-size: 10pt;")
        self.pb_reset.setObjectName("pb_reset")
        self.gridLayout_2.addWidget(self.pb_reset, 1, 1, 1, 1)
        self.pb_calculate = QtWidgets.QPushButton(Widget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.pb_calculate.setFont(font)
        self.pb_calculate.setStyleSheet("color: rgb(255, 128, 0); font-size: 10pt;")
        self.pb_calculate.setObjectName("pb_calculate")
        self.gridLayout_2.addWidget(self.pb_calculate, 1, 2, 1, 1)
        self.tableWidget = QtWidgets.QTableWidget(Widget)
        self.tableWidget.setObjectName("tableWidget")
        self.tableWidget.setColumnCount(0)
        self.tableWidget.setRowCount(0)
        self.gridLayout_2.addWidget(self.tableWidget, 0, 0, 1, 3)

        self.retranslateUi(Widget)
        QtCore.QMetaObject.connectSlotsByName(Widget) 
Example 35
Project: Cardistry   Author: lovac42   File: cardistry.py    GNU General Public License v3.0 5 votes vote down vote up
def dconfsetupUi(self, Dialog):
    r=self.gridLayout.rowCount()

    label=QtWidgets.QLabel(self.tab)
    label.setText(_("Lrn/Yng Cards:"))
    self.gridLayout.addWidget(label,r,0,1,1)

    self.young_card_limit=QtWidgets.QSpinBox(self.tab)
    self.young_card_limit.setMinimum(0)
    self.young_card_limit.setMaximum(9999)
    self.young_card_limit.setSingleStep(5)
    self.gridLayout.addWidget(self.young_card_limit,r,1,1,1)

    self.newPerDay.valueChanged.connect(lambda:valuechange(self))
    self.young_card_limit.valueChanged.connect(lambda:valuechange(self))
    self.young_card_msg=QtWidgets.QLabel(self.tab)
    self.gridLayout.addWidget(self.young_card_msg,r,2,1,1)

    r+=1
    label=QtWidgets.QLabel(self.tab)
    label.setText(_("Mature IVL:"))
    self.gridLayout.addWidget(label,r,0,1,1)

    self.cardistry_ivl=QtWidgets.QSpinBox(self.tab)
    self.cardistry_ivl.setMinimum(1)
    self.cardistry_ivl.setMaximum(999)
    self.cardistry_ivl.setSingleStep(1)
    self.cardistry_ivl.valueChanged.connect(lambda:valuechange(self))
    self.gridLayout.addWidget(self.cardistry_ivl,r,1,1,1)

    self.cardistry_filter=QtWidgets.QCheckBox(self.tab)
    self.cardistry_filter.setText(_('count cards in filter decks?'))
    self.cardistry_filter.clicked.connect(lambda:valuechange(self))
    self.gridLayout.addWidget(self.cardistry_filter,r,2,1,3) 
Example 36
Project: beqdesigner   Author: 3ll3d00d   File: edit_mapping.py    MIT License 5 votes vote down vote up
def setupUi(self, editMappingDialog):
        editMappingDialog.setObjectName("editMappingDialog")
        editMappingDialog.resize(415, 160)
        self.formLayout = QtWidgets.QFormLayout(editMappingDialog)
        self.formLayout.setObjectName("formLayout")
        self.channelIdxLabel = QtWidgets.QLabel(editMappingDialog)
        self.channelIdxLabel.setObjectName("channelIdxLabel")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.channelIdxLabel)
        self.signalLabel = QtWidgets.QLabel(editMappingDialog)
        self.signalLabel.setObjectName("signalLabel")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.signalLabel)
        self.channelIdx = QtWidgets.QLineEdit(editMappingDialog)
        self.channelIdx.setReadOnly(True)
        self.channelIdx.setObjectName("channelIdx")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.channelIdx)
        self.signal = QtWidgets.QComboBox(editMappingDialog)
        self.signal.setObjectName("signal")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.signal)
        self.applyToAll = QtWidgets.QCheckBox(editMappingDialog)
        self.applyToAll.setObjectName("applyToAll")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.applyToAll)
        self.buttonBox = QtWidgets.QDialogButtonBox(editMappingDialog)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Save)
        self.buttonBox.setObjectName("buttonBox")
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.buttonBox)

        self.retranslateUi(editMappingDialog)
        self.buttonBox.accepted.connect(editMappingDialog.accept)
        self.buttonBox.rejected.connect(editMappingDialog.reject)
        # QtCore.QMetaObject.connectSlotsByName(editMappingDialog) 
Example 37
Project: ovs-toolbox   Author: nbonnand   File: ovs-toolbox.py    Apache License 2.0 5 votes vote down vote up
def widget_read(widget):
    if(debug):mydebug(inspect.currentframe())

    if(widget.isEnabled()):
        if(isinstance(widget, QtWidgets.QLineEdit)):
            widget_val=widget.text()
            if(widget_val):
                return(True,widget_val)

        elif(isinstance(widget, QtWidgets.QCheckBox)):
            if(widget.isChecked()):
                return(True,'true')
            else:
                return(True,'false')

        elif(isinstance(widget, QtWidgets.QComboBox)):
            widget_val=widget.currentText()
            if(widget_val):
                return(True,widget_val)

        elif(isinstance(widget, QtWidgets.QRadioButton)):
            if(widget.isChecked()):
                return(True,'true')
            else:
                return(True,'false')

            
    return (False,'')
    

#--------------------------------------------------------------- 
Example 38
Project: openspectra   Author: openspectra   File: windowmanager.py    Apache License 2.0 5 votes vote down vote up
def __save_prompt(self, region:RegionOfInterest) -> Tuple[int, bool]:
        dialog = QMessageBox(self.__region_window)
        dialog.setIcon(QMessageBox.Question)
        dialog.setText("Save region '{0}'?".format(region.display_name()))
        check_box = QCheckBox("Include bands?", dialog)
        check_box.setCheckState(self.__include_bands_default)
        dialog.setCheckBox(check_box)
        dialog.addButton(QMessageBox.Cancel)
        dialog.addButton(QMessageBox.Save)
        result = dialog.exec()
        include_bands = dialog.checkBox().checkState() == Qt.Checked
        RegionOfInterestManager.__LOG.debug("Save dialog result: {0}, is checked: {1}", result, include_bands)
        return result, include_bands 
Example 39
Project: core_messenger   Author: arterialist   File: message_delete_box.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, enable_checkbox: bool = False, nickname: str = None):
        super(DeleteMsgMessageBox, self).__init__("Delete for {}?".format(nickname if nickname else "opponent"))
        self.checkbox = QCheckBox()
        self.init_ui(enable_checkbox, "Delete for {}?".format(nickname if nickname else "opponent")) 
Example 40
Project: core_messenger   Author: arterialist   File: basic.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, checkbox_text, parent=None, enable_checkbox=False):
        super(CheckboxMessageBox, self).__init__()
        self.checkbox = QCheckBox(parent=parent)
        self.init_ui(enable_checkbox, checkbox_text) 
Example 41
Project: DevilYuan   Author: moyuanz   File: DyStockTableFilterDlg.py    MIT License 5 votes vote down vote up
def _initUi(self, colNames):
        self.setWindowTitle('过滤')
 
        # 控件
        table = DyTableWidget(parent=None, readOnly=True, index=False, floatCut=True, autoScroll=False)
        table.setColNames(['列名', '表达式'])
        rows = [[name, 'x[{0}]'.format(i)] for i, name in enumerate(colNames)]
        table.fastAppendRows(rows)

        descriptionLabel = QLabel('行过滤表达式(Python语法)')
        self._filterTextEdit = QTextEdit()
        self._newWindowCheckBox = QCheckBox('新窗口')
        self._newWindowCheckBox.setChecked(True)
        self._highlightCheckBox = QCheckBox('原窗口高亮')
        self._highlightCheckBox.setChecked(False)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(table, 0, 0, 22, 1)
        grid.addWidget(self._newWindowCheckBox, 0, 1)
        grid.addWidget(self._highlightCheckBox, 0, 2)

        grid.addWidget(descriptionLabel, 1, 1)

        grid.addWidget(self._filterTextEdit, 2, 1, 20, 20)
 
        grid.addWidget(okPushButton, 0, 21)
        grid.addWidget(cancelPushButton, 1, 21)
 
 
        self.setLayout(grid)
        self.resize(QApplication.desktop().size().width()//2, QApplication.desktop().size().height()//4*3) 
Example 42
Project: DevilYuan   Author: moyuanz   File: DyStockIndustryCompareDlg.py    MIT License 5 votes vote down vote up
def _initUi(self, name, baseDate):
        self.setWindowTitle('行业对比[{0}]-基准日期[{1}]'.format(name, baseDate))
 
        # 控件
        forwardNTDaysLabel = QLabel('向前N日涨幅(%)')
        self._forwardNTDaysLineEdit = QLineEdit('30')

        self._industry2CheckBox = QCheckBox('行业二级分级')
        #self._industry2CheckBox.setChecked(True)

        self._industry3CheckBox = QCheckBox('行业三级分级')
        self._industry3CheckBox.setChecked(True)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(forwardNTDaysLabel, 0, 0)
        grid.addWidget(self._forwardNTDaysLineEdit, 0, 1)

        grid.addWidget(self._industry2CheckBox, 1, 0)
        grid.addWidget(self._industry3CheckBox, 1, 1)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
        self.setLayout(grid)

        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
Example 43
Project: DevilYuan   Author: moyuanz   File: DyStockSelectIndustryCompareDlg.py    MIT License 5 votes vote down vote up
def _initUi(self, name, baseDate):
        self.setWindowTitle('行业对比[{0}]-基准日期[{1}]'.format(name, baseDate))
 
        # 控件
        forwardNTDaysLabel = QLabel('向前N日涨幅(%)')
        self._forwardNTDaysLineEdit = QLineEdit('30')

        self._industry2CheckBox = QCheckBox('行业二级分级')
        #self._industry2CheckBox.setChecked(True)

        self._industry3CheckBox = QCheckBox('行业三级分级')
        self._industry3CheckBox.setChecked(True)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(forwardNTDaysLabel, 0, 0)
        grid.addWidget(self._forwardNTDaysLineEdit, 0, 1)

        grid.addWidget(self._industry2CheckBox, 1, 0)
        grid.addWidget(self._industry3CheckBox, 1, 1)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
        self.setLayout(grid)

        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
Example 44
Project: DevilYuan   Author: moyuanz   File: DyStockSelectRefactoryParamsDlg.py    MIT License 5 votes vote down vote up
def _initUi(self, header, params):
        self.setWindowTitle('重构参数')
 
        # 控件
        self._table = DyTableWidget(parent=None, readOnly=False, index=False, floatCut=True, autoScroll=False)
        self._table.setColNames(header)
        self._table.fastAppendRows(params)

        self._newWindowCheckBox = QCheckBox('新窗口')
        self._newWindowCheckBox.setChecked(True)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(self._newWindowCheckBox, 0, 0)
        grid.addWidget(self._table, 1, 0, 1, 2)
 
        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
 
        self.setLayout(grid)
        self.resize(QApplication.desktop().size().width()//3, QApplication.desktop().size().height()//4*3) 
Example 45
Project: DevilYuan   Author: moyuanz   File: DyStockDataHistTicksVerifyDlg.py    MIT License 5 votes vote down vote up
def _initUi(self):
        self.setWindowTitle('历史分笔数据校验')
 
        # 控件
        startDateLable = QLabel('开始日期')
        self._startDateLineEdit = QLineEdit(datetime.now().strftime("%Y-%m-%d"))

        endDateLable = QLabel('结束日期')
        self._endDateLineEdit = QLineEdit(datetime.now().strftime("%Y-%m-%d"))

        self._addCheckBox = QCheckBox('校验缺失历史分笔数据')
        self._addCheckBox.setChecked(True)
        self._deleteCheckBox = QCheckBox('校验无效历史分笔数据')
        #self._deleteCheckBox.setChecked(True)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(startDateLable, 0, 0)
        grid.addWidget(self._startDateLineEdit, 1, 0)

        grid.addWidget(endDateLable, 0, 1)
        grid.addWidget(self._endDateLineEdit, 1, 1)

        grid.addWidget(self._addCheckBox, 2, 0)
        grid.addWidget(self._deleteCheckBox, 2, 1)

        grid.addWidget(okPushButton, 3, 1)
        grid.addWidget(cancelPushButton, 3, 0)
 
        self.setLayout(grid) 
Example 46
Project: kaptan   Author: KaOSx   File: ui_welcome.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.setSubTitle(self.tr("<h2>Welcome to KaOS</h2>"))

        vlayout = QVBoxLayout(self)
        vlayout.addItem(QSpacerItem(20, 30, QSizePolicy.Preferred, QSizePolicy.Minimum))

        hlayout = QHBoxLayout(self)
        label = QLabel(self)
        label.setText(self.tr("""<h1>What is KaOS?</h1>
        <p>The idea behind KaOS is to create a tightly integrated rolling and<br />
        transparent distribution for the modern desktop, build from scratch with<br />
        a very specific focus. Focus on one DE (KDE), one toolkit (Qt) & one architecture (x86_64).<br />
        Plus a focus on evaluating and selecting the most suitable tools and applications.</p>
        <p>This wizard will help you personalize your KaOS workspace easily and quickly.</p>
        <p>Please click <code style=color:#3498DB>Next</code> in order to begin. Click <code style=color:#3498DB>Cancel</code> anytime and changes won't be saved.</p>"""))
        label.setWordWrap(True)
        label.setAlignment(Qt.AlignLeft)
        hlayout.addWidget(label)

        kaptan_logo = QLabel(self)
        kaptan_logo.setPixmap(QPixmap(":/data/images/welcome.png"))
        kaptan_logo.setAlignment(Qt.AlignRight)
        kaptan_logo.setMaximumSize(157, 181)
        hlayout.addWidget(kaptan_logo)
        vlayout.addLayout(hlayout)

        vlayout.addItem(QSpacerItem(20, 40, QSizePolicy.Preferred, QSizePolicy.Preferred))
        
        desktop_file = os.path.join(os.environ["HOME"], ".config", "autostart", "kaptan.desktop")
        if os.path.exists(desktop_file):
            self.checkBox = QCheckBox()
            self.checkBox.setText(self.tr("Run on system startup"))
            self.checkBox.setChecked(True)
            self.checkBox.clicked.connect(self.autoRemove)
            vlayout.addWidget(self.checkBox) 
Example 47
Project: gaitutils   Author: jjnurminen   File: qt_dialogs.py    GNU General Public License v3.0 5 votes vote down vote up
def _update_inputs(self):
        """Update input widgets according to current cfg"""
        for secname, sec in cfg:
            for itemname, item in sec:
                _widget = self._input_widgets[secname][itemname]
                val = item.literal_value
                if isinstance(_widget, QtWidgets.QLineEdit):
                    _widget.setText(val)
                    _widget.setCursorPosition(0)
                elif isinstance(_widget, QtWidgets.QCheckBox):
                    _widget.setChecked(item.value) 
Example 48
Project: BaiduNetDiskAutoTransfer   Author: VinylChloride   File: mainPrgGui.py    GNU General Public License v3.0 5 votes vote down vote up
def __createCheckBox(self):
		self.__runModeCheckBox = QCheckBox(self.__lang.get("runModeCheckBox"),self)

		self.__widgetList.append(self.__runModeCheckBox) 
Example 49
Project: PLEASE   Author: mgrady3   File: yamloutput.py    GNU General Public License v3.0 5 votes vote down vote up
def enableDisableSettingsInput(self, state):
        """Toggle ability to input a value in the Time Step QLineEdit based on QCheckBox state.
           Toggle ability to input energy settings based on QCheckBox state.
           Energy settings are not required if data is interpreted as a time series.
        """
        if state == 0:
            # not time series data
            self.timeStepText.setEnabled(False)
            for w in [self.minEText, self.maxEText, self.stepEText]:
                w.setEnabled(True)
        else:
            # time series data
            self.timeStepText.setEnabled(True)
            for w in [self.minEText, self.maxEText, self.stepEText]:
                w.setEnabled(False) 
Example 50
Project: 3d-nii-visualizer   Author: adamkwolf   File: MainWindow.py    MIT License 5 votes vote down vote up
def add_brain_slicer(self):
        slicer_cb = QtWidgets.QCheckBox("Slicer")
        slicer_cb.clicked.connect(self.brain_slicer_vc)
        return slicer_cb