Python PyQt5.QtWidgets.QCheckBox() Examples
The following are 30
code examples of PyQt5.QtWidgets.QCheckBox().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
PyQt5.QtWidgets
, or try the search function
.
Example #1
Source File: DyStockDataHistDaysManualUpdateDlg.py From DevilYuan with MIT License | 7 votes |
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 #2
Source File: angrysearch.py From ANGRYsearch with GNU General Public License v2.0 | 7 votes |
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 #3
Source File: preferences.py From imperialism-remake with GNU General Public License v3.0 | 6 votes |
def _layout_widget_preferences_graphics(self): """ Create graphical options widget. """ tab = QtWidgets.QWidget() tab_layout = QtWidgets.QVBoxLayout(tab) # full screen mode checkbox = QtWidgets.QCheckBox('Full screen mode') self._register_check_box(checkbox, constants.Option.MAINWINDOW_FULLSCREEN) tab_layout.addWidget(checkbox) # vertical stretch tab_layout.addStretch() # add tab self.tab_graphics = tab self.stacked_layout.addWidget(tab)
Example #4
Source File: plot.py From pychemqt with GNU General Public License v3.0 | 6 votes |
def __init__(self, name, parent=None): title = name+" "+QtWidgets.QApplication.translate("pychemqt", "Axis") super(AxisWidget, self).__init__(title, parent) lyt = QtWidgets.QGridLayout(self) lyt.addWidget(QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Label")), 1, 1) self.label = InputFont() lyt.addWidget(self.label, 1, 2) self.scale = QtWidgets.QCheckBox( QtWidgets.QApplication.translate("pychemqt", "Logarithmic scale")) lyt.addWidget(self.scale, 2, 1, 1, 2) lyt.addWidget(QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "from")), 3, 1) self.min = Entrada_con_unidades(float, min=float("-inf")) lyt.addWidget(self.min, 3, 2) lyt.addWidget(QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "to")), 4, 1) self.max = Entrada_con_unidades(float, min=float("-inf")) lyt.addWidget(self.max, 4, 2)
Example #5
Source File: misc_tab.py From vorta with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent=None): super().__init__(parent) self.setupUi(parent) self.versionLabel.setText(__version__) self.logLink.setText(f'<a href="file://{LOG_DIR}"><span style="text-decoration:' 'underline; color:#0984e3;">Log</span></a>') for setting in SettingsModel.select().where(SettingsModel.type == 'checkbox'): x = filter(lambda s: s['key'] == setting.key, get_misc_settings()) if not list(x): # Skip settings that aren't specified in vorta.models. continue b = QCheckBox(translate('settings', setting.label)) b.setCheckState(setting.value) b.setTristate(False) b.stateChanged.connect(lambda v, key=setting.key: self.save_setting(key, v)) self.checkboxLayout.addWidget(b)
Example #6
Source File: command_cue.py From linux-show-player with GNU General Public License v3.0 | 6 votes |
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.setLayout(QVBoxLayout()) self.layout().setAlignment(Qt.AlignTop) self.group = QGroupBox(self) self.group.setLayout(QVBoxLayout(self.group)) self.layout().addWidget(self.group) self.commandLineEdit = QLineEdit(self.group) self.group.layout().addWidget(self.commandLineEdit) self.noOutputCheckBox = QCheckBox(self) self.layout().addWidget(self.noOutputCheckBox) self.noErrorCheckBox = QCheckBox(self) self.layout().addWidget(self.noErrorCheckBox) self.killCheckBox = QCheckBox(self) self.layout().addWidget(self.killCheckBox) self.retranslateUi()
Example #7
Source File: first.py From FIRST-plugin-ida with GNU General Public License v2.0 | 6 votes |
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 #8
Source File: first.py From FIRST-plugin-ida with GNU General Public License v2.0 | 6 votes |
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
Source File: dialogs.py From Miyamoto with GNU General Public License v3.0 | 6 votes |
def createType(self, z): self.Settings = QtWidgets.QGroupBox(globals.trans.string('ZonesDlg', 76)) self.Zone_settings = [] ZoneSettingsLeft = QtWidgets.QFormLayout() ZoneSettingsRight = QtWidgets.QFormLayout() settingsNames = globals.trans.stringList('ZonesDlg', 77) for i in range(0, 8): self.Zone_settings.append(QtWidgets.QCheckBox()) self.Zone_settings[i].setChecked(z.type & (2 ** i)) if i < 4: ZoneSettingsLeft.addRow(settingsNames[i], self.Zone_settings[i]) else: ZoneSettingsRight.addRow(settingsNames[i], self.Zone_settings[i]) ZoneSettingsLayout = QtWidgets.QHBoxLayout() ZoneSettingsLayout.addLayout(ZoneSettingsLeft) ZoneSettingsLayout.addStretch() ZoneSettingsLayout.addLayout(ZoneSettingsRight) self.Settings.setLayout(ZoneSettingsLayout)
Example #10
Source File: annotations.py From Lector with GNU General Public License v3.0 | 6 votes |
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 #11
Source File: VSWRAnalysis.py From nanovna-saver with GNU General Public License v3.0 | 6 votes |
def __init__(self, app): super().__init__(app) self._widget = QtWidgets.QWidget() self.layout = QtWidgets.QFormLayout() self._widget.setLayout(self.layout) self.input_vswr_limit = QtWidgets.QDoubleSpinBox() self.input_vswr_limit.setValue(self.vswr_limit_value) self.input_vswr_limit.setSingleStep(0.1) self.input_vswr_limit.setMinimum(1) self.input_vswr_limit.setMaximum(25) self.input_vswr_limit.setDecimals(2) self.checkbox_move_marker = QtWidgets.QCheckBox() self.layout.addRow(QtWidgets.QLabel("<b>Settings</b>")) self.layout.addRow("VSWR limit", self.input_vswr_limit) self.layout.addRow(VSWRAnalysis.QHLine()) self.results_label = QtWidgets.QLabel("<b>Results</b>") self.layout.addRow(self.results_label)
Example #12
Source File: directions_gui.py From orstools-qgis-plugin with MIT License | 6 votes |
def _get_avoid_options(self, avoid_boxes): """ Extracts checked boxes in Advanced avoid parameters. :param avoid_boxes: all checkboxes in advanced paramter dialog. :type avoid_boxes: list of QCheckBox :returns: avoid_features parameter :rtype: JSON dump, i.e. str """ avoid_features = [] for box in avoid_boxes: if box.isChecked(): avoid_features.append((box.text())) return avoid_features
Example #13
Source File: settings_widget.py From kawaii-player with GNU General Public License v3.0 | 6 votes |
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 #14
Source File: Demo4.py From python with Apache License 2.0 | 5 votes |
def _addcheckbox(self, alpha, i): checkbox = QtWidgets.QCheckBox(self.centralwidget) checkbox.setObjectName(alpha) checkbox.setText(alpha) self.tableWidget.setCellWidget(i,0, checkbox) return checkbox
Example #15
Source File: Demo5.py From python with Apache License 2.0 | 5 votes |
def _addCheckbox(self, index, idd, boxtitle): '''生成相应的位置''' checkBox = QCheckBox() checkBox.setObjectName(idd) checkBox.setText(boxtitle) self.tableWidget.setCellWidget(index, 0, checkBox) ##setCellWidget前面两个数字分别代表行和列,最后是需要关联的元素 return checkBox
Example #16
Source File: AddRedditObjectDialog_auto.py From DownloaderForReddit with GNU General Public License v3.0 | 5 votes |
def setupUi(self, add_reddit_object_dialog): add_reddit_object_dialog.setObjectName("add_reddit_object_dialog") add_reddit_object_dialog.resize(425, 135) font = QtGui.QFont() font.setPointSize(10) add_reddit_object_dialog.setFont(font) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap("../Resources/Images/add.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) add_reddit_object_dialog.setWindowIcon(icon) self.vert_layout = QtWidgets.QVBoxLayout(add_reddit_object_dialog) self.vert_layout.setObjectName("vert_layout") self.label = QtWidgets.QLabel(add_reddit_object_dialog) self.label.setObjectName("label") self.vert_layout.addWidget(self.label) self.object_name_line_edit = QtWidgets.QLineEdit(add_reddit_object_dialog) self.object_name_line_edit.setObjectName("object_name_line_edit") self.vert_layout.addWidget(self.object_name_line_edit) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.download_on_add_checkbox = QtWidgets.QCheckBox(add_reddit_object_dialog) font = QtGui.QFont() font.setPointSize(9) self.download_on_add_checkbox.setFont(font) self.download_on_add_checkbox.setObjectName("download_on_add_checkbox") self.horizontalLayout.addWidget(self.download_on_add_checkbox) self.ok_cancel_button_box = QtWidgets.QDialogButtonBox(add_reddit_object_dialog) self.ok_cancel_button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) self.ok_cancel_button_box.setObjectName("ok_cancel_button_box") self.horizontalLayout.addWidget(self.ok_cancel_button_box) self.vert_layout.addLayout(self.horizontalLayout) self.retranslateUi(add_reddit_object_dialog) QtCore.QMetaObject.connectSlotsByName(add_reddit_object_dialog)
Example #17
Source File: select.py From python with Apache License 2.0 | 5 votes |
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1279, 677) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.tableWidget = QtWidgets.QTableWidget(self.centralwidget) self.tableWidget.setGeometry(QtCore.QRect(150, 80, 441, 331)) self.tableWidget.setObjectName("tableWidget") self.tableWidget.setColumnCount(0) self.tableWidget.setRowCount(0) self.pushButton = QtWidgets.QPushButton(self.centralwidget) # 生成相对应的对象 self.pushButton.setGeometry(QtCore.QRect(310, 510, 171, 61))# 确定该对象的位置以及大小 self.pushButton.setObjectName("pushButton") # 设置名字,加载对象 self.checkBox = QtWidgets.QCheckBox(self.centralwidget) self.checkBox.setGeometry(QtCore.QRect(870, 530, 91, 19)) self.checkBox.setObjectName("checkBox") self.textBrowser = QtWidgets.QTextBrowser(self.centralwidget) self.textBrowser.setGeometry(QtCore.QRect(750, 90, 421, 321)) self.textBrowser.setObjectName("textBrowser") MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1279, 23)) self.menubar.setObjectName("menubar") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
Example #18
Source File: UpdateDialog_auto.py From DownloaderForReddit with GNU General Public License v3.0 | 5 votes |
def setupUi(self, update_dialog_box): update_dialog_box.setObjectName("update_dialog_box") update_dialog_box.resize(794, 207) font = QtGui.QFont() font.setPointSize(10) update_dialog_box.setFont(font) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap("Resources/Images/update.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) update_dialog_box.setWindowIcon(icon) self.gridLayout_2 = QtWidgets.QGridLayout(update_dialog_box) self.gridLayout_2.setObjectName("gridLayout_2") self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.label = QtWidgets.QLabel(update_dialog_box) self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.do_not_notify_checkbox = QtWidgets.QCheckBox(update_dialog_box) self.do_not_notify_checkbox.setObjectName("do_not_notify_checkbox") self.gridLayout.addWidget(self.do_not_notify_checkbox, 3, 0, 1, 1) self.buttonBox = QtWidgets.QDialogButtonBox(update_dialog_box) font = QtGui.QFont() font.setPointSize(10) self.buttonBox.setFont(font) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 1) self.link_label = QtWidgets.QLabel(update_dialog_box) self.link_label.setObjectName("link_label") self.gridLayout.addWidget(self.link_label, 1, 0, 1, 1) self.direct_link_label = QtWidgets.QLabel(update_dialog_box) self.direct_link_label.setObjectName("direct_link_label") self.gridLayout.addWidget(self.direct_link_label, 2, 0, 1, 1) self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1) self.retranslateUi(update_dialog_box) self.buttonBox.accepted.connect(update_dialog_box.accept) self.buttonBox.rejected.connect(update_dialog_box.reject) QtCore.QMetaObject.connectSlotsByName(update_dialog_box)
Example #19
Source File: moody.py From pychemqt with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent=None): super(CalculateDialog, self).__init__(parent) title = QtWidgets.QApplication.translate( "pychemqt", "Calculate friction factor") self.setWindowTitle(title) layout = QtWidgets.QGridLayout(self) label = QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Method:")) layout.addWidget(label, 1, 0) self.metodos = QtWidgets.QComboBox() for f in f_list: line = f.__doc__.split("\n")[0] year = line.split(" ")[-1] name = line.split(" ")[-3] doc = name + " " + year self.metodos.addItem(doc) self.metodos.currentIndexChanged.connect(self.calculate) layout.addWidget(self.metodos, 1, 1, 1, 2) self.fanning = QtWidgets.QCheckBox(QtWidgets.QApplication.translate( "pychemqt", "Calculate fanning friction factor")) self.fanning.toggled.connect(self.calculate) layout.addWidget(self.fanning, 2, 0, 1, 3) layout.addWidget(QtWidgets.QLabel("Re"), 3, 1) self.Re = Entrada_con_unidades(float, tolerancia=4) self.Re.valueChanged.connect(self.calculate) layout.addWidget(self.Re, 3, 2) layout.addWidget(QtWidgets.QLabel("e/D"), 4, 1) self.eD = Entrada_con_unidades(float) self.eD.valueChanged.connect(self.calculate) layout.addWidget(self.eD, 4, 2) layout.addWidget(QtWidgets.QLabel("f"), 5, 1) self.f = Entrada_con_unidades(float, readOnly=True, decimales=8) layout.addWidget(self.f, 5, 2) self.buttonBox = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Close) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) layout.addWidget(self.buttonBox, 10, 1, 1, 2)
Example #20
Source File: QCheckBox.py From python with Apache License 2.0 | 5 votes |
def initUI(self): cb = QCheckBox('Show title', self) cb.move(20, 20) cb.toggle() cb.stateChanged.connect(self.changeTitle) self.setGeometry(300, 300, 250, 150) self.setWindowTitle('QCheckBox') self.show()
Example #21
Source File: plot.py From pychemqt with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent=None): super(Plot2D, self).__init__(parent) self.setWindowTitle( QtWidgets.QApplication.translate("pychemqt", "Setup 2D Plot")) layout = QtWidgets.QVBoxLayout(self) group_Ejex = QtWidgets.QGroupBox( QtWidgets.QApplication.translate("pychemqt", "Axis X")) layout.addWidget(group_Ejex) layout_GroupX = QtWidgets.QVBoxLayout(group_Ejex) self.ejeX = QtWidgets.QComboBox() layout_GroupX.addWidget(self.ejeX) self.Xscale = QtWidgets.QCheckBox( QtWidgets.QApplication.translate("pychemqt", "Logarithmic scale")) layout_GroupX.addWidget(self.Xscale) for prop in ThermoAdvanced.propertiesName(): self.ejeX.addItem(prop) group_Ejey = QtWidgets.QGroupBox( QtWidgets.QApplication.translate("pychemqt", "Axis Y")) layout.addWidget(group_Ejey) layout_GroupY = QtWidgets.QVBoxLayout(group_Ejey) self.ejeY = QtWidgets.QComboBox() layout_GroupY.addWidget(self.ejeY) self.Yscale = QtWidgets.QCheckBox( QtWidgets.QApplication.translate("pychemqt", "Logarithmic scale")) layout_GroupY.addWidget(self.Yscale) self.buttonBox = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) layout.addWidget(self.buttonBox) self.ejeXChanged(0) self.ejeX.currentIndexChanged.connect(self.ejeXChanged)
Example #22
Source File: FailedDownloadsDialog_auto.py From DownloaderForReddit with GNU General Public License v3.0 | 5 votes |
def setupUi(self, failed_downloads_dialog): failed_downloads_dialog.setObjectName("failed_downloads_dialog") failed_downloads_dialog.resize(998, 512) font = QtGui.QFont() font.setPointSize(10) failed_downloads_dialog.setFont(font) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap("Resources/Images/failed_download.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) failed_downloads_dialog.setWindowIcon(icon) self.gridLayout = QtWidgets.QGridLayout(failed_downloads_dialog) self.gridLayout.setObjectName("gridLayout") self.auto_display_checkbox = QtWidgets.QCheckBox(failed_downloads_dialog) self.auto_display_checkbox.setObjectName("auto_display_checkbox") self.gridLayout.addWidget(self.auto_display_checkbox, 1, 0, 1, 1) self.buttonBox = QtWidgets.QDialogButtonBox(failed_downloads_dialog) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.gridLayout.addWidget(self.buttonBox, 1, 1, 1, 1) self.splitter = QtWidgets.QSplitter(failed_downloads_dialog) self.splitter.setOrientation(QtCore.Qt.Vertical) self.splitter.setObjectName("splitter") self.table_view = QtWidgets.QTableView(self.splitter) self.table_view.setObjectName("table_view") self.detail_table = QtWidgets.QTableView(self.splitter) self.detail_table.setObjectName("detail_table") self.gridLayout.addWidget(self.splitter, 0, 0, 1, 2) self.retranslateUi(failed_downloads_dialog) QtCore.QMetaObject.connectSlotsByName(failed_downloads_dialog)
Example #23
Source File: prefMoody.py From pychemqt with GNU General Public License v3.0 | 5 votes |
def __init__(self, config=None, parent=None): super(Widget, self).__init__(parent) layout = QtWidgets.QGridLayout(self) layout.addWidget(QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Method:")), 1, 1) self.metodos = QtWidgets.QComboBox() for f in f_list: line = f.__doc__.split("\n")[0] year = line.split(" ")[-1] name = line.split(" ")[-3] doc = name + " " + year self.metodos.addItem(doc) layout.addWidget(self.metodos, 1, 2) self.fanning = QtWidgets.QCheckBox(QtWidgets.QApplication.translate( "pychemqt", "Calculate fanning friction factor")) layout.addWidget(self.fanning, 2, 1, 1, 2) layout.addWidget(QtWidgets.QLabel("ε/d:"), 3, 1) self.ed = QtWidgets.QLineEdit() layout.addWidget(self.ed, 3, 2) self.lineconfig = LineConfig( "line", QtWidgets.QApplication.translate( "pychemqt", "Relative roughtness style line")) layout.addWidget(self.lineconfig, 4, 1, 1, 2) self.cruxconfig = LineConfig( "crux", QtWidgets.QApplication.translate( "pychemqt", "Crux style line")) layout.addWidget(self.cruxconfig, 5, 1, 1, 2) layout.addItem(QtWidgets.QSpacerItem( 10, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 10, 1, 1, 3) if config and config.has_section("Moody"): self.metodos.setCurrentIndex(config.getint("Moody", 'method')) self.fanning.setChecked(config.getboolean("Moody", 'fanning')) self.ed.setText(config.get("Moody", "ed")) self.lineconfig.setConfig(config, "Moody") self.cruxconfig.setConfig(config, "Moody")
Example #24
Source File: app_general.py From linux-show-player with GNU General Public License v3.0 | 5 votes |
def __init__(self, **kwargs): super().__init__(**kwargs) self.setLayout(QVBoxLayout()) self.layout().setAlignment(Qt.AlignTop) # Startup layout self.layoutGroup = QGroupBox(self) self.layoutGroup.setTitle( translate('AppGeneralSettings', 'Startup layout')) self.layoutGroup.setLayout(QVBoxLayout()) self.layout().addWidget(self.layoutGroup) self.startupDialogCheck = QCheckBox(self.layoutGroup) self.startupDialogCheck.setText( translate('AppGeneralSettings', 'Use startup dialog')) self.layoutGroup.layout().addWidget(self.startupDialogCheck) self.layoutCombo = QComboBox(self.layoutGroup) self.layoutCombo.addItems([lay.NAME for lay in layouts.get_layouts()]) self.layoutGroup.layout().addWidget(self.layoutCombo) self.startupDialogCheck.clicked.connect( lambda check: self.layoutCombo.setEnabled(not check)) # Application style self.themeGroup = QGroupBox(self) self.themeGroup.setTitle( translate('AppGeneralSettings', 'Application theme')) self.themeGroup.setLayout(QVBoxLayout()) self.layout().addWidget(self.themeGroup) self.themeCombo = QComboBox(self.themeGroup) self.themeCombo.addItems(styles.styles()) self.themeGroup.layout().addWidget(self.themeCombo)
Example #25
Source File: tracer.py From heap-viewer with GNU General Public License v3.0 | 5 votes |
def _create_menu(self): cb_enable_trace = QtWidgets.QCheckBox() cb_enable_trace.stateChanged.connect(self.cb_tracing_changed) self.cb_stop_during_tracing = QtWidgets.QCheckBox() btn_dump_trace = QtWidgets.QPushButton("Dump trace") btn_dump_trace.clicked.connect(self.btn_dump_trace_on_click) btn_villoc_trace = QtWidgets.QPushButton("Villoc") btn_villoc_trace.clicked.connect(self.btn_villoc_on_click) btn_clear_trace = QtWidgets.QPushButton("Clear") btn_clear_trace.clicked.connect(self.btn_clear_on_click) hbox_enable_trace = QtWidgets.QHBoxLayout() hbox_enable_trace.addWidget(QtWidgets.QLabel("Enable tracing")) hbox_enable_trace.addWidget(cb_enable_trace) hbox_enable_trace.addWidget(QtWidgets.QLabel("Stop during tracing")) hbox_enable_trace.addWidget(self.cb_stop_during_tracing) hbox_enable_trace.addWidget(btn_dump_trace) hbox_enable_trace.addWidget(btn_villoc_trace) hbox_enable_trace.addWidget(btn_clear_trace) hbox_enable_trace.addStretch(1) hbox_trace = QtWidgets.QVBoxLayout() hbox_trace.addLayout(hbox_enable_trace) hbox_trace.addWidget(QtWidgets.QLabel("Traced chunks")) hbox_trace.addWidget(self.tbl_traced_chunks) self.cb_stop_during_tracing.setChecked(config.stop_during_tracing) cb_enable_trace.setChecked(config.start_tracing_at_startup) self.setLayout(hbox_trace)
Example #26
Source File: ui_TabTextual.py From MDT with GNU Lesser General Public License v3.0 | 5 votes |
def setupUi(self, TabTextual): TabTextual.setObjectName("TabTextual") TabTextual.resize(400, 300) self.gridLayout = QtWidgets.QGridLayout(TabTextual) self.gridLayout.setContentsMargins(0, 0, 0, 0) self.gridLayout.setHorizontalSpacing(0) self.gridLayout.setVerticalSpacing(4) self.gridLayout.setObjectName("gridLayout") self.textConfigEdit = TextConfigEditor(TabTextual) self.textConfigEdit.setObjectName("textConfigEdit") self.gridLayout.addWidget(self.textConfigEdit, 0, 0, 1, 1) self.correctness_label = QtWidgets.QLabel(TabTextual) self.correctness_label.setAlignment(QtCore.Qt.AlignCenter) self.correctness_label.setWordWrap(True) self.correctness_label.setObjectName("correctness_label") self.gridLayout.addWidget(self.correctness_label, 3, 0, 1, 1) self.viewSelectedOptions = QtWidgets.QCheckBox(TabTextual) self.viewSelectedOptions.setChecked(True) self.viewSelectedOptions.setObjectName("viewSelectedOptions") self.gridLayout.addWidget(self.viewSelectedOptions, 1, 0, 1, 1) self.line = QtWidgets.QFrame(TabTextual) self.line.setFrameShape(QtWidgets.QFrame.HLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.gridLayout.addWidget(self.line, 2, 0, 1, 1) self.retranslateUi(TabTextual) QtCore.QMetaObject.connectSlotsByName(TabTextual)
Example #27
Source File: QtShim.py From grap with MIT License | 5 votes |
def get_QCheckBox(): """QCheckBox getter.""" try: import PySide.QtGui as QtGui return QtGui.QCheckBox except ImportError: import PyQt5.QtWidgets as QtWidgets return QtWidgets.QCheckBox
Example #28
Source File: MainWindow.py From 3d-nii-visualizer with MIT License | 5 votes |
def add_mask_settings_widget(self): mask_settings_group_box = QtWidgets.QGroupBox("Mask Settings") mask_settings_layout = QtWidgets.QGridLayout() mask_settings_layout.addWidget(QtWidgets.QLabel("Mask Opacity"), 0, 0) mask_settings_layout.addWidget(QtWidgets.QLabel("Mask Smoothness"), 1, 0) mask_settings_layout.addWidget(self.mask_opacity_sp, 0, 1) mask_settings_layout.addWidget(self.mask_smoothness_sp, 1, 1) mask_multi_color_radio = QtWidgets.QRadioButton("Multi Color") mask_multi_color_radio.setChecked(True) mask_multi_color_radio.clicked.connect(self.mask_multi_color_radio_checked) mask_single_color_radio = QtWidgets.QRadioButton("Single Color") mask_single_color_radio.clicked.connect(self.mask_single_color_radio_checked) mask_settings_layout.addWidget(mask_multi_color_radio, 2, 0) mask_settings_layout.addWidget(mask_single_color_radio, 2, 1) mask_settings_layout.addWidget(self.create_new_separator(), 3, 0, 1, 2) self.mask_label_cbs = [] c_col, c_row = 0, 4 # c_row must always be (+1) of last row for i in range(1, 11): self.mask_label_cbs.append(QtWidgets.QCheckBox("Label {}".format(i))) mask_settings_layout.addWidget(self.mask_label_cbs[i - 1], c_row, c_col) c_row = c_row + 1 if c_col == 1 else c_row c_col = 0 if c_col == 1 else 1 mask_settings_group_box.setLayout(mask_settings_layout) self.grid.addWidget(mask_settings_group_box, 1, 0, 2, 2) for i, cb in enumerate(self.mask_label_cbs): if i < len(self.mask.labels) and self.mask.labels[i].actor: cb.setChecked(True) cb.clicked.connect(self.mask_label_checked) else: cb.setDisabled(True)
Example #29
Source File: MainWindow.py From 3d-nii-visualizer with MIT License | 5 votes |
def add_brain_slicer(self): slicer_cb = QtWidgets.QCheckBox("Slicer") slicer_cb.clicked.connect(self.brain_slicer_vc) return slicer_cb
Example #30
Source File: preferences.py From imperialism-remake with GNU General Public License v3.0 | 5 votes |
def _layout_widget_preferences_music(self): """ Create music options widget. """ tab = QtWidgets.QWidget() tab_layout = QtWidgets.QVBoxLayout(tab) # soundtrack section layout = QtWidgets.QVBoxLayout() # mute checkbox checkbox = QtWidgets.QCheckBox('Mute soundtrack') self._register_check_box(checkbox, constants.Option.SOUNDTRACK_MUTE) layout.addWidget(checkbox) # volume slide layout.addWidget(QtWidgets.QLabel('Volume')) slider = QtWidgets.QSlider(QtCore.Qt.Horizontal) slider.setTickInterval(25) slider.setTickPosition(QtWidgets.QSlider.TicksBelow) slider.setMaximumWidth(100) self._register_slider(slider, constants.Option.SOUNDTRACK_VOLUME) layout.addWidget(slider) # wrap in group box and add to tab tab_layout.addWidget(qt.wrap_in_groupbox(layout, 'Soundtrack')) # vertical stretch tab_layout.addStretch() # add tab self.tab_music = tab self.stacked_layout.addWidget(tab)