我们从Python开源项目中,提取了以下19个代码示例,用于说明如何使用PyQt5.QtWidgets.QToolButton()。
def finder_toolbar(self): self.finder_toolbar = QtWidgets.QToolBar() self.finder_toolbar.setAllowedAreas(QtCore.Qt.TopToolBarArea) self.finder_toolbar.setHidden(True) self.finder_toolbar.setFloatable(True) self.finder_tool() self.finder_toolbar.addWidget(self.finder) btn_close = QtWidgets.QToolButton() btn_close.setIcon(QtGui.QIcon('assets/icons/close.png')) btn_close.setFixedSize(16, 16) btn_close.clicked.connect(self.finder_toolbar.hide) self.finder_toolbar.addWidget(btn_close) self.addToolBar(self.finder_toolbar) self.finder_focus()
def __init__(self): QTabWidget.__init__(self) self.setMaximumHeight(120) #self.setStyleSheet("QWidget { background-color:cyan; }") self.about = QToolButton(self) self.about.setText(_("About")) self.about.pressed.connect(self.callback_about_dialog) self.setCornerWidget(self.about) w=self.optics() self.addTab(w,_("Spectrum")) sheet=self.readStyleSheet(os.path.join(get_css_path(),"style.css")) if sheet!=None: sheet=str(sheet,'utf-8') self.setStyleSheet(sheet)
def __init__(self): QTabWidget.__init__(self) self.setMaximumHeight(120) #self.setStyleSheet("QWidget { background-color:cyan; }") self.about = QToolButton(self) self.about.setText(_("About")) self.about.pressed.connect(self.callback_about_dialog) self.setCornerWidget(self.about) w=self.optics() self.addTab(w,_("Optics")) sheet=self.readStyleSheet(os.path.join(get_css_path(),"style.css")) if sheet!=None: sheet=str(sheet,'utf-8') self.setStyleSheet(sheet)
def __init__(self, items, parent=None): super(ButtonLineEdit, self).__init__(parent) self.menu = QtWidgets.QMenu() for i in items: self.menu.addAction(i) self.button = QtWidgets.QToolButton(self) self.button.setStyleSheet('border: 0px; padding: 0px;') self.button.setCursor(QtCore.Qt.ArrowCursor) self.button.triggered.connect(self.menu_action_triggered) self.button.setPopupMode(QtWidgets.QToolButton.InstantPopup) self.button.setMenu(self.menu) frameWidth = self.style().pixelMetric(QtWidgets.QStyle.PM_DefaultFrameWidth) buttonSize = self.button.sizeHint() self.setAlignment(QtCore.Qt.Alignment(QtCore.Qt.AlignHCenter)) self.setStyleSheet('QLineEdit {padding-right: %dpx; }' % (buttonSize.width() + frameWidth + 1)) self.setMinimumSize(max(self.minimumSizeHint().width(), buttonSize.width() + frameWidth*2 + 2), max(self.minimumSizeHint().height(), buttonSize.height() + frameWidth*2 + 2)) self.setMaximumWidth(100)
def init_widget(self): """ ?? ??? ???? ??? """ self.setWindowTitle("Tab Widget") form_lbx = QBoxLayout(QBoxLayout.TopToBottom, parent=self) self.setLayout(form_lbx) # ? ?? ?? ?? tbw_addbtn = QToolButton() self.tbw.setCornerWidget(tbw_addbtn, Qt.TopLeftCorner) # ?? ?? tbw_addbtn.setAutoRaise(True) # ???? ???? ??? tbw_addbtn.setIcon(QIcon("plus_icon.png")) # ??? ?? tbw_addbtn.clicked.connect(self.add_new_tab) # ??? ??? ?? form_lbx.addWidget(self.tbw) # ?? ? ?? self.add_new_tab()
def setupUi(self, FindWidget): FindWidget.setObjectName("FindWidget") FindWidget.resize(1040, 102) self.horizontalLayout = QtWidgets.QHBoxLayout(FindWidget) self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetMinAndMaxSize) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setObjectName("horizontalLayout") self.button_find_close = QtWidgets.QToolButton(FindWidget) icon = QtGui.QIcon.fromTheme("window-close") self.button_find_close.setIcon(icon) self.button_find_close.setObjectName("button_find_close") self.horizontalLayout.addWidget(self.button_find_close) self.label = QtWidgets.QLabel(FindWidget) self.label.setObjectName("label") self.horizontalLayout.addWidget(self.label) self.edit_find = QtWidgets.QLineEdit(FindWidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.edit_find.sizePolicy().hasHeightForWidth()) self.edit_find.setSizePolicy(sizePolicy) self.edit_find.setObjectName("edit_find") self.horizontalLayout.addWidget(self.edit_find) self.button_find_next = QtWidgets.QPushButton(FindWidget) icon = QtGui.QIcon.fromTheme("go-down") self.button_find_next.setIcon(icon) self.button_find_next.setObjectName("button_find_next") self.horizontalLayout.addWidget(self.button_find_next) self.button_find_prev = QtWidgets.QPushButton(FindWidget) icon = QtGui.QIcon.fromTheme("go-up") self.button_find_prev.setIcon(icon) self.button_find_prev.setObjectName("button_find_prev") self.horizontalLayout.addWidget(self.button_find_prev) self.horizontalLayout.setStretch(2, 1) self.retranslateUi(FindWidget) QtCore.QMetaObject.connectSlotsByName(FindWidget)
def disableTooltips(self) -> None: buttonlist = self.findChildren(QToolButton) for button in buttonlist: button.installEventFilter(self) if button == buttonlist[len(buttonlist)-1]: button.setObjectName('saveButton')
def setLabelByType(self, label_type: str) -> None: if label_type == 'beside': self.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) [button.setText(button.text().replace(' ', '\n')) for button in self.findChildren(QToolButton)] elif label_type == 'under': self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) [button.setText(button.text().replace('\n', ' ')) for button in self.findChildren(QToolButton)] elif label_type == 'none': self.setToolButtonStyle(Qt.ToolButtonIconOnly) self.parent.settings.setValue('toolbarLabels', label_type)
def __init__(self, parent=None): QtWidgets.QWidget.__init__(self, parent) # Click pos self.clickPos = QtCore.QPoint(50, 50) # App Icon self.icon_Label = QtWidgets.QLabel() self.icon_Label.setPixmap(QtGui.QPixmap(":/resources/bcts.png").scaled(QtCore.QSize(40, 40))) self.icon_Label.setFixedWidth(40) # Title font self.title_font = QtGui.QFont("Segoe UI") self.title_font.setPointSize(11) self.title_font.setBold(True) # Title self.title_Label = QtWidgets.QLabel("") self.title_Label.setFont(self.title_font) self.title_Label.setAlignment(QtCore.Qt.AlignCenter) #?Button self.closeApp_btn = QtWidgets.QToolButton() self.closeApp_btn.setIcon(QtGui.QIcon(":/resources/close.png")) self.closeApp_btn.setObjectName("closeButton") self.titlelayout = QtWidgets.QHBoxLayout() self.titlelayout.addWidget(self.icon_Label) self.titlelayout.addWidget(self.title_Label) self.titlelayout.addWidget(self.closeApp_btn) self.titlelayout.setSpacing(0) self.titlelayout.setContentsMargins(5, 5, 5, 5) # Stylesheet self.setStyleSheet("QLabel{background:#ffffff; color:#859ba6; font-family:'Segoe UI'; font-size:12pt;} QToolButton{border:none;} QPushButton:hover{background:#6e66cc;border:1px solid #373366;} QToolButton:hover{background:#fa7064;}") self.setLayout(self.titlelayout) # Slots & signals self.closeApp_btn.clicked.connect(parent.close)
def __init__(self): QTabWidget.__init__(self) self.setMaximumHeight(120) #self.setStyleSheet("QWidget { background-color:cyan; }") self.about = QToolButton(self) self.about.setText(_("About")) self.about.pressed.connect(self.callback_about_dialog) self.setCornerWidget(self.about) w=self.file() self.addTab(w,_("File")) self.home=ribbon_home() self.addTab(self.home,_("Home")) self.simulations=ribbon_simulations() self.addTab(self.simulations,_("Simulations")) self.configure=ribbon_configure() self.addTab(self.configure,_("Configure")) #self.device=ribbon_device() #self.addTab(self.device,_("Device")) self.database=ribbon_database() self.addTab(self.database,_("Databases")) if enable_betafeatures()==True: self.tb_cluster=ribbon_cluster() self.addTab(self.tb_cluster,_("Cluster")) self.information=ribbon_information() self.addTab(self.information,_("Information")) #self.setStyleSheet("QWidget { background-color:cyan; }") css_apply(self,"style.css")
def __init__(self): QTabWidget.__init__(self) self.setMaximumHeight(130) #self.setStyleSheet("QWidget { background-color:cyan; }") self.about = QToolButton(self) self.about.setText(_("About")) self.about.pressed.connect(self.callback_about_dialog) self.setCornerWidget(self.about) w=self.measurement() self.addTab(w,_("Measurement")) sheet=self.readStyleSheet(os.path.join(get_css_path(),"style.css")) if sheet!=None: sheet=str(sheet,'utf-8') self.setStyleSheet(sheet)
def __init__(self,parent=None): myo.Ui_MainWindow.__init__(self,parent) self.setWindowFlags(Qt.FramelessWindowHint) f = QFile("D:\MyoSEMG\BorderlessWindow.css") if not f.exists(): self.statusBar().showMessage("Unable to load stylesheet, file not found in resources") else: f.open(QFile.ReadOnly | QFile.Text) ts = QTextStream(f) stylesheet = ts.readAll() self.setStyleSheet(stylesheet) title_bar = QtWidgets.QWidget() title_bar.pushButtonMinimize = QtWidgets.QToolButton() title_bar.pushButtonMinimize.setIcon(QtGui.QIcon('Icons/Minimize.png')) title_bar.pushButtonMaxmize = QtWidgets.QToolButton() title_bar.pushButtonMaxmize.setIcon(QtGui.QIcon('Icons/Maxmize.png')) title_bar.pushButtonClose = QtWidgets.QToolButton() title_bar.pushButtonClose.setIcon(QtGui.QIcon('Icons/Close.png')) title_bar.pushButtonMinimize.setMinimumHeight(10) title_bar.pushButtonClose.setMinimumHeight(10) title_bar.pushButtonMaxmize.setMinimumHeight(10) label = QtWidgets.QLabel(self) label.setText("MyoSEMG") title_bar.setWindowTitle("MyoSEMG") hbox = QtWidgets.QHBoxLayout() hbox.addWidget(label) hbox.addWidget(title_bar.pushButtonMinimize) hbox.addWidget(title_bar.pushButtonMaxmize) hbox.addWidget(title_bar.pushButtonClose) hbox.insertStretch(1,500) hbox.setSpacing(0) self.setSizePolicy(QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Fixed) self.maxNormal = False title_bar.pushButtonClose.clicked().connect(self.close) title_bar.pushButtonMinimize.clicked.connect(self.showSmall) title_bar.pushButtonMaxmize.clicked.connect(self.showMaxRestore)
def gridRowHelper(self, label_txt, info_txt=None): """Helper to construct the widgets that make up the config UI grid rows. Returns (label, info, line_edit) elements. """ label = QtWidgets.QLabel(label_txt) if info_txt: info = QtWidgets.QToolButton() info.setIcon(qta.icon('fa.question')) info.clicked.connect(lambda: self.parent.show_message(info_txt)) else: info = None line_edit = QtWidgets.QLineEdit() return label, info, line_edit
def setupUi(self, ButtonList): ButtonList.setObjectName("ButtonList") ButtonList.resize(472, 184) self.verticalLayout = QtWidgets.QVBoxLayout(ButtonList) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setSpacing(6) self.verticalLayout.setObjectName("verticalLayout") self.list_widget = QtWidgets.QListWidget(ButtonList) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.list_widget.sizePolicy().hasHeightForWidth()) self.list_widget.setSizePolicy(sizePolicy) self.list_widget.setMinimumSize(QtCore.QSize(0, 24)) self.list_widget.setDragDropMode(QtWidgets.QAbstractItemView.InternalMove) self.list_widget.setSelectionMode(QtWidgets.QAbstractItemView.ContiguousSelection) self.list_widget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) self.list_widget.setObjectName("list_widget") self.verticalLayout.addWidget(self.list_widget) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setSpacing(3) self.horizontalLayout.setObjectName("horizontalLayout") self.button_remove_group = QtWidgets.QPushButton(ButtonList) self.button_remove_group.setObjectName("button_remove_group") self.horizontalLayout.addWidget(self.button_remove_group) spacerItem = QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.button_group_up = QtWidgets.QToolButton(ButtonList) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.button_group_up.sizePolicy().hasHeightForWidth()) self.button_group_up.setSizePolicy(sizePolicy) self.button_group_up.setText("") self.button_group_up.setObjectName("button_group_up") self.horizontalLayout.addWidget(self.button_group_up) self.button_group_down = QtWidgets.QToolButton(ButtonList) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.button_group_down.sizePolicy().hasHeightForWidth()) self.button_group_down.setSizePolicy(sizePolicy) self.button_group_down.setText("") self.button_group_down.setObjectName("button_group_down") self.horizontalLayout.addWidget(self.button_group_down) self.verticalLayout.addLayout(self.horizontalLayout) self.verticalLayout.setStretch(0, 1) self.retranslateUi(ButtonList) QtCore.QMetaObject.connectSlotsByName(ButtonList)
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(400, 231) 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.lineEdit = QtWidgets.QLineEdit(Form) self.lineEdit.setGeometry(QtCore.QRect(140, 80, 201, 29)) self.lineEdit.setObjectName("lineEdit") self.label = QtWidgets.QLabel(Form) self.label.setGeometry(QtCore.QRect(20, 80, 101, 31)) font = QtGui.QFont() font.setPointSize(14) font.setBold(True) font.setItalic(True) font.setWeight(75) self.label.setFont(font) self.label.setObjectName("label") self.toolButton = QtWidgets.QToolButton(Form) self.toolButton.setGeometry(QtCore.QRect(350, 80, 24, 25)) self.toolButton.setStyleSheet( "QToolButton{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.toolButton.setObjectName("toolButton") self.label_2 = QtWidgets.QLabel(Form) self.label_2.setGeometry(QtCore.QRect(30, 20, 81, 17)) self.label_2.setObjectName("label_2") self.label_3 = QtWidgets.QLabel(Form) self.label_3.setGeometry(QtCore.QRect(150, 20, 211, 17)) self.label_3.setObjectName("label_3") self.horizontalLayoutWidget = QtWidgets.QWidget(Form) self.horizontalLayoutWidget.setGeometry(QtCore.QRect(20, 169, 361, 51)) self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget) self.horizontalLayout.setObjectName("horizontalLayout") 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(0, 30)) self.pushButton_2.setObjectName("pushButton_2") self.horizontalLayout.addWidget(self.pushButton_2) self.pushButton = QtWidgets.QPushButton(self.horizontalLayoutWidget) self.pushButton.setMinimumSize(QtCore.QSize(0, 30)) self.pushButton.setObjectName("pushButton") self.horizontalLayout.addWidget(self.pushButton) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form) Form.setTabOrder(self.lineEdit, self.toolButton) Form.setTabOrder(self.toolButton, self.pushButton_3) Form.setTabOrder(self.pushButton_3, self.pushButton_2) Form.setTabOrder(self.pushButton_2, self.pushButton)
def __init__(self, parent=None, title='', animation_duration=300): """ References: # Adapted from c++ version http://stackoverflow.com/questions/32476006/how-to-make-an-expandable-collapsable-section-widget-in-qt """ super(GroupWidget, self).__init__(parent=parent) self.animation_duration = animation_duration self.toggle_animation = QParallelAnimationGroup() self.content_area = QScrollArea() self.header_line = QFrame() self.toggle_button = QToolButton() self.main_layout = QGridLayout() toggle_button = self.toggle_button toggle_button.setStyleSheet("QToolButton { border: none; }") toggle_button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) toggle_button.setArrowType(Qt.RightArrow) toggle_button.setText(str(title)) toggle_button.setCheckable(True) toggle_button.setChecked(False) header_line = self.header_line header_line.setFrameShape(QFrame.HLine) header_line.setFrameShadow(QFrame.Sunken) header_line.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Maximum) self.content_area.setStyleSheet("QScrollArea { background-color: white; border: none; }") self.content_area.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) # start out collapsed self.content_area.setMaximumHeight(0) self.content_area.setMinimumHeight(0) # let the entire widget grow and shrink with its content toggle_animation = self.toggle_animation toggle_animation.addAnimation(QPropertyAnimation(self, bytes("minimumHeight", "utf-8"))) toggle_animation.addAnimation(QPropertyAnimation(self, bytes("maximumHeight", "utf-8"))) toggle_animation.addAnimation(QPropertyAnimation(self.content_area, bytes("maximumHeight", "utf-8"))) # don't waste space main_layout = self.main_layout main_layout.setVerticalSpacing(0) main_layout.setContentsMargins(0, 0, 0, 0) row = 0 main_layout.addWidget(self.toggle_button, row, 0, 1, 1, Qt.AlignLeft) main_layout.addWidget(self.header_line, row, 2, 1, 1) row += 1 main_layout.addWidget(self.content_area, row, 0, 1, 3) self.setLayout(self.main_layout) def start_animation(checked): arrow_type = Qt.DownArrow if checked else Qt.RightArrow direction = QAbstractAnimation.Forward if checked else QAbstractAnimation.Backward toggle_button.setArrowType(arrow_type) self.toggle_animation.setDirection(direction) self.toggle_animation.start() self.toggle_button.clicked.connect(start_animation)
def setupUi(self, reddit_account_dialog): reddit_account_dialog.setObjectName("reddit_account_dialog") reddit_account_dialog.resize(412, 108) font = QtGui.QFont() font.setPointSize(10) reddit_account_dialog.setFont(font) self.gridLayout = QtWidgets.QGridLayout(reddit_account_dialog) self.gridLayout.setObjectName("gridLayout") self.save_cancel_button_box = QtWidgets.QDialogButtonBox(reddit_account_dialog) self.save_cancel_button_box.setOrientation(QtCore.Qt.Horizontal) self.save_cancel_button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) self.save_cancel_button_box.setObjectName("save_cancel_button_box") self.gridLayout.addWidget(self.save_cancel_button_box, 1, 1, 1, 1) self.reddit_account_help_button = QtWidgets.QToolButton(reddit_account_dialog) self.reddit_account_help_button.setObjectName("reddit_account_help_button") self.gridLayout.addWidget(self.reddit_account_help_button, 1, 0, 1, 1) self.formLayout = QtWidgets.QFormLayout() self.formLayout.setObjectName("formLayout") self.label = QtWidgets.QLabel(reddit_account_dialog) font = QtGui.QFont() font.setPointSize(10) self.label.setFont(font) self.label.setObjectName("label") self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label) self.username_line_edit = QtWidgets.QLineEdit(reddit_account_dialog) self.username_line_edit.setObjectName("username_line_edit") self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.username_line_edit) self.password_line_edit = QtWidgets.QLineEdit(reddit_account_dialog) self.password_line_edit.setObjectName("password_line_edit") self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.password_line_edit) self.label_2 = QtWidgets.QLabel(reddit_account_dialog) font = QtGui.QFont() font.setPointSize(10) self.label_2.setFont(font) self.label_2.setObjectName("label_2") self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_2) self.gridLayout.addLayout(self.formLayout, 0, 0, 1, 2) self.retranslateUi(reddit_account_dialog) self.save_cancel_button_box.accepted.connect(reddit_account_dialog.accept) self.save_cancel_button_box.rejected.connect(reddit_account_dialog.reject) QtCore.QMetaObject.connectSlotsByName(reddit_account_dialog)
def setupUi(self, imgur_client_dialog): imgur_client_dialog.setObjectName("imgur_client_dialog") imgur_client_dialog.resize(412, 108) font = QtGui.QFont() font.setPointSize(10) imgur_client_dialog.setFont(font) self.gridLayout = QtWidgets.QGridLayout(imgur_client_dialog) self.gridLayout.setObjectName("gridLayout") self.buttonBox = QtWidgets.QDialogButtonBox(imgur_client_dialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.gridLayout.addWidget(self.buttonBox, 1, 1, 1, 1) self.imgur_client_help_button = QtWidgets.QToolButton(imgur_client_dialog) self.imgur_client_help_button.setObjectName("imgur_client_help_button") self.gridLayout.addWidget(self.imgur_client_help_button, 1, 0, 1, 1) self.formLayout = QtWidgets.QFormLayout() self.formLayout.setObjectName("formLayout") self.label = QtWidgets.QLabel(imgur_client_dialog) font = QtGui.QFont() font.setPointSize(10) self.label.setFont(font) self.label.setObjectName("label") self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label) self.lineEdit = QtWidgets.QLineEdit(imgur_client_dialog) self.lineEdit.setObjectName("lineEdit") self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.lineEdit) self.lineEdit_2 = QtWidgets.QLineEdit(imgur_client_dialog) self.lineEdit_2.setObjectName("lineEdit_2") self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.lineEdit_2) self.label_2 = QtWidgets.QLabel(imgur_client_dialog) font = QtGui.QFont() font.setPointSize(10) self.label_2.setFont(font) self.label_2.setObjectName("label_2") self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_2) self.gridLayout.addLayout(self.formLayout, 0, 0, 1, 2) self.retranslateUi(imgur_client_dialog) self.buttonBox.accepted.connect(imgur_client_dialog.accept) self.buttonBox.rejected.connect(imgur_client_dialog.reject) QtCore.QMetaObject.connectSlotsByName(imgur_client_dialog)
def setupUi(self, DialogMessageType): DialogMessageType.setObjectName("DialogMessageType") DialogMessageType.resize(471, 359) self.gridLayout = QtWidgets.QGridLayout(DialogMessageType) self.gridLayout.setObjectName("gridLayout") self.rbAssignManually = QtWidgets.QRadioButton(DialogMessageType) self.rbAssignManually.setObjectName("rbAssignManually") self.gridLayout.addWidget(self.rbAssignManually, 0, 0, 1, 1) self.rbAssignAutomatically = QtWidgets.QRadioButton(DialogMessageType) self.rbAssignAutomatically.setObjectName("rbAssignAutomatically") self.gridLayout.addWidget(self.rbAssignAutomatically, 0, 1, 1, 1) self.cbRulesetMode = QtWidgets.QComboBox(DialogMessageType) self.cbRulesetMode.setObjectName("cbRulesetMode") self.cbRulesetMode.addItem("") self.cbRulesetMode.addItem("") self.cbRulesetMode.addItem("") self.gridLayout.addWidget(self.cbRulesetMode, 1, 0, 1, 2) self.tblViewRuleset = QtWidgets.QTableView(DialogMessageType) self.tblViewRuleset.setObjectName("tblViewRuleset") self.gridLayout.addWidget(self.tblViewRuleset, 2, 0, 3, 2) self.btnAddRule = QtWidgets.QToolButton(DialogMessageType) icon = QtGui.QIcon.fromTheme("list-add") self.btnAddRule.setIcon(icon) self.btnAddRule.setObjectName("btnAddRule") self.gridLayout.addWidget(self.btnAddRule, 2, 2, 1, 1) self.btnRemoveRule = QtWidgets.QToolButton(DialogMessageType) icon = QtGui.QIcon.fromTheme("list-remove") self.btnRemoveRule.setIcon(icon) self.btnRemoveRule.setObjectName("btnRemoveRule") self.gridLayout.addWidget(self.btnRemoveRule, 3, 2, 1, 1) spacerItem = QtWidgets.QSpacerItem(20, 145, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem, 4, 2, 1, 1) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.btnSaveAndApply = QtWidgets.QPushButton(DialogMessageType) self.btnSaveAndApply.setObjectName("btnSaveAndApply") self.horizontalLayout.addWidget(self.btnSaveAndApply) self.btnClose = QtWidgets.QPushButton(DialogMessageType) self.btnClose.setObjectName("btnClose") self.horizontalLayout.addWidget(self.btnClose) self.gridLayout.addLayout(self.horizontalLayout, 5, 0, 1, 2) self.retranslateUi(DialogMessageType) QtCore.QMetaObject.connectSlotsByName(DialogMessageType)