本文整理汇总了Python中qtpy.QtWidgets.QGroupBox.isChecked方法的典型用法代码示例。如果您正苦于以下问题:Python QGroupBox.isChecked方法的具体用法?Python QGroupBox.isChecked怎么用?Python QGroupBox.isChecked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qtpy.QtWidgets.QGroupBox
的用法示例。
在下文中一共展示了QGroupBox.isChecked方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: KernelConnectionDialog
# 需要导入模块: from qtpy.QtWidgets import QGroupBox [as 别名]
# 或者: from qtpy.QtWidgets.QGroupBox import isChecked [as 别名]
#.........这里部分代码省略.........
port = str(existing_kernel.get("port", 22))
is_ssh_kf = existing_kernel.get("is_ssh_keyfile", False)
ssh_kf = existing_kernel.get("ssh_key_file_path", "")
if connection_file_path != "":
self.cf.setText(connection_file_path)
if username != "":
self.un.setText(username)
if hostname != "":
self.hn.setText(hostname)
if ssh_kf != "":
self.kf.setText(ssh_kf)
self.rm_group.setChecked(is_remote)
self.pn.setText(port)
self.kf_radio.setChecked(is_ssh_kf)
self.pw_radio.setChecked(not is_ssh_kf)
try:
import keyring
ssh_passphrase = keyring.get_password("spyder_remote_kernel",
"ssh_key_passphrase")
ssh_password = keyring.get_password("spyder_remote_kernel",
"ssh_password")
if ssh_passphrase:
self.kfp.setText(ssh_passphrase)
if ssh_password:
self.pw.setText(ssh_password)
except Exception:
pass
def save_connection_settings(self):
"""Save user's kernel connection settings."""
if not self.save_layout.isChecked():
return
is_ssh_key = bool(self.kf_radio.isChecked())
connection_settings = {
"json_file_path": self.cf.text(),
"is_remote": self.rm_group.isChecked(),
"username": self.un.text(),
"hostname": self.hn.text(),
"port": self.pn.text(),
"is_ssh_keyfile": is_ssh_key,
"ssh_key_file_path": self.kf.text()
}
CONF.set("existing-kernel", "settings", connection_settings)
try:
import keyring
if is_ssh_key:
keyring.set_password("spyder_remote_kernel",
"ssh_key_passphrase",
self.kfp.text())
else:
keyring.set_password("spyder_remote_kernel",
"ssh_password",
self.pw.text())
except Exception:
pass
def select_connection_file(self):
cf = getopenfilename(self, _('Select kernel connection file'),
jupyter_runtime_dir(), '*.json;;*.*')[0]
self.cf.setText(cf)