Python PyQt5.QtWidgets.QToolButton() Examples

The following are 30 code examples for showing how to use PyQt5.QtWidgets.QToolButton(). These examples are extracted from open source projects. 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 check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module PyQt5.QtWidgets , or try the search function .

Example 1
Project: idasec   Author: RobinDavid   File: custom_widgets.py    License: GNU Lesser General Public License v2.1 6 votes vote down vote up
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) 
Example 2
Project: Lector   Author: BasioMeusPuga   File: dockwidgets.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent):
        self.parent = parent
        self.parentTab = self.parent.parent

        self.searchThread = BackGroundTextSearch()
        self.searchOptionsLayout = QtWidgets.QHBoxLayout()
        self.searchTabLayout = QtWidgets.QVBoxLayout()
        self.searchTimer = QtCore.QTimer(self.parent)
        self.searchLineEdit = QtWidgets.QLineEdit(self.parent)
        self.searchBookButton = QtWidgets.QToolButton(self.parent)
        self.caseSensitiveSearchButton = QtWidgets.QToolButton(self.parent)
        self.matchWholeWordButton = QtWidgets.QToolButton(self.parent)
        self.searchResultsTreeView = QtWidgets.QTreeView(self.parent)

        self._translate = QtCore.QCoreApplication.translate
        self.search_string = self._translate('SideDock', 'Search')
        self.search_book_string = self._translate('SideDock', 'Search entire book')
        self.case_sensitive_string = self._translate('SideDock', 'Match case')
        self.match_word_string = self._translate('SideDock', 'Match word')

        self.create_widgets() 
Example 3
Project: pychemqt   Author: jjgomera   File: widgets.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None):
        super(DragButton, self).__init__(parent)

    # def mouseMoveEvent(self, event):
        # self.startDrag()
        # QtWidgets.QToolButton.mouseMoveEvent(self, event)

    # def startDrag(self):
        # if self.icon().isNull():
        #     return
        # data = QtCore.QByteArray()
        # stream = QtCore.QDataStream(data, QtCore.QIODevice.WriteOnly)
        # stream << self.icon()
        # mimeData = QtCore.QMimeData()
        # mimeData.setData("application/x-equipment", data)
        # drag = QtGui.QDrag(self)
        # drag.setMimeData(mimeData)
        # pixmap = self.icon().pixmap(24, 24)
        # drag.setHotSpot(QtCore.QPoint(12, 12))
        # drag.setPixmap(pixmap)
        # drag.exec_(QtCore.Qt.CopyAction) 
Example 4
Project: peakonly   Author: Arseha   File: auxilary_utils.py    License: MIT License 6 votes vote down vote up
def __init__(self, default_directory='', parent=None):
        super().__init__(parent)

        button = QtWidgets.QToolButton()
        button.setText('...')
        button.clicked.connect(self.set_folder)

        if not default_directory:
            default_directory = os.getcwd()
        self.lineEdit = QtWidgets.QToolButton()
        self.lineEdit.setText(default_directory)

        layout = QtWidgets.QHBoxLayout()
        layout.addWidget(self.lineEdit, 85)
        layout.addWidget(button, 15)

        self.setLayout(layout) 
Example 5
Project: peakonly   Author: Arseha   File: auxilary_utils.py    License: MIT License 6 votes vote down vote up
def __init__(self, label, parent=None):
        super().__init__(parent)

        button = QtWidgets.QToolButton()
        button.setText('...')
        button.clicked.connect(self.add_folder)

        self.lineEdit = QtWidgets.QToolButton()
        self.lineEdit.setText(label)

        folder_getter_layout = QtWidgets.QHBoxLayout()
        folder_getter_layout.addWidget(self.lineEdit, 85)
        folder_getter_layout.addWidget(button, 15)

        self.list_widget = QtWidgets.QListWidget()
        self.list_widget.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)

        main_layout = QtWidgets.QVBoxLayout()
        main_layout.addLayout(folder_getter_layout)
        main_layout.addWidget(self.list_widget)

        self.setLayout(main_layout) 
Example 6
Project: peakonly   Author: Arseha   File: auxilary_utils.py    License: MIT License 6 votes vote down vote up
def __init__(self, extension, default_file, parent):
        super().__init__(parent)

        self.extension = extension

        button = QtWidgets.QToolButton()
        button.setText('...')
        button.clicked.connect(self.set_file)

        self.lineEdit = QtWidgets.QToolButton()
        self.lineEdit.setText(default_file)

        layout = QtWidgets.QHBoxLayout()
        layout.addWidget(self.lineEdit, 85)
        layout.addWidget(button, 15)

        self.setLayout(layout) 
Example 7
Project: guppy-proxy   Author: roglew   File: reqview.py    License: MIT License 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        QWidget.__init__(self, *args, **kwargs)
        self.setLayout(QVBoxLayout())
        self.taglist = TagList()
        self.taglist.tagsUpdated.connect(self.tagsUpdated)
        self.layout().addWidget(self.taglist)

        self.taginput = QLineEdit()
        self.taginput.returnPressed.connect(self.add_tag)
        self.addbutton = QToolButton()
        self.addbutton.setText("+")
        self.removebutton = QToolButton()
        self.removebutton.setText("-")
        editbar = QHBoxLayout()
        editbar.addWidget(self.addbutton)
        editbar.addWidget(self.removebutton)
        editbar.addWidget(self.taginput)

        self.removebutton.clicked.connect(self.taglist.delete_selected)
        self.addbutton.clicked.connect(self.add_tag)

        self.layout().addLayout(editbar) 
Example 8
Project: guppy-proxy   Author: roglew   File: reqlist.py    License: MIT License 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        QWidget.__init__(self, *args, **kwargs)
        self.str2_shown = False
        self.str1 = StringCmpWidget()
        self.str2 = StringCmpWidget()
        self.str1.returnPressed.connect(self.returnPressed)
        self.str2.returnPressed.connect(self.returnPressed)
        self.toggle_button = QToolButton()
        self.toggle_button.setText("+")

        self.toggle_button.clicked.connect(self._show_hide_str2)

        layout = QHBoxLayout()
        layout.addWidget(self.str1)
        layout.addWidget(self.str2)
        layout.addWidget(self.toggle_button)

        self.str2.setVisible(self.str2_shown)
        self.setLayout(layout)
        self.layout().setContentsMargins(0, 0, 0, 0) 
Example 9
Project: guppy-proxy   Author: roglew   File: reqlist.py    License: MIT License 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        QWidget.__init__(self, *args, **kwargs)
        self.current_entry = 0
        self.max_entries = 2
        self.text_entry = TextFilterEntry()
        dropdown_entry = DropdownFilterEntry()

        self.text_entry.filterEntered.connect(self.filterEntered)
        dropdown_entry.filterEntered.connect(self.filterEntered)

        self.entry_layout = QStackedLayout()
        self.entry_layout.addWidget(dropdown_entry)
        self.entry_layout.addWidget(self.text_entry)

        swap_button = QToolButton()
        swap_button.setText(">")
        swap_button.setToolTip("Switch between dropdown and text entry")
        swap_button.clicked.connect(self.next_entry)

        hlayout = QHBoxLayout()
        hlayout.addWidget(swap_button)
        hlayout.addLayout(self.entry_layout)
        self.setLayout(hlayout)
        self.layout().setContentsMargins(0, 0, 0, 0)
        self.layout().setSpacing(0) 
Example 10
Project: pandasgui   Author: adamerose   File: find_toolbar.py    License: MIT License 6 votes vote down vote up
def add_button(self, button):
        '''
        Adds a button to the right side of the QLineEdit.

        Args:
            button: Type QtWidgets.QPushButton or QtWidgets.QToolButton
        '''
        self.buttons.append(button)

        # makes sure text doesn't type behind the buttons
        totalWidth = sum([b.sizeHint().width() for b in self.buttons])
        frameWidth = self.style().pixelMetric(QtWidgets.QStyle.PM_DefaultFrameWidth)
        right_padding = int(totalWidth + frameWidth + 1)
        self.setStyleSheet(f'QLineEdit {{padding-right: {right_padding}px; }}')

        # makes sure the typing area doesn't get too small if toolbar is shrunk.
        maxHeight = max([b.sizeHint().height() for b in self.buttons])
        self.setMinimumSize(max(self.minimumSizeHint().width(), totalWidth + frameWidth * 2 + 2),
                            max(self.minimumSizeHint().height(), maxHeight + frameWidth * 2 + 2)) 
Example 11
Project: dunya-desktop   Author: MTG   File: combobox.py    License: GNU General Public License v3.0 5 votes vote down vote up
def _set_cancel_button(self):
        self.cancel_button = QToolButton(self)
        self.cancel_button.setIcon(QIcon(ICON_PATH_CANCEL))
        self.cancel_button.setVisible(False) 
Example 12
Project: kite   Author: pyrocko   File: sources_dock.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, sandbox, parent=None):
        QtWidgets.QToolButton.__init__(self, parent)

        menu = self.SourcesAddMenu(sandbox, self, 'Availables sources')

        self.setText('Add Source')
        self.setMenu(menu)

        self.setIcon(self.style().standardIcon(
                     QtGui.QStyle.SP_FileDialogDetailedView))
        self.setPopupMode(QtGui.QToolButton.InstantPopup)
        self.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly) 
Example 13
Project: execution-trace-viewer   Author: teemu-l   File: pagination_widget.py    License: MIT License 5 votes vote down vote up
def init_ui(self):
        layout = QHBoxLayout(self)

        self.first_page_btn = QToolButton(self)
        self.first_page_btn.clicked.connect(self._on_first_page_btn_clicked)
        self.first_page_btn.setArrowType(Qt.LeftArrow)
        self.first_page_btn.setToolTip("First page")
        layout.addWidget(self.first_page_btn)

        self.prev_page_btn = QToolButton(self)
        self.prev_page_btn.clicked.connect(self._on_prev_page_btn_clicked)
        self.prev_page_btn.setArrowType(Qt.LeftArrow)
        self.prev_page_btn.setToolTip("Previous page")
        layout.addWidget(self.prev_page_btn)

        self.page_edit = QLineEdit("1")
        self.page_edit.setMaximumSize(45, 24)
        self.page_edit.returnPressed.connect(
            lambda: self.set_current_page(self.page_edit.text())
        )
        layout.addWidget(self.page_edit)

        self.next_page_btn = QToolButton(self)
        self.next_page_btn.clicked.connect(self._on_next_page_btn_clicked)
        self.next_page_btn.setArrowType(Qt.RightArrow)
        self.next_page_btn.setToolTip("Next page")
        layout.addWidget(self.next_page_btn)

        self.last_page_btn = QToolButton(self)
        self.last_page_btn.clicked.connect(self._on_last_page_btn_clicked)
        self.last_page_btn.setArrowType(Qt.RightArrow)
        self.last_page_btn.setToolTip("Last page")
        layout.addWidget(self.last_page_btn)

        self.status_label = QLabel("")
        layout.addWidget(self.status_label) 
Example 14
Project: pychemqt   Author: jjgomera   File: widgets.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, color="#ffffff", alpha=255, isAlpha=False, parent=None):
        super(ColorSelector, self).__init__(parent)

        lyt = QtWidgets.QHBoxLayout(self)
        lyt.setContentsMargins(0, 0, 0, 0)
        lyt.setSpacing(0)

        self.RGB = QtWidgets.QLineEdit()
        self.RGB.editingFinished.connect(self.rgbChanged)
        self.RGB.setFixedSize(80, 24)
        lyt.addWidget(self.RGB)
        self.button = QtWidgets.QToolButton()
        self.button.setFixedSize(24, 24)
        self.button.clicked.connect(self.ColorButtonClicked)
        lyt.addWidget(self.button)
        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Fixed))

        if isAlpha:
            self.isAlpha = QtGui.QColor.HexArgb
        else:
            self.isAlpha = QtGui.QColor.HexRgb

        r = int(color[1:3], 16)
        g = int(color[3:5], 16)
        b = int(color[5:7], 16)
        color = QtGui.QColor(r, g, b, alpha)
        self.setColor(color) 
Example 15
Project: pychemqt   Author: jjgomera   File: widgets.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, text="", font=None, color="#000000", parent=None):
        """
        text: Initial txt for widget
        font: QFont instance to initialize widget
        color: Inicial color to widget, in code #rrggbb
        """
        super(InputFont, self).__init__(parent)

        layout = QtWidgets.QHBoxLayout(self)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)

        self.lineEdit = QtWidgets.QLineEdit()
        self.lineEdit.setSizePolicy(
            QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
        layout.addWidget(self.lineEdit)
        self.fontButton = QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(
            os.environ["pychemqt"] +
            os.path.join("images", "button", "font.png"))), "")
        self.fontButton.setFixedSize(24, 24)
        self.fontButton.setIconSize(QtCore.QSize(24, 24))
        self.fontButton.clicked.connect(self.fontButtonClicked)
        layout.addWidget(self.fontButton)
        self.colorButton = QtWidgets.QToolButton()
        self.colorButton.setFixedSize(24, 24)
        self.colorButton.clicked.connect(self.colorButtonClicked)
        layout.addWidget(self.colorButton)

        self.font = font
        self.setRGB(color)
        self.setText(text)
        self.lineEdit.textChanged.connect(self.textChanged.emit) 
Example 16
Project: pychemqt   Author: jjgomera   File: costIndex.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, equipment, parent=None):
        """constructor
        equipment: equipment class where the widget have to be put, define
        indiceCostos as a index in costIndex"""
        super(CostData, self).__init__(parent)
        self.indice = equipment.indiceCostos
        factor = equipment.kwargs["f_install"]
        gridLayout = QtWidgets.QGridLayout(self)
        gridLayout.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 1, 0, 1, 7)
        gridLayout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Instalation factor:")), 2, 0, 1, 1)
        self.factorInstalacion = Entrada_con_unidades(
            float, spinbox=True, decimales=1, step=0.1, width=50, value=factor)
        self.factorInstalacion.valueChanged.connect(partial(
            self.valueChanged.emit, "f_install"))
        gridLayout.addWidget(self.factorInstalacion, 2, 1, 1, 1)
        gridLayout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Base index:")), 2, 4, 1, 1)
        self.indiceBase = Entrada_con_unidades(
            float, readOnly=True, value=indiceBase[self.indice], decimales=1)
        gridLayout.addWidget(self.indiceBase, 2, 5, 1, 1)
        gridLayout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Current index:")), 3, 4, 1, 1)
        self.indiceActual = Entrada_con_unidades(
            float, readOnly=True, colorReadOnly="white",
            value=indiceActual[self.indice], decimales=1)
        gridLayout.addWidget(self.indiceActual, 3, 5, 1, 1)
        self.costIndex = QtWidgets.QToolButton()
        self.costIndex.setFixedSize(QtCore.QSize(24, 24))
        self.costIndex.clicked.connect(self.on_costIndex_clicked)
        self.costIndex.setText("...")
        self.costIndex.setVisible(False)
        gridLayout.addWidget(self.costIndex, 3, 5, 1, 1)
        gridLayout.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 4, 0, 1, 7) 
Example 17
Project: eddy   Author: danielepantaleone   File: session.py    License: GNU General Public License v3.0 5 votes vote down vote up
def initWidgets(self):
        """
        Configure application built-in widgets.
        """
        button = QtWidgets.QToolButton(objectName='button_set_brush')
        button.setIcon(QtGui.QIcon(':/icons/24/ic_format_color_fill_black'))
        button.setMenu(self.menu('brush'))
        button.setPopupMode(QtWidgets.QToolButton.InstantPopup)
        button.setStatusTip('Change the background color of the selected predicate nodes')
        button.setEnabled(False)
        self.addWidget(button)

        combobox = ComboBox(objectName='profile_switch')
        combobox.setEditable(False)
        combobox.setFont(Font('Roboto', 12))
        combobox.setFocusPolicy(QtCore.Qt.StrongFocus)
        combobox.setScrollEnabled(False)
        combobox.setStatusTip('Change the profile of the active project')
        combobox.addItems(self.profileNames())
        connect(combobox.activated, self.doSetProfile)
        self.addWidget(combobox)

        progressBar = QtWidgets.QProgressBar(objectName='progress_bar')
        progressBar.setContentsMargins(0, 0, 0, 0)
        progressBar.setFixedSize(222, 14)
        progressBar.setRange(0, 0)
        progressBar.setVisible(False)
        self.addWidget(progressBar)

    #############################################
    #   SLOTS
    ################################# 
Example 18
Project: eddy   Author: danielepantaleone   File: zoom.py    License: GNU General Public License v3.0 5 votes vote down vote up
def start(self):
        """
        Perform initialization tasks for the plugin.
        """
        # INITIALIZE THE WIDGETS
        self.debug('Creating zoom control widgets')

        self.addWidget(QtWidgets.QToolButton(
            icon=QtGui.QIcon(':/icons/24/ic_zoom_in_black'),
            enabled=False, checkable=False, clicked=self.doZoomIn,
            objectName='button_zoom_in'))
        self.addWidget(QtWidgets.QToolButton(
            icon=QtGui.QIcon(':/icons/24/ic_zoom_out_black'),
            enabled=False, checkable=False, clicked=self.doZoomOut,
            objectName='button_zoom_out'))
        self.addWidget(QtWidgets.QToolButton(
            icon=QtGui.QIcon(':/icons/24/ic_zoom_reset_black'),
            enabled=False, checkable=False, clicked=self.doZoomReset,
            objectName='button_zoom_reset'))

        # CONFIGURE SIGNALS/SLOTS
        self.debug('Configuring session and MDI area specific signals/slots')
        connect(self.session.mdi.subWindowActivated, self.onSubWindowActivated)
        connect(self.session.sgnUpdateState, self.doUpdateState)

        # CREATE VIEW TOOLBAR BUTTONS
        self.debug('Installing zoom controls in "view" toolbar')
        self.afwset.add(self.session.widget('view_toolbar').addSeparator())
        self.afwset.add(self.session.widget('view_toolbar').addWidget(self.widget('button_zoom_out')))
        self.afwset.add(self.session.widget('view_toolbar').addWidget(self.widget('button_zoom_in')))
        self.afwset.add(self.session.widget('view_toolbar').addWidget(self.widget('button_zoom_reset'))) 
Example 19
Project: guppy-proxy   Author: roglew   File: settings.py    License: MIT License 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        QWidget.__init__(self, *args, **kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setContentsMargins(0, 0, 0, 0)
        self.listenerlist = ListenerList()
        self.listenerlist.listenersUpdated.connect(self.listenersUpdated)
        self.layout().addWidget(self.listenerlist)

        self.hostinput = QLineEdit()
        self.hostinput.setText("127.0.0.1")
        self.hostinput.returnPressed.connect(self.add_listener)
        self.portinput = QLineEdit()
        self.portinput.setMaxLength(5)
        self.portinput.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred)
        self.portinput.returnPressed.connect(self.add_listener)
        self.addbutton = QToolButton()
        self.addbutton.setText("+")
        self.removebutton = QToolButton()
        self.removebutton.setText("-")
        editbar = QHBoxLayout()
        editbar.addWidget(self.addbutton)
        editbar.addWidget(self.removebutton)
        editbar.addWidget(QLabel("Interface:"))
        editbar.addWidget(self.hostinput)
        editbar.addWidget(QLabel("Port:"))
        editbar.addWidget(self.portinput)

        self.removebutton.clicked.connect(self.listenerlist.delete_selected)
        self.addbutton.clicked.connect(self.add_listener)

        self.layout().addLayout(editbar) 
Example 20
Project: guppy-proxy   Author: roglew   File: reqlist.py    License: MIT License 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        QWidget.__init__(self, *args, **kwargs)
        layout = QHBoxLayout()
        confirm = QToolButton()
        confirm.setText("OK")
        confirm.setToolTip("Apply the entered filter")
        self.field_entry = get_field_entry()

        # stack containing widgets for string, k/v, date, daterange
        self.str_cmp_entry = StringCmpWidget()
        self.kv_cmp_entry = StringKVWidget()
        self.inv_entry = QCheckBox("inv")
        # date
        # daterange

        self.entry_layout = QStackedLayout()
        self.entry_layout.setContentsMargins(0, 0, 0, 0)
        self.current_entry = 0
        self.entry_layout.addWidget(self.str_cmp_entry)
        self.entry_layout.addWidget(self.kv_cmp_entry)
        # add date # 2
        # add daterange # 3

        confirm.clicked.connect(self.confirm_entry)
        self.str_cmp_entry.returnPressed.connect(self.confirm_entry)
        self.kv_cmp_entry.returnPressed.connect(self.confirm_entry)
        self.field_entry.currentIndexChanged.connect(self._display_value_widget)

        layout.addWidget(confirm)
        layout.addWidget(self.inv_entry)
        layout.addWidget(self.field_entry)
        layout.addLayout(self.entry_layout)

        self.setLayout(layout)
        self.setContentsMargins(0, 0, 0, 0)
        self._display_value_widget() 
Example 21
Project: PhyloSuite   Author: dongzhang0725   File: Ui_popUp.py    License: GNU General Public License v3.0 5 votes vote down vote up
def setupUi(self, pop):
        pop.setObjectName("pop")
        pop.resize(442, 379)
        self.gridLayout = QtWidgets.QGridLayout(pop)
        self.gridLayout.setObjectName("gridLayout")
        self.textEdit = QtWidgets.QTextEdit(pop)
        self.textEdit.setObjectName("textEdit")
        self.gridLayout.addWidget(self.textEdit, 1, 0, 1, 2)
        self.pushButton = QtWidgets.QPushButton(pop)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/picture/resourses/btn_ok.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.pushButton.setIcon(icon)
        self.pushButton.setObjectName("pushButton")
        self.gridLayout.addWidget(self.pushButton, 2, 0, 1, 1)
        self.pushButton_2 = QtWidgets.QPushButton(pop)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/picture/resourses/if_Delete_1493279.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.pushButton_2.setIcon(icon1)
        self.pushButton_2.setObjectName("pushButton_2")
        self.gridLayout.addWidget(self.pushButton_2, 2, 1, 1, 1)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.label = QtWidgets.QLabel(pop)
        self.label.setObjectName("label")
        self.horizontalLayout_2.addWidget(self.label)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.toolButton = QtWidgets.QToolButton(pop)
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(":/picture/resourses/interface-controls-text-wrap-512.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButton.setIcon(icon2)
        self.toolButton.setCheckable(True)
        self.toolButton.setObjectName("toolButton")
        self.horizontalLayout_2.addWidget(self.toolButton)
        self.gridLayout.addLayout(self.horizontalLayout_2, 0, 0, 1, 2)

        self.retranslateUi(pop)
        QtCore.QMetaObject.connectSlotsByName(pop) 
Example 22
Project: urh   Author: jopohl   File: ui_messagetype_options.py    License: GNU General Public License v3.0 5 votes vote down vote up
def setupUi(self, DialogMessageType):
        DialogMessageType.setObjectName("DialogMessageType")
        DialogMessageType.resize(471, 359)
        self.gridLayout = QtWidgets.QGridLayout(DialogMessageType)
        self.gridLayout.setObjectName("gridLayout")
        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.setShowGrid(False)
        self.tblViewRuleset.setObjectName("tblViewRuleset")
        self.gridLayout.addWidget(self.tblViewRuleset, 2, 0, 3, 2)
        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)
        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)
        spacerItem = QtWidgets.QSpacerItem(20, 145, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 4, 2, 1, 1)
        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.buttonBox = QtWidgets.QDialogButtonBox(DialogMessageType)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 2)

        self.retranslateUi(DialogMessageType) 
Example 23
Project: asammdf   Author: danielhrisca   File: collapsiblebox.py    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
def __init__(self, title="", parent=None):
        super(CollapsibleBox, self).__init__(parent)

        self.toggle_button = QtWidgets.QToolButton(
            text=title, checkable=True, checked=False
        )
        self.toggle_button.setStyleSheet("QToolButton { border: none; }")
        self.toggle_button.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
        self.toggle_button.setArrowType(QtCore.Qt.RightArrow)
        self.toggle_button.pressed.connect(self.on_pressed)

        self.toggle_animation = QtCore.QParallelAnimationGroup(self)

        self.content_area = QtWidgets.QScrollArea(maximumHeight=0, minimumHeight=0)
        self.content_area.setSizePolicy(
            QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed
        )
        self.content_area.setFrameShape(QtWidgets.QFrame.NoFrame)

        lay = QtWidgets.QVBoxLayout(self)
        lay.setSpacing(0)
        lay.setContentsMargins(0, 0, 0, 0)
        lay.addWidget(self.toggle_button)
        lay.addWidget(self.content_area)

        self.toggle_animation.addAnimation(
            QtCore.QPropertyAnimation(self, b"minimumHeight")
        )
        self.toggle_animation.addAnimation(
            QtCore.QPropertyAnimation(self, b"maximumHeight")
        )
        self.toggle_animation.addAnimation(
            QtCore.QPropertyAnimation(self.content_area, b"maximumHeight")
        ) 
Example 24
Project: dash-masternode-tool   Author: Bertrand256   File: ui_columns_cfg_dlg.py    License: MIT License 4 votes vote down vote up
def setupUi(self, ColumnsConfigDlg):
        ColumnsConfigDlg.setObjectName("ColumnsConfigDlg")
        ColumnsConfigDlg.resize(262, 412)
        self.verticalLayout = QtWidgets.QVBoxLayout(ColumnsConfigDlg)
        self.verticalLayout.setContentsMargins(8, 8, 8, 8)
        self.verticalLayout.setSpacing(8)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setSpacing(3)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.tableWidget = QtWidgets.QTableWidget(ColumnsConfigDlg)
        self.tableWidget.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
        self.tableWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
        self.tableWidget.setObjectName("tableWidget")
        self.tableWidget.setColumnCount(1)
        self.tableWidget.setRowCount(0)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(0, item)
        self.tableWidget.horizontalHeader().setVisible(False)
        self.tableWidget.horizontalHeader().setStretchLastSection(True)
        self.horizontalLayout.addWidget(self.tableWidget)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.btnMoveBegin = QtWidgets.QToolButton(ColumnsConfigDlg)
        self.btnMoveBegin.setText("")
        self.btnMoveBegin.setObjectName("btnMoveBegin")
        self.verticalLayout_2.addWidget(self.btnMoveBegin)
        self.btnMoveUp = QtWidgets.QToolButton(ColumnsConfigDlg)
        self.btnMoveUp.setText("")
        self.btnMoveUp.setObjectName("btnMoveUp")
        self.verticalLayout_2.addWidget(self.btnMoveUp)
        self.btnMoveDown = QtWidgets.QToolButton(ColumnsConfigDlg)
        self.btnMoveDown.setText("")
        self.btnMoveDown.setObjectName("btnMoveDown")
        self.verticalLayout_2.addWidget(self.btnMoveDown)
        self.btnMoveEnd = QtWidgets.QToolButton(ColumnsConfigDlg)
        self.btnMoveEnd.setText("")
        self.btnMoveEnd.setObjectName("btnMoveEnd")
        self.verticalLayout_2.addWidget(self.btnMoveEnd)
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_2.addItem(spacerItem)
        self.horizontalLayout.addLayout(self.verticalLayout_2)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.buttonBox = QtWidgets.QDialogButtonBox(ColumnsConfigDlg)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(ColumnsConfigDlg)
        self.buttonBox.accepted.connect(ColumnsConfigDlg.accept)
        self.buttonBox.rejected.connect(ColumnsConfigDlg.reject)
        QtCore.QMetaObject.connectSlotsByName(ColumnsConfigDlg) 
Example 25
Project: dash-masternode-tool   Author: Bertrand256   File: ui_wallet_dlg_options1.py    License: MIT License 4 votes vote down vote up
def setupUi(self, WdgOptions1):
        WdgOptions1.setObjectName("WdgOptions1")
        WdgOptions1.resize(243, 76)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(WdgOptions1.sizePolicy().hasHeightForWidth())
        WdgOptions1.setSizePolicy(sizePolicy)
        WdgOptions1.setStyleSheet("")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(WdgOptions1)
        self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_2.setSpacing(0)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.frame = QtWidgets.QFrame(WdgOptions1)
        self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame.setObjectName("frame")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.frame)
        self.verticalLayout.setContentsMargins(6, 6, 6, 6)
        self.verticalLayout.setSpacing(6)
        self.verticalLayout.setObjectName("verticalLayout")
        self.chbShowAddresses = QtWidgets.QCheckBox(self.frame)
        self.chbShowAddresses.setObjectName("chbShowAddresses")
        self.verticalLayout.addWidget(self.chbShowAddresses)
        self.chbShowZeroBalanceAddresses = QtWidgets.QCheckBox(self.frame)
        self.chbShowZeroBalanceAddresses.setObjectName("chbShowZeroBalanceAddresses")
        self.verticalLayout.addWidget(self.chbShowZeroBalanceAddresses)
        self.chbShowNotUsedAddresses = QtWidgets.QCheckBox(self.frame)
        self.chbShowNotUsedAddresses.setObjectName("chbShowNotUsedAddresses")
        self.verticalLayout.addWidget(self.chbShowNotUsedAddresses)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setSpacing(0)
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.btnApply = QtWidgets.QToolButton(self.frame)
        self.btnApply.setObjectName("btnApply")
        self.horizontalLayout.addWidget(self.btnApply)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.horizontalLayout_2.addWidget(self.frame)

        self.retranslateUi(WdgOptions1)
        QtCore.QMetaObject.connectSlotsByName(WdgOptions1) 
Example 26
Project: EpubMerge   Author: JimmXinu   File: dialogs.py    License: GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, gui, header, prefs, icon, books,
                 save_size_name='epubmerge:update list dialog'):
        SizePersistedDialog.__init__(self, gui, save_size_name)
        self.gui = gui

        self.setWindowTitle(header)
        self.setWindowIcon(icon)

        layout = QVBoxLayout(self)
        self.setLayout(layout)
        title_layout = ImageTitleLayout(self, 'images/icon.png',
                                        header)
        layout.addLayout(title_layout)
        books_layout = QHBoxLayout()
        layout.addLayout(books_layout)

        self.books_table = StoryListTableWidget(self)
        books_layout.addWidget(self.books_table)

        button_layout = QVBoxLayout()
        books_layout.addLayout(button_layout)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        button_layout.addItem(spacerItem)
        self.move_up_button = QtGui.QToolButton(self)
        self.move_up_button.setToolTip(_('Move selected books up the list'))
        self.move_up_button.setIcon(QIcon(I('arrow-up.png')))
        self.move_up_button.clicked.connect(self.books_table.move_rows_up)
        button_layout.addWidget(self.move_up_button)
        self.remove_button = QtGui.QToolButton(self)
        self.remove_button.setToolTip(_('Remove selected books from the list'))
        self.remove_button.setIcon(get_icon('list_remove.png'))
        self.remove_button.clicked.connect(self.remove_from_list)
        button_layout.addWidget(self.remove_button)
        self.move_down_button = QtGui.QToolButton(self)
        self.move_down_button.setToolTip(_('Move selected books down the list'))
        self.move_down_button.setIcon(QIcon(I('arrow-down.png')))
        self.move_down_button.clicked.connect(self.books_table.move_rows_down)
        button_layout.addWidget(self.move_down_button)
        spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        button_layout.addItem(spacerItem1)

        options_layout = QHBoxLayout()

        button_box = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        button_box.accepted.connect(self.accept)
        button_box.rejected.connect(self.reject)
        options_layout.addWidget(button_box)

        layout.addLayout(options_layout)

        # Cause our dialog size to be restored from prefs or created on first usage
        self.resize_dialog()
        self.books_table.populate_table(books) 
Example 27
Project: pychemqt   Author: jjgomera   File: UI_psychrometry.py    License: GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, parent=None):
        super(UI_Psychrometry, self).__init__(parent)
        self.setWindowTitle(QtWidgets.QApplication.translate(
            "pychemqt", "Psychrometric chart"))
        self.setWindowIcon(QtGui.QIcon(QtGui.QPixmap(
            os.environ["pychemqt"] + "/images/button/psychrometric.png")))
        self.showMaximized()

        layout = QtWidgets.QGridLayout(self)
        self.plt = PsychroPlot(self, width=100, height=1, dpi=90)
        self.plt.fig.canvas.mpl_connect('button_press_event', self.click)
        layout.addWidget(self.plt, 1, 3, 2, 2)

        self.inputs = PsychroInput()
        self.inputs.stateChanged.connect(self.plt.createCrux)
        self.inputs.pressureChanged.connect(self.plot)
        layout.addWidget(self.inputs, 1, 1, 1, 1)
        layout.addItem(QtWidgets.QSpacerItem(
            10, 10, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 2, 1)

        self.buttonShowToolbox = QtWidgets.QToolButton()
        self.buttonShowToolbox.setCheckable(True)
        self.buttonShowToolbox.toggled.connect(self.showToolBar)
        layout.addWidget(self.buttonShowToolbox, 1, 2, 2, 1)
        self.line = QtWidgets.QFrame()
        self.line.setFrameShape(QtWidgets.QFrame.VLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        layout.addWidget(self.line, 1, 3, 3, 1)

        self.progressBar = QtWidgets.QProgressBar()
        self.progressBar.setVisible(False)
        layout.addWidget(self.progressBar, 3, 3)
        self.status = QtWidgets.QLabel()
        layout.addWidget(self.status, 3, 3)

        btBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Close)
        butonPNG = QtWidgets.QPushButton(QtGui.QIcon(
            os.environ["pychemqt"] +
            os.path.join("images", "button", "image.png")),
            QtWidgets.QApplication.translate("pychemqt", "Save as PNG"))
        butonPNG.clicked.connect(self.plt.savePNG)
        butonConfig = QtWidgets.QPushButton(QtGui.QIcon(
            os.environ["pychemqt"] +
            os.path.join("images", "button", "configure.png")),
            QtWidgets.QApplication.translate("pychemqt", "Configure"))
        butonConfig.clicked.connect(self.configure)
        btBox.rejected.connect(self.reject)
        layout.addWidget(btBox, 3, 4)
        btBox.layout().insertWidget(0, butonPNG)
        btBox.layout().insertWidget(0, butonConfig)

        self.showToolBar(False)
        self.Preferences = ConfigParser()
        self.Preferences.read(conf_dir+"pychemqtrc")
        self.plot()
        logging.info(QtWidgets.QApplication.translate(
            "pychemqt", "Started psychrometric chart tool")) 
Example 28
Project: DownloaderForReddit   Author: MalloyDelacroix   File: AddRedditObjectDialog.py    License: GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, object_type, parent=None):
        """
        A dialog that opens to allow for the user to add a new reddit username to the username list. An instance of this
        class is also used as a dialog to add subreddits, but two object names are overwritten. This dialog is basically
        a standard input dialog, but with the addition of a third button that allows the user to add more than one name
        without closing the dialog.  Shortcut keys have also been added to facilitate ease of use
        """
        QtWidgets.QDialog.__init__(self, parent=parent)
        self.setupUi(self)
        self.logger = logging.getLogger('DownloaderForReddit.%s' % __name__)
        self.settings_manager = Injector.get_settings_manager()
        self.object_type = object_type
        self.layout_style = 'SINGLE'

        self.object_name_list_view = QtWidgets.QListView()
        self.object_name_list_view.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
        self.object_name_list_model = AddRedditObjectListModel(self.object_type, self)
        self.object_name_list_model.name_list_updated.connect(self.name_count_updated)
        self.object_name_list_view.setModel(self.object_name_list_model)

        self.name_count_label = QtWidgets.QLabel()
        self.add_to_list_button = QtWidgets.QToolButton()
        self.add_to_list_button.setText('+')
        self.add_to_list_button.clicked.connect(self.add_name_to_list)
        self.remove_from_list_button = QtWidgets.QToolButton()
        self.remove_from_list_button.setText('-')
        self.remove_from_list_button.clicked.connect(self.remove_name_from_list)
        self.button_layout = QtWidgets.QHBoxLayout()
        self.button_layout.addWidget(self.name_count_label)
        self.button_layout.addWidget(self.add_to_list_button)
        self.button_layout.addWidget(self.remove_from_list_button)
        self.list_layout = QtWidgets.QVBoxLayout()
        self.list_layout.addWidget(self.object_name_list_view)
        self.list_layout.addLayout(self.button_layout)

        self.name = None

        self.init_download_on_add_checkbox()
        self.download_on_add_checkbox.toggled.connect(self.toggle_download_on_add_checkbox)

        self.ok_cancel_button_box.accepted.connect(self.accept)
        self.ok_cancel_button_box.rejected.connect(self.close)

        self.object_name_line_edit.textChanged.connect(self.check_line_edit_text)

        self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.customContextMenuRequested.connect(lambda: self.show_context_menu(False))

        self.object_name_line_edit.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.object_name_line_edit.customContextMenuRequested.connect(lambda: self.show_context_menu(True)) 
Example 29
Project: DownloaderForReddit   Author: MalloyDelacroix   File: ImgurClientDialog_auto.py    License: GNU General Public License v3.0 4 votes vote down vote up
def setupUi(self, imgur_client_dialog):
        imgur_client_dialog.setObjectName("imgur_client_dialog")
        imgur_client_dialog.resize(412, 112)
        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.label_3 = QtWidgets.QLabel(imgur_client_dialog)
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_3)
        self.lineEdit_3 = QtWidgets.QLineEdit(imgur_client_dialog)
        self.lineEdit_3.setObjectName("lineEdit_3")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.lineEdit_3)
        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) 
Example 30
Project: DownloaderForReddit   Author: MalloyDelacroix   File: RedditAccoundDialog_auto.py    License: GNU General Public License v3.0 4 votes vote down vote up
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)