def PopulateForm(self):
"""
+-----------------------------------------------------------------------+
| +--- splitter ------------------------------------------------------+ |
| | +-- list widget--------------+ +- IdaSettingsView -------------+ | |
| | | | | | | |
| | | - plugin name | | | | |
| | | - plugin name | | | | |
| | | - plugin name | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | +----------------------------+ +-------------------------------+ | |
| +-------------------------------------------------------------------+ |
+-----------------------------------------------------------------------+
"""
hbox = QtWidgets.QHBoxLayout(self.parent)
self._splitter = QtWidgets.QSplitter(QtCore.Qt.Horizontal)
self._plugin_list = QtWidgets.QListWidget()
plugin_names = set([])
for scope, fn in (("idb", ida_settings.IDASettings.get_idb_plugin_names),
("directory", ida_settings.IDASettings.get_directory_plugin_names),
("user", ida_settings.IDASettings.get_user_plugin_names),
("system", ida_settings.IDASettings.get_system_plugin_names)):
for plugin_name in fn():
plugin_names.add(plugin_name)
for plugin_name in plugin_names:
self._plugin_list.addItem(plugin_name)
self._splitter.addWidget(self._plugin_list)
hbox.addWidget(self._splitter)
self.parent.setLayout(hbox)
self._plugin_list.currentItemChanged.connect(self._handle_plugin_changed)
python类QListWidget()的实例源码
def __init__(self, settings, parent=None):
"""
+-----------------------------------------------------------------------+
| +--- hbox ----------------------------------------------------------+ |
| | +-- list widget--------------+ +- vbox ------------------------+ | |
| | | | | +- QTextEdit ---------------+ | | |
| | | - key | | | | | | |
| | | - key | | | value | | | |
| | | - key | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | +---------------------------+ | | |
| | | | | | | |
| | | | | +- QPushButton -------------+ | | |
| | | | | | | | | |
| | | | | | save | | | |
| | | | | | | | | |
| | | | | +---------------------------+ | | |
| | +----------------------------+ +-------------------------------+ | |
| +-------------------------------------------------------------------+ |
+-----------------------------------------------------------------------+
"""
super(IdaSettingsView, self).__init__(parent=parent)
self._settings = settings
self._current_key = None
self._current_scope = None
hbox = QtWidgets.QHBoxLayout(self)
self._key_list = QtWidgets.QListWidget()
for scope, keys in (("idb", self._settings.idb.iterkeys()),
("directory", self._settings.directory.iterkeys()),
("user", self._settings.user.iterkeys()),
("system", self._settings.system.iterkeys())):
for key in keys:
self._key_list.addItem("({scope:s}) {key:s}".format(scope=scope, key=key))
hbox.addWidget(self._key_list)
vbox = QtWidgets.QVBoxLayout(self)
self._value_view = QtWidgets.QTextEdit(self)
self._save_button = QtWidgets.QPushButton("save")
vbox.addWidget(self._value_view)
vbox.addWidget(self._save_button)
hbox.addLayout(vbox)
self._key_list.currentItemChanged.connect(self._handle_key_changed)
self._save_button.clicked.connect(self._handle_save_value)
self.setLayout(hbox)
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(400, 344)
Form.setMaximumSize(QtCore.QSize(400, 344))
Form.setStyleSheet(
"QPushButton{background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 white, stop: 1 grey);\n"
"border-style: solid;\n"
"border-color: black;\n"
"border-width: 2px;\n"
"border-radius: 10px;}")
self.listWidget = QtWidgets.QListWidget(Form)
self.listWidget.setGeometry(QtCore.QRect(10, 70, 371, 192))
self.listWidget.setObjectName("listWidget")
self.pushButton = QtWidgets.QPushButton(Form)
self.pushButton.setGeometry(QtCore.QRect(280, 20, 99, 31))
self.pushButton.setObjectName("pushButton")
self.label = QtWidgets.QLabel(Form)
self.label.setGeometry(QtCore.QRect(20, 30, 251, 17))
self.label.setObjectName("label")
self.horizontalLayoutWidget = QtWidgets.QWidget(Form)
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(10, 276, 371, 51))
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.pushButton_4 = QtWidgets.QPushButton(self.horizontalLayoutWidget)
self.pushButton_4.setMinimumSize(QtCore.QSize(0, 30))
self.pushButton_4.setObjectName("pushButton_4")
self.horizontalLayout.addWidget(self.pushButton_4)
self.pushButton_3 = QtWidgets.QPushButton(self.horizontalLayoutWidget)
self.pushButton_3.setMinimumSize(QtCore.QSize(0, 30))
self.pushButton_3.setObjectName("pushButton_3")
self.horizontalLayout.addWidget(self.pushButton_3)
self.pushButton_2 = QtWidgets.QPushButton(self.horizontalLayoutWidget)
self.pushButton_2.setMinimumSize(QtCore.QSize(119, 30))
self.pushButton_2.setObjectName("pushButton_2")
self.horizontalLayout.addWidget(self.pushButton_2)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
Form.setTabOrder(self.pushButton, self.listWidget)
Form.setTabOrder(self.listWidget, self.pushButton_4)
Form.setTabOrder(self.pushButton_4, self.pushButton_3)
Form.setTabOrder(self.pushButton_3, self.pushButton_2)
def setupUi(self, workset_dialog):
workset_dialog.setObjectName("workset_dialog")
workset_dialog.resize(500, 430)
workset_dialog.setMinimumSize(QtCore.QSize(500, 430))
workset_dialog.setMaximumSize(QtCore.QSize(500, 430))
self.buttonBox = QtWidgets.QDialogButtonBox(workset_dialog)
self.buttonBox.setGeometry(QtCore.QRect(140, 382, 341, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.name_label = QtWidgets.QLabel(workset_dialog)
self.name_label.setGeometry(QtCore.QRect(20, 30, 67, 17))
self.name_label.setObjectName("name_label")
self.init_label = QtWidgets.QLabel(workset_dialog)
self.init_label.setGeometry(QtCore.QRect(20, 70, 71, 17))
self.init_label.setObjectName("init_label")
self.apps_label = QtWidgets.QLabel(workset_dialog)
self.apps_label.setGeometry(QtCore.QRect(20, 110, 171, 17))
self.apps_label.setObjectName("apps_label")
self.app_list = QtWidgets.QListWidget(workset_dialog)
self.app_list.setGeometry(QtCore.QRect(20, 130, 461, 191))
self.app_list.setObjectName("app_list")
self.delete_btn = QtWidgets.QPushButton(workset_dialog)
self.delete_btn.setEnabled(False)
self.delete_btn.setGeometry(QtCore.QRect(20, 330, 97, 26))
self.delete_btn.setObjectName("delete_btn")
self.add_app_btn = QtWidgets.QPushButton(workset_dialog)
self.add_app_btn.setGeometry(QtCore.QRect(304, 330, 177, 26))
self.add_app_btn.setObjectName("add_app_btn")
self.name_input = QtWidgets.QLineEdit(workset_dialog)
self.name_input.setGeometry(QtCore.QRect(110, 30, 371, 27))
self.name_input.setObjectName("name_input")
self.test_btn = QtWidgets.QPushButton(workset_dialog)
self.test_btn.setGeometry(QtCore.QRect(20, 385, 97, 26))
self.test_btn.setObjectName("test_btn")
self.init_line_edit = QtWidgets.QLineEdit(workset_dialog)
self.init_line_edit.setGeometry(QtCore.QRect(110, 67, 338, 27))
self.init_line_edit.setObjectName("init_line_edit")
self.init_filechooser = QtWidgets.QPushButton(workset_dialog)
self.init_filechooser.setGeometry(QtCore.QRect(450, 67, 31, 26))
self.init_filechooser.setObjectName("init_filechooser")
self.retranslateUi(workset_dialog)
self.buttonBox.accepted.connect(workset_dialog.accept)
self.buttonBox.rejected.connect(workset_dialog.reject)
QtCore.QMetaObject.connectSlotsByName(workset_dialog)
breathing_phrase_list_wt.py 文件源码
项目:mindfulness-at-the-computer
作者: SunyataZero
项目源码
文件源码
阅读 28
收藏 0
点赞 0
评论 0
def __init__(self):
super().__init__()
vbox = QtWidgets.QVBoxLayout()
self.setLayout(vbox)
# self.setMinimumWidth(180)
self.updating_gui_bool = False
self.list_widget = QtWidgets.QListWidget()
# self.list_widget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
vbox.addWidget(self.list_widget)
self.list_widget.itemSelectionChanged.connect(self.on_selection_changed)
hbox = QtWidgets.QHBoxLayout()
vbox.addLayout(hbox)
self.add_to_list_qle = QtWidgets.QLineEdit()
hbox.addWidget(self.add_to_list_qle)
self.add_to_list_qle.setPlaceholderText("New item")
QtWidgets.QShortcut(
QtGui.QKeySequence(QtCore.Qt.Key_Return),
self.add_to_list_qle,
member=self.add_new_phrase_button_clicked,
context=QtCore.Qt.WidgetShortcut
)
self.add_new_phrase_qpb = QtWidgets.QPushButton("Add")
self.add_new_phrase_qpb.clicked.connect(self.add_new_phrase_button_clicked)
hbox.addWidget(self.add_new_phrase_qpb)
hbox = QtWidgets.QHBoxLayout()
vbox.addLayout(hbox)
self.edit_texts_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.edit_texts_qpb)
self.edit_texts_qpb.setIcon(QtGui.QIcon(mc.mc_global.get_icon_path("pencil-2x.png")))
self.edit_texts_qpb.clicked.connect(self.on_edit_texts_clicked)
self.move_to_top_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.move_to_top_qpb)
self.move_to_top_qpb.setIcon(QtGui.QIcon(mc.mc_global.get_icon_path("data-transfer-upload-2x.png")))
self.move_to_top_qpb.clicked.connect(self.on_move_to_top_clicked)
self.move_up_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.move_up_qpb)
self.move_up_qpb.setIcon(QtGui.QIcon(mc.mc_global.get_icon_path("arrow-top-2x.png")))
self.move_up_qpb.clicked.connect(self.on_move_up_clicked)
self.move_down_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.move_down_qpb)
self.move_down_qpb.setIcon(QtGui.QIcon(mc.mc_global.get_icon_path("arrow-bottom-2x.png")))
self.move_down_qpb.clicked.connect(self.on_move_down_clicked)
hbox.addStretch(1)
self.delete_phrase_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.delete_phrase_qpb)
self.delete_phrase_qpb.setIcon(QtGui.QIcon(mc.mc_global.get_icon_path("trash-2x.png")))
self.delete_phrase_qpb.clicked.connect(self.on_delete_clicked)
self.update_gui()
self.list_widget.setCurrentRow(0) # -the first row
rest_action_list_wt.py 文件源码
项目:mindfulness-at-the-computer
作者: SunyataZero
项目源码
文件源码
阅读 24
收藏 0
点赞 0
评论 0
def __init__(self):
super().__init__()
self.updating_gui_bool = False
vbox = QtWidgets.QVBoxLayout()
self.setLayout(vbox)
# Rest actions
self.list_widget = QtWidgets.QListWidget()
vbox.addWidget(self.list_widget)
self.list_widget.itemSelectionChanged.connect(self.on_selection_changed)
hbox = QtWidgets.QHBoxLayout()
vbox.addLayout(hbox)
self.rest_add_action_qle = QtWidgets.QLineEdit()
hbox.addWidget(self.rest_add_action_qle)
self.rest_add_action_qpb = QtWidgets.QPushButton("Add")
hbox.addWidget(self.rest_add_action_qpb)
self.rest_add_action_qpb.clicked.connect(self.add_rest_action_clicked)
# Details
hbox = QtWidgets.QHBoxLayout()
vbox.addLayout(hbox)
self.edit_texts_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.edit_texts_qpb)
self.edit_texts_qpb.setIcon(QtGui.QIcon(mc_global.get_icon_path("pencil-2x.png")))
self.edit_texts_qpb.clicked.connect(self.on_edit_texts_clicked)
self.move_to_top_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.move_to_top_qpb)
self.move_to_top_qpb.setIcon(QtGui.QIcon(mc_global.get_icon_path("data-transfer-upload-2x.png")))
self.move_to_top_qpb.clicked.connect(self.on_move_to_top_clicked)
self.move_up_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.move_up_qpb)
self.move_up_qpb.setIcon(QtGui.QIcon(mc_global.get_icon_path("arrow-top-2x.png")))
self.move_up_qpb.clicked.connect(self.on_move_up_clicked)
self.move_down_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.move_down_qpb)
self.move_down_qpb.setIcon(QtGui.QIcon(mc_global.get_icon_path("arrow-bottom-2x.png")))
self.move_down_qpb.clicked.connect(self.on_move_down_clicked)
hbox.addStretch(1)
self.delete_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.delete_qpb)
self.delete_qpb.setIcon(QtGui.QIcon(mc_global.get_icon_path("trash-2x.png")))
self.delete_qpb.clicked.connect(self.on_delete_clicked)
self.update_gui()
experimental_list_widget.py 文件源码
项目:mindfulness-at-the-computer
作者: SunyataZero
项目源码
文件源码
阅读 23
收藏 0
点赞 0
评论 0
def __init__(self):
super().__init__()
self.updating_gui_bool = False
vbox = QtWidgets.QVBoxLayout()
self.setLayout(vbox)
# Rest actions
self.list_widget = QtWidgets.QListWidget()
vbox.addWidget(self.list_widget)
self.list_widget.itemSelectionChanged.connect(self.on_selection_changed)
hbox = QtWidgets.QHBoxLayout()
vbox.addLayout(hbox)
self.rest_add_action_qle = QtWidgets.QLineEdit()
hbox.addWidget(self.rest_add_action_qle)
self.rest_add_action_qpb = QtWidgets.QPushButton("Add")
hbox.addWidget(self.rest_add_action_qpb)
self.rest_add_action_qpb.clicked.connect(self.add_rest_action_clicked)
# Details
hbox = QtWidgets.QHBoxLayout()
vbox.addLayout(hbox)
self.edit_texts_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.edit_texts_qpb)
self.edit_texts_qpb.setIcon(QtGui.QIcon(mc_global.get_icon_path("pencil-2x.png")))
self.edit_texts_qpb.clicked.connect(self.on_edit_texts_clicked)
self.move_to_top_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.move_to_top_qpb)
self.move_to_top_qpb.setIcon(QtGui.QIcon(mc_global.get_icon_path("data-transfer-upload-2x.png")))
self.move_to_top_qpb.clicked.connect(self.on_move_to_top_clicked)
self.move_up_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.move_up_qpb)
self.move_up_qpb.setIcon(QtGui.QIcon(mc_global.get_icon_path("arrow-top-2x.png")))
self.move_up_qpb.clicked.connect(self.on_move_up_clicked)
self.move_down_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.move_down_qpb)
self.move_down_qpb.setIcon(QtGui.QIcon(mc_global.get_icon_path("arrow-bottom-2x.png")))
self.move_down_qpb.clicked.connect(self.on_move_down_clicked)
hbox.addStretch(1)
self.delete_qpb = QtWidgets.QPushButton()
hbox.addWidget(self.delete_qpb)
self.delete_qpb.setIcon(QtGui.QIcon(mc_global.get_icon_path("trash-2x.png")))
self.delete_qpb.clicked.connect(self.on_delete_clicked)
self.update_gui()
def setup_ui(self, main_window):
main_window.setObjectName("MainWindow")
main_window.resize(886, 534)
self.centralWidget = QtWidgets.QWidget(main_window)
self.centralWidget.setMinimumSize(QtCore.QSize(886, 0))
self.centralWidget.setObjectName("centralWidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralWidget)
self.gridLayout.setObjectName("gridLayout")
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetMaximumSize)
self.horizontalLayout.setObjectName("horizontalLayout")
self.textBrowser = QtWidgets.QTextBrowser(self.centralWidget)
size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
size_policy.setHorizontalStretch(3)
size_policy.setVerticalStretch(0)
size_policy.setHeightForWidth(self.textBrowser.sizePolicy().hasHeightForWidth())
self.textBrowser.setSizePolicy(size_policy)
self.textBrowser.setObjectName("textBrowser")
self.horizontalLayout.addWidget(self.textBrowser)
self.listWidget = QtWidgets.QListWidget(self.centralWidget)
size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
size_policy.setHorizontalStretch(1)
size_policy.setVerticalStretch(0)
size_policy.setHeightForWidth(self.listWidget.sizePolicy().hasHeightForWidth())
self.listWidget.setSizePolicy(size_policy)
self.listWidget.setObjectName("listWidget")
self.horizontalLayout.addWidget(self.listWidget)
self.verticalLayout.addLayout(self.horizontalLayout)
self.widget = QtWidgets.QWidget(self.centralWidget)
self.widget.setMaximumSize(QtCore.QSize(16777215, 30))
self.widget.setObjectName("widget")
self.gridLayout_2 = QtWidgets.QGridLayout(self.widget)
self.gridLayout_2.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize)
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
self.gridLayout_2.setObjectName("gridLayout_2")
self.pushButton = QtWidgets.QPushButton(self.widget)
self.pushButton.setObjectName("pushButton")
self.gridLayout_2.addWidget(self.pushButton, 0, 1, 1, 1)
self.lineEdit = QtWidgets.QLineEdit(self.widget)
self.lineEdit.setObjectName("lineEdit")
self.lineEdit.setPlaceholderText("?????????")
self.gridLayout_2.addWidget(self.lineEdit, 0, 0, 1, 1)
self.verticalLayout.addWidget(self.widget)
self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)
main_window.setCentralWidget(self.centralWidget)
self.retranslate_ui(main_window)
QtCore.QMetaObject.connectSlotsByName(main_window)
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(499, 428)
self.gridLayout = QtWidgets.QGridLayout(Dialog)
self.gridLayout.setObjectName("gridLayout")
self.listWidget = QtWidgets.QListWidget(Dialog)
self.listWidget.setObjectName("listWidget")
self.gridLayout.addWidget(self.listWidget, 2, 0, 1, 2)
self.textEdit = QtWidgets.QTextEdit(Dialog)
self.textEdit.setObjectName("textEdit")
self.gridLayout.addWidget(self.textEdit, 6, 0, 1, 3)
self.label = QtWidgets.QLabel(Dialog)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 2)
self.label_4 = QtWidgets.QLabel(Dialog)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 3, 0, 1, 2)
self.label_3 = QtWidgets.QLabel(Dialog)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 1, 2, 1, 1)
self.label_7 = QtWidgets.QLabel(Dialog)
self.label_7.setObjectName("label_7")
self.gridLayout.addWidget(self.label_7, 5, 0, 1, 1)
self.listWidget_2 = QtWidgets.QListWidget(Dialog)
self.listWidget_2.setObjectName("listWidget_2")
self.gridLayout.addWidget(self.listWidget_2, 2, 2, 1, 1)
self.label_5 = QtWidgets.QLabel(Dialog)
self.label_5.setObjectName("label_5")
self.gridLayout.addWidget(self.label_5, 3, 2, 1, 1)
self.listWidget_3 = QtWidgets.QListWidget(Dialog)
self.listWidget_3.setObjectName("listWidget_3")
self.gridLayout.addWidget(self.listWidget_3, 4, 0, 1, 2)
self.label_2 = QtWidgets.QLabel(Dialog)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
self.listWidget_4 = QtWidgets.QListWidget(Dialog)
self.listWidget_4.setEnabled(False)
self.listWidget_4.setObjectName("listWidget_4")
self.gridLayout.addWidget(self.listWidget_4, 4, 2, 1, 1)
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 7, 2, 1, 1)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
self.buttonBox.accepted.connect(Dialog.accept)
self.buttonBox.rejected.connect(Dialog.reject)
def setupUi(self, Form):
Form.setObjectName("Form")
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
Form.setSizePolicy(sizePolicy)
self.verticalLayout = QtWidgets.QVBoxLayout(Form)
self.verticalLayout.setObjectName("verticalLayout")
self.formGroupBox = QtWidgets.QGroupBox(Form)
self.formGroupBox.setObjectName("formGroupBox")
self.formLayout = QtWidgets.QFormLayout(self.formGroupBox)
self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
self.formLayout.setObjectName("formLayout")
self.fit_interceptLabel = QtWidgets.QLabel(self.formGroupBox)
self.fit_interceptLabel.setObjectName("fit_interceptLabel")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.fit_interceptLabel)
self.fit_intercept_listWidget = QtWidgets.QListWidget(self.formGroupBox)
self.fit_intercept_listWidget.setMaximumSize(QtCore.QSize(16777215, 50))
self.fit_intercept_listWidget.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
self.fit_intercept_listWidget.setObjectName("fit_intercept_listWidget")
item = QtWidgets.QListWidgetItem()
self.fit_intercept_listWidget.addItem(item)
item = QtWidgets.QListWidgetItem()
self.fit_intercept_listWidget.addItem(item)
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.fit_intercept_listWidget)
self.normalizeLabel = QtWidgets.QLabel(self.formGroupBox)
self.normalizeLabel.setObjectName("normalizeLabel")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.normalizeLabel)
self.normalize_list = QtWidgets.QListWidget(self.formGroupBox)
self.normalize_list.setMaximumSize(QtCore.QSize(16777215, 50))
self.normalize_list.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
self.normalize_list.setObjectName("normalize_list")
item = QtWidgets.QListWidgetItem()
self.normalize_list.addItem(item)
item = QtWidgets.QListWidgetItem()
self.normalize_list.addItem(item)
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.normalize_list)
self.n_nonzero_coefsLabel = QtWidgets.QLabel(self.formGroupBox)
self.n_nonzero_coefsLabel.setObjectName("n_nonzero_coefsLabel")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.n_nonzero_coefsLabel)
self.n_nonzero_coefsLineEdit = QtWidgets.QLineEdit(self.formGroupBox)
self.n_nonzero_coefsLineEdit.setObjectName("n_nonzero_coefsLineEdit")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.n_nonzero_coefsLineEdit)
self.positiveLabel = QtWidgets.QLabel(self.formGroupBox)
self.positiveLabel.setObjectName("positiveLabel")
self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.positiveLabel)
self.positive_list = QtWidgets.QListWidget(self.formGroupBox)
self.positive_list.setMaximumSize(QtCore.QSize(16777215, 50))
self.positive_list.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
self.positive_list.setObjectName("positive_list")
item = QtWidgets.QListWidgetItem()
self.positive_list.addItem(item)
item = QtWidgets.QListWidgetItem()
self.positive_list.addItem(item)
self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.positive_list)
self.verticalLayout.addWidget(self.formGroupBox)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
OutlierRemoval.py 文件源码
项目:PySAT_Point_Spectra_GUI
作者: USGS-Astrogeology
项目源码
文件源码
阅读 16
收藏 0
点赞 0
评论 0
def setupUi(self, Form):
Form.setObjectName("Form")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(Form)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.groupLayout = QtWidgets.QGroupBox(Form)
self.groupLayout.setObjectName("groupLayout")
self.gridLayout = QtWidgets.QGridLayout(self.groupLayout)
self.gridLayout.setObjectName("gridLayout")
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.chooseDataLabel = QtWidgets.QLabel(self.groupLayout)
self.chooseDataLabel.setObjectName("chooseDataLabel")
self.horizontalLayout_3.addWidget(self.chooseDataLabel)
self.chooseDataComboBox = QtWidgets.QComboBox(self.groupLayout)
self.chooseDataComboBox.setObjectName("chooseDataComboBox")
self.horizontalLayout_3.addWidget(self.chooseDataComboBox)
self.gridLayout.addLayout(self.horizontalLayout_3, 0, 0, 1, 1)
self.xVariableLabel = QtWidgets.QLabel(self.groupLayout)
self.xVariableLabel.setObjectName("xVariableLabel")
self.gridLayout.addWidget(self.xVariableLabel, 1, 0, 1, 1)
self.xVariableList = QtWidgets.QListWidget(self.groupLayout)
self.xVariableList.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.xVariableList.sizePolicy().hasHeightForWidth())
self.xVariableList.setSizePolicy(sizePolicy)
self.xVariableList.setObjectName("xVariableList")
item = QtWidgets.QListWidgetItem()
self.xVariableList.addItem(item)
self.gridLayout.addWidget(self.xVariableList, 2, 0, 1, 1)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.chooseAlgorithmLabel = QtWidgets.QLabel(self.groupLayout)
self.chooseAlgorithmLabel.setObjectName("chooseAlgorithmLabel")
self.horizontalLayout_2.addWidget(self.chooseAlgorithmLabel)
self.chooseAlgorithmComboBox = QtWidgets.QComboBox(self.groupLayout)
self.chooseAlgorithmComboBox.setObjectName("chooseAlgorithmComboBox")
self.horizontalLayout_2.addWidget(self.chooseAlgorithmComboBox)
self.gridLayout.addLayout(self.horizontalLayout_2, 3, 0, 1, 1)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.gridLayout.addLayout(self.horizontalLayout, 3, 1, 1, 1)
self.algorithmLayout = QtWidgets.QVBoxLayout()
self.algorithmLayout.setObjectName("algorithmLayout")
self.gridLayout.addLayout(self.algorithmLayout, 4, 0, 1, 2)
self.verticalLayout_2.addWidget(self.groupLayout)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def setupUi(self, Form):
Form.setObjectName("Form")
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
Form.setSizePolicy(sizePolicy)
self.verticalLayout = QtWidgets.QVBoxLayout(Form)
self.verticalLayout.setObjectName("verticalLayout")
self.formGroupBox = QtWidgets.QGroupBox(Form)
self.formGroupBox.setObjectName("formGroupBox")
self.formLayout = QtWidgets.QFormLayout(self.formGroupBox)
self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
self.formLayout.setObjectName("formLayout")
self.fitInterceptLabel = QtWidgets.QLabel(self.formGroupBox)
self.fitInterceptLabel.setObjectName("fitInterceptLabel")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.fitInterceptLabel)
self.normalizeLabel = QtWidgets.QLabel(self.formGroupBox)
self.normalizeLabel.setObjectName("normalizeLabel")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.normalizeLabel)
self.fit_intercept_list = QtWidgets.QListWidget(self.formGroupBox)
self.fit_intercept_list.setMaximumSize(QtCore.QSize(16777215, 50))
self.fit_intercept_list.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
self.fit_intercept_list.setObjectName("fit_intercept_list")
item = QtWidgets.QListWidgetItem()
self.fit_intercept_list.addItem(item)
item = QtWidgets.QListWidgetItem()
self.fit_intercept_list.addItem(item)
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.fit_intercept_list)
self.normalize_list = QtWidgets.QListWidget(self.formGroupBox)
self.normalize_list.setMaximumSize(QtCore.QSize(16777215, 50))
self.normalize_list.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
self.normalize_list.setObjectName("normalize_list")
item = QtWidgets.QListWidgetItem()
self.normalize_list.addItem(item)
item = QtWidgets.QListWidgetItem()
self.normalize_list.addItem(item)
self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.normalize_list)
self.n_coefs_label = QtWidgets.QLabel(self.formGroupBox)
self.n_coefs_label.setObjectName("n_coefs_label")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.n_coefs_label)
self.n_coefs_lineedit = QtWidgets.QLineEdit(self.formGroupBox)
self.n_coefs_lineedit.setObjectName("n_coefs_lineedit")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.n_coefs_lineedit)
self.verticalLayout.addWidget(self.formGroupBox)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def addToLibrary(self):
global home
#self.LibraryDialog.show()
self.LibraryDialog = QtWidgets.QDialog()
self.LibraryDialog.setObjectName(_fromUtf8("Dialog"))
self.LibraryDialog.resize(582, 254)
self.listLibrary = QtWidgets.QListWidget(self.LibraryDialog)
self.listLibrary.setGeometry(QtCore.QRect(20, 20, 341, 192))
self.listLibrary.setObjectName(_fromUtf8("listLibrary"))
self.AddLibraryFolder = QtWidgets.QPushButton(self.LibraryDialog)
self.AddLibraryFolder.setGeometry(QtCore.QRect(420, 50, 94, 27))
self.AddLibraryFolder.setObjectName(_fromUtf8("AddLibraryFolder"))
self.RemoveLibraryFolder = QtWidgets.QPushButton(self.LibraryDialog)
self.RemoveLibraryFolder.setGeometry(QtCore.QRect(420, 90, 94, 27))
self.RemoveLibraryFolder.setObjectName(_fromUtf8("RemoveLibraryFolder"))
self.LibraryClose = QtWidgets.QPushButton(self.LibraryDialog)
self.LibraryClose.setGeometry(QtCore.QRect(420, 130, 94, 27))
self.LibraryClose.setObjectName(_fromUtf8("LibraryClose"))
self.LibraryDialog.setWindowTitle(_translate("Dialog", "Library Setting", None))
self.AddLibraryFolder.setText(_translate("Dialog", "ADD", None))
self.RemoveLibraryFolder.setText(_translate("Dialog", "Remove", None))
self.LibraryClose.setText(_translate("Dialog", "Close", None))
self.LibraryDialog.show()
file_name = os.path.join(home,'local.txt')
if os.path.exists(file_name):
lines = open_files(file_name,True)
self.listLibrary.clear()
for i in lines:
i = i.replace('\n','')
self.listLibrary.addItem(i)
self.AddLibraryFolder.clicked.connect(self.addFolderLibrary)
self.RemoveLibraryFolder.clicked.connect(self.removeFolderLibrary)
self.LibraryClose.clicked.connect(self.LibraryDialog.close)
self.LibraryClose.setStyleSheet("font: bold 12px;color:white;background:rgba(0,0,0,30%);border:rgba(0,0,0,30%);border-radius: 3px;")
self.RemoveLibraryFolder.setStyleSheet("font: bold 12px;color:white;background:rgba(0,0,0,30%);border:rgba(0,0,0,30%);border-radius: 3px;")
self.AddLibraryFolder.setStyleSheet("font: bold 12px;color:white;background:rgba(0,0,0,30%);border:rgba(0,0,0,30%);border-radius: 3px;")
self.listLibrary.setStyleSheet("""QListWidget{
font: bold 12px;color:white;background:rgba(0,0,0,30%);
border:rgba(0,0,0,30%);border-radius: 3px;
}
QListWidget:item:selected:active {
background:rgba(0,0,0,20%);
color: violet;
}
QListWidget:item:selected:inactive {
border:rgba(0,0,0,30%);
}
QMenu{
font: bold 12px;color:black;background-image:url('1.png');
}
""")
picn = self.default_background
palette = QtGui.QPalette()
palette.setBrush(QtGui.QPalette.Background,QtGui.QBrush(QtGui.QPixmap(picn)))
self.LibraryDialog.setPalette(palette)
def addToLibrary(self):
global home
#self.LibraryDialog.show()
self.LibraryDialog = QtWidgets.QDialog()
self.LibraryDialog.setObjectName(_fromUtf8("Dialog"))
self.LibraryDialog.resize(582, 254)
self.listLibrary = QtWidgets.QListWidget(self.LibraryDialog)
self.listLibrary.setGeometry(QtCore.QRect(20, 20, 341, 192))
self.listLibrary.setObjectName(_fromUtf8("listLibrary"))
self.AddLibraryFolder = QtWidgets.QPushButton(self.LibraryDialog)
self.AddLibraryFolder.setGeometry(QtCore.QRect(420, 50, 94, 27))
self.AddLibraryFolder.setObjectName(_fromUtf8("AddLibraryFolder"))
self.RemoveLibraryFolder = QtWidgets.QPushButton(self.LibraryDialog)
self.RemoveLibraryFolder.setGeometry(QtCore.QRect(420, 90, 94, 27))
self.RemoveLibraryFolder.setObjectName(_fromUtf8("RemoveLibraryFolder"))
self.LibraryClose = QtWidgets.QPushButton(self.LibraryDialog)
self.LibraryClose.setGeometry(QtCore.QRect(420, 130, 94, 27))
self.LibraryClose.setObjectName(_fromUtf8("LibraryClose"))
self.LibraryDialog.setWindowTitle(_translate("Dialog", "Library Setting", None))
self.AddLibraryFolder.setText(_translate("Dialog", "ADD", None))
self.RemoveLibraryFolder.setText(_translate("Dialog", "Remove", None))
self.LibraryClose.setText(_translate("Dialog", "Close", None))
self.LibraryDialog.show()
file_name = os.path.join(home,'local.txt')
if os.path.exists(file_name):
lines = open_files(file_name,True)
self.listLibrary.clear()
for i in lines:
i = i.replace('\n','')
self.listLibrary.addItem(i)
self.AddLibraryFolder.clicked.connect(self.addFolderLibrary)
self.RemoveLibraryFolder.clicked.connect(self.removeFolderLibrary)
self.LibraryClose.clicked.connect(self.LibraryDialog.close)
self.LibraryClose.setStyleSheet("font: bold 12px;color:white;background:rgba(0,0,0,30%);border:rgba(0,0,0,30%);border-radius: 3px;")
self.RemoveLibraryFolder.setStyleSheet("font: bold 12px;color:white;background:rgba(0,0,0,30%);border:rgba(0,0,0,30%);border-radius: 3px;")
self.AddLibraryFolder.setStyleSheet("font: bold 12px;color:white;background:rgba(0,0,0,30%);border:rgba(0,0,0,30%);border-radius: 3px;")
self.listLibrary.setStyleSheet("""QListWidget{
font: bold 12px;color:white;background:rgba(0,0,0,30%);
border:rgba(0,0,0,30%);border-radius: 3px;
}
QListWidget:item:selected:active {
background:rgba(0,0,0,20%);
color: violet;
}
QListWidget:item:selected:inactive {
border:rgba(0,0,0,30%);
}
QMenu{
font: bold 12px;color:black;background-image:url('1.png');
}
""")
picn = self.default_background
palette = QtGui.QPalette()
palette.setBrush(QtGui.QPalette.Background,QtGui.QBrush(QtGui.QPixmap(picn)))
self.LibraryDialog.setPalette(palette)