Python PySide2.QtWidgets.QLineEdit() Examples

The following are 24 code examples of PySide2.QtWidgets.QLineEdit(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PySide2.QtWidgets , or try the search function .
Example #1
Source File: widgets.py    From hotbox_designer with BSD 3-Clause Clear License 6 votes vote down vote up
def __init__(self, parent=None):
        super(BrowseEdit, self).__init__(parent)

        self.text = QtWidgets.QLineEdit()
        self.text.returnPressed.connect(self.apply)
        self.button = QtWidgets.QPushButton('B')
        self.button.setFixedSize(21, 21)
        self.button.released.connect(self.browse)

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

        self._value = self.value() 
Example #2
Source File: widgets.py    From hotbox_designer with BSD 3-Clause Clear License 6 votes vote down vote up
def __init__(self, parent=None):
        super(ColorEdit, self).__init__(parent)

        self.text = QtWidgets.QLineEdit()
        self.text.returnPressed.connect(self.apply)
        self.button = QtWidgets.QPushButton(icon('picker.png'), '')
        self.button.setFixedSize(21, 21)
        self.button.released.connect(self.pick_color)

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

        self._value = self.value() 
Example #3
Source File: manager.py    From hotbox_designer with BSD 3-Clause Clear License 6 votes vote down vote up
def __init__(self, parent=None):
        super(HotboxGeneralSettingWidget, self).__init__(parent)
        self.setFixedWidth(200)
        self.name = QtWidgets.QLineEdit()
        self.name.textEdited.connect(partial(self.optionSet.emit, 'name'))
        self.submenu = BoolCombo(False)
        self.submenu.valueSet.connect(partial(self.optionSet.emit, 'submenu'))
        self.triggering = QtWidgets.QComboBox()
        self.triggering.addItems(TRIGGERING_TYPES)
        self.triggering.currentIndexChanged.connect(self._triggering_changed)
        self.aiming = BoolCombo(False)
        self.aiming.valueSet.connect(partial(self.optionSet.emit, 'aiming'))
        self.leaveclose = BoolCombo(False)
        method = partial(self.optionSet.emit, 'leaveclose')
        self.leaveclose.valueSet.connect(method)

        self.open_command = CommandButton('show')
        self.close_command = CommandButton('hide')
        self.switch_command = CommandButton('switch')

        self.layout = QtWidgets.QFormLayout(self)
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.layout.setSpacing(0)
        self.layout.setHorizontalSpacing(5)
        self.layout.addRow(Title('Options'))
        self.layout.addItem(QtWidgets.QSpacerItem(0, 8))
        self.layout.addRow('name', self.name)
        self.layout.addItem(QtWidgets.QSpacerItem(0, 8))
        self.layout.addRow('is submenu', self.submenu)
        self.layout.addRow('triggering', self.triggering)
        self.layout.addRow('aiming', self.aiming)
        self.layout.addRow('close on leave', self.leaveclose)
        self.layout.addItem(QtWidgets.QSpacerItem(0, 8))
        self.layout.addRow(Title('Commands'))
        self.layout.addItem(QtWidgets.QSpacerItem(0, 8))
        self.layout.addRow(self.open_command)
        self.layout.addRow(self.close_command)
        self.layout.addRow(self.switch_command) 
Example #4
Source File: qdecomp_options.py    From angr-management with BSD 2-Clause "Simplified" License 6 votes vote down vote up
def _init_widgets(self):

        # search box
        self._search_box = QLineEdit()

        # tree view
        self._treewidget = QTreeWidget()
        self._treewidget.setHeaderHidden(True)

        # refresh button
        self._apply_btn = QPushButton("Apply")
        self._apply_btn.clicked.connect(self._code_view.decompile)

        layout = QVBoxLayout()
        layout.addWidget(self._search_box)
        layout.addWidget(self._treewidget)
        layout.addWidget(self._apply_btn)

        self.setLayout(layout) 
Example #5
Source File: twitter_dapp.py    From Hands-On-Blockchain-for-Python-Developers with MIT License 6 votes vote down vote up
def createTweetsGroupBox(self):
        self.tweets_group_box = QtWidgets.QGroupBox("Tweets")
        self.account_address = QtWidgets.QLineEdit()
        self.fetch_button = QtWidgets.QPushButton("Fetch")
        self.add_to_bookmark_button = QtWidgets.QPushButton("Bookmark it!")

        self.connect(self.fetch_button, QtCore.SIGNAL('clicked()'), self.fetchTweets)
        self.connect(self.add_to_bookmark_button, QtCore.SIGNAL('clicked()'), self.bookmarkAddress)

        account_address_layout = QtWidgets.QHBoxLayout()
        account_address_layout.addWidget(self.account_address)
        account_address_layout.addWidget(self.fetch_button)
        account_address_layout.addWidget(self.add_to_bookmark_button)

        self.tweets_layout = QtWidgets.QVBoxLayout()

        self.tweets_main_layout = QtWidgets.QVBoxLayout()
        self.tweets_main_layout.addWidget(QtWidgets.QLabel("Address:"))
        self.tweets_main_layout.addLayout(account_address_layout)
        self.tweets_main_layout.addSpacing(20)
        self.tweets_main_layout.addLayout(self.tweets_layout)
        self.tweets_group_box.setLayout(self.tweets_main_layout) 
Example #6
Source File: qdecomp_options.py    From angr-management with BSD 2-Clause "Simplified" License 6 votes vote down vote up
def __init__(self, code_view, instance, options=None, passes=None):
        super().__init__()

        self._code_view = code_view
        self._instance = instance
        self._options = options
        self._opti_passes = passes

        # widgets
        self._search_box = None  # type:QLineEdit
        self._treewidget = None  # type:QTreeWidget
        self._apply_btn = None  # type:QPushButton

        self._qoptions = [ ]
        self._qoptipasses = [ ]

        self._init_widgets()

        self.reload() 
Example #7
Source File: login_dialog_UI_pyside2.py    From anima with MIT License 5 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.setWindowModality(QtCore.Qt.ApplicationModal)
        Dialog.resize(364, 138)
        Dialog.setModal(True)
        self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.formLayout = QtWidgets.QFormLayout()
        self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout.setContentsMargins(-1, 10, -1, -1)
        self.formLayout.setObjectName("formLayout")
        self.login_or_email_label = QtWidgets.QLabel(Dialog)
        self.login_or_email_label.setObjectName("login_or_email_label")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.login_or_email_label)
        self.login_or_email_lineEdit = QtWidgets.QLineEdit(Dialog)
        self.login_or_email_lineEdit.setInputMask("")
        self.login_or_email_lineEdit.setObjectName("login_or_email_lineEdit")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.login_or_email_lineEdit)
        self.password_label = QtWidgets.QLabel(Dialog)
        self.password_label.setObjectName("password_label")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.password_label)
        self.password_lineEdit = QtWidgets.QLineEdit(Dialog)
        self.password_lineEdit.setInputMask("")
        self.password_lineEdit.setText("")
        self.password_lineEdit.setEchoMode(QtWidgets.QLineEdit.Password)
        self.password_lineEdit.setObjectName("password_lineEdit")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.password_lineEdit)
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.buttonBox)
        self.verticalLayout.addLayout(self.formLayout)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
Example #8
Source File: ui.py    From pylash_engine with MIT License 5 votes vote down vote up
def _onLineEditFocusOut(self, e):
		self.dispatchEvent(LineEditEvent.FOCUS_OUT)
		return QtWidgets.QLineEdit.focusOutEvent(self.lineEditWidget, e) 
Example #9
Source File: ui.py    From pylash_engine with MIT License 5 votes vote down vote up
def _onLineEditFocusIn(self, e):
		self.dispatchEvent(LineEditEvent.FOCUS_IN)
		return QtWidgets.QLineEdit.focusInEvent(self.lineEditWidget, e) 
Example #10
Source File: ui.py    From pylash_engine with MIT License 5 votes vote down vote up
def __init__(self, backgroundLayer = None):
		super(LineEdit, self).__init__()
		
		self.__font = "Arial"
		self.__size = 15
		self.__italic = False
		self.__weight = TextFormatWeight.NORMAL
		self.__preWidth = self.width
		self.__preHeight = self.height
		self.__preX = self.x
		self.__preY = self.y
		self.__preVisible = not self.visible
		self.__textColor = "black"
		self.__widgetFont = QtGui.QFont()
		self.__widgetPalette = QtGui.QPalette()
		self.lineEditWidget = QtWidgets.QLineEdit(stage.canvasWidget)
		self.backgroundLayer = backgroundLayer

		if not isinstance(self.backgroundLayer, DisplayObject):
			self.backgroundLayer = Sprite()
			self.backgroundLayer.graphics.beginFill("white")
			self.backgroundLayer.graphics.lineStyle(2, "gray")
			self.backgroundLayer.graphics.drawRect(0, 0, 200, 40)
			self.backgroundLayer.graphics.endFill()

		self.addChild(self.backgroundLayer)

		self.__initWidget()

		self.addEventListener(LoopEvent.ENTER_FRAME, self.__loop) 
Example #11
Source File: Dialog_text.py    From Sonoff_Devices_DIY_Tools with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def getText(self):
        """
        When the IP address cannot be automatically obtained by the user's computer,
        the IP address will be manually entered by the user to create the server
        :return: str The IP address entered by the user
        """
        text, okPressed = QInputDialog.getText(
            self, "not find ip ", "Your PC ip:", QLineEdit.Normal, "")
        if okPressed and text != '':
            print(text)
            return text 
Example #12
Source File: Dialog_text.py    From Sonoff_Devices_DIY_Tools with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, parent=None):
        super(myDialog, self).__init__(parent)
        # Sets the title and size of the dialog box
        self.setWindowTitle('myDialog')
        self.resize(200, 100)
        # Set the window to modal, and the user can only close the main
        # interface after closing the popover
        self.setWindowModality(Qt.ApplicationModal)
        # Table layout used to layout QLabel and QLineEdit and QSpinBox
        grid = QGridLayout()
        grid.addWidget(QLabel(u'SSID', parent=self), 0, 0, 1, 1)
        self.SSIDName = QLineEdit(parent=self)
        self.SSIDName.setText("wifi")
        grid.addWidget(self.SSIDName, 0, 1, 1, 1)
        grid.addWidget(QLabel(u'password', parent=self), 1, 0, 1, 1)
        self.WIFIpassword = QLineEdit(parent=self)
        self.WIFIpassword.setText("password")
        grid.addWidget(self.WIFIpassword, 1, 1, 1, 1)
        grid.addWidget(QLabel(u'password', parent=self), 2, 0, 2, 2)
        # Create ButtonBox, and the user confirms and cancels
        buttonbox = QDialogButtonBox(parent=self)
        buttonbox.setOrientation(Qt.Horizontal)
        buttonbox.setStandardButtons(
            QDialogButtonBox.Cancel | QDialogButtonBox.Ok)
        buttonbox.accepted.connect(self.accept)
        buttonbox.rejected.connect(self.reject)
        # Vertical layout, layout tables and buttons
        layout = QVBoxLayout()
        # Add the table layout you created earlier
        layout.addLayout(grid)
        # Put a space object to beautify the layout
        spacerItem = QSpacerItem(
            20, 48, QSizePolicy.Minimum, QSizePolicy.Expanding)
        layout.addItem(spacerItem)
        # ButtonBox
        layout.addWidget(buttonbox)
        self.setLayout(layout) 
Example #13
Source File: edl_importer_UI_pyside2.py    From anima with MIT License 5 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(923, 542)
        self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.formLayout = QtWidgets.QFormLayout()
        self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout.setObjectName("formLayout")
        self.media_files_path_lineEdit = QtWidgets.QLineEdit(Dialog)
        self.media_files_path_lineEdit.setObjectName("media_files_path_lineEdit")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.media_files_path_lineEdit)
        self.label = QtWidgets.QLabel(Dialog)
        self.label.setObjectName("label")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label)
        self.label_2 = QtWidgets.QLabel(Dialog)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_2)
        self.verticalLayout.addLayout(self.formLayout)
        self.edl_preview_plainTextEdit = QtWidgets.QPlainTextEdit(Dialog)
        self.edl_preview_plainTextEdit.setReadOnly(True)
        self.edl_preview_plainTextEdit.setObjectName("edl_preview_plainTextEdit")
        self.verticalLayout.addWidget(self.edl_preview_plainTextEdit)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.send_pushButton = QtWidgets.QPushButton(Dialog)
        self.send_pushButton.setObjectName("send_pushButton")
        self.horizontalLayout_2.addWidget(self.send_pushButton)
        self.verticalLayout.addLayout(self.horizontalLayout_2)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
        Dialog.setTabOrder(self.media_files_path_lineEdit, self.edl_preview_plainTextEdit)
        Dialog.setTabOrder(self.edl_preview_plainTextEdit, self.send_pushButton) 
Example #14
Source File: ConsoleWidget.py    From debugger with MIT License 5 votes vote down vote up
def __init__(self, parent, name, data):
		if not type(data) == binaryninja.binaryview.BinaryView:
			raise Exception('expected widget data to be a BinaryView')

		self.bv = data

		QWidget.__init__(self, parent)
		DockContextHandler.__init__(self, self, name)
		self.actionHandler = UIActionHandler()
		self.actionHandler.setupActionHandler(self)

		layout = QVBoxLayout()
		self.consoleText = QTextEdit(self)
		self.consoleText.setReadOnly(True)
		self.consoleText.setFont(getMonospaceFont(self))
		layout.addWidget(self.consoleText, 1)

		inputLayout = QHBoxLayout()
		inputLayout.setContentsMargins(4, 4, 4, 4)

		promptLayout = QVBoxLayout()
		promptLayout.setContentsMargins(0, 5, 0, 5)

		inputLayout.addLayout(promptLayout)

		self.consoleEntry = QLineEdit(self)
		inputLayout.addWidget(self.consoleEntry, 1)

		self.entryLabel = QLabel("dbg>>> ", self)
		self.entryLabel.setFont(getMonospaceFont(self))
		promptLayout.addWidget(self.entryLabel)
		promptLayout.addStretch(1)

		self.consoleEntry.returnPressed.connect(lambda: self.sendLine())

		layout.addLayout(inputLayout)
		layout.setContentsMargins(0, 0, 0, 0)
		layout.setSpacing(0)
		self.setLayout(layout) 
Example #15
Source File: console.py    From node-launcher with MIT License 5 votes vote down vote up
def __init__(self, node):
        super().__init__()

        self.node = node

        self.show_help = True

        self.layout = QGridLayout()
        self.setLayout(self.layout)

        self.output_area = QTextEdit()
        self.output_area.setReadOnly(True)
        self.output_area.acceptRichText = True
        self.output_area.document().setMaximumBlockCount(5000)
        self.layout.addWidget(self.output_area)

        self.input_area = QLineEdit()
        self.completer = QCompleter()
        # noinspection PyUnresolvedReferences
        self.completer.setCaseSensitivity(Qt.CaseInsensitive)
        self.input_area.setCompleter(self.completer)
        self.input_area.setFocus()
        self.layout.addWidget(self.input_area)

        self.connect(self.input_area, SIGNAL("returnPressed(void)"),
                     self.execute_user_command) 
Example #16
Source File: guiDemo_ui.py    From MayaDev with MIT License 5 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(360, 180)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.label_2 = QtWidgets.QLabel(Form)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
        self.cbObjType = QtWidgets.QComboBox(Form)
        self.cbObjType.setObjectName("cbObjType")
        self.cbObjType.addItem("")
        self.cbObjType.addItem("")
        self.gridLayout.addWidget(self.cbObjType, 0, 1, 1, 1)
        self.btnCreate = QtWidgets.QPushButton(Form)
        self.btnCreate.setObjectName("btnCreate")
        self.gridLayout.addWidget(self.btnCreate, 0, 2, 1, 1)
        self.label = QtWidgets.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
        self.leNewName = QtWidgets.QLineEdit(Form)
        self.leNewName.setObjectName("leNewName")
        self.gridLayout.addWidget(self.leNewName, 1, 1, 1, 1)
        self.btnRename = QtWidgets.QPushButton(Form)
        self.btnRename.setObjectName("btnRename")
        self.gridLayout.addWidget(self.btnRename, 1, 2, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example #17
Source File: twitter_dapp.py    From Hands-On-Blockchain-for-Python-Developers with MIT License 5 votes vote down vote up
def writeANewTweet(self):
        text, ok = QtWidgets.QInputDialog.getText(self, "Write a new tweet",
                 "Tweet:", QtWidgets.QLineEdit.Normal, "")
        if ok and text != '':
            self.web3_write_a_tweet_thread.setPrivateKey(self.private_key)
            self.web3_write_a_tweet_thread.setTweet(text)
            self.web3_write_a_tweet_thread.start() 
Example #18
Source File: twitter_dapp.py    From Hands-On-Blockchain-for-Python-Developers with MIT License 5 votes vote down vote up
def createPrivateKeyGroupBox(self):
        self.private_key_group_box = QtWidgets.QGroupBox("Account")
        self.private_key_field = QtWidgets.QLineEdit()
        self.welcome_message = QtWidgets.QLabel()

        layout = QtWidgets.QFormLayout()
        layout.addRow(QtWidgets.QLabel("Private key:"), self.private_key_field)
        button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok)
        button_box.button(QtWidgets.QDialogButtonBox.Ok).clicked.connect(self.checkPrivateKey)
        layout.addRow(button_box)
        layout.addRow(self.welcome_message)

        self.private_key_group_box.setLayout(layout) 
Example #19
Source File: mops_updater.py    From MOPS with GNU Lesser General Public License v3.0 4 votes vote down vote up
def buildui(self):
        main_layout = QtWidgets.QVBoxLayout()
        btn_layout = QtWidgets.QHBoxLayout()
        form = QtWidgets.QGridLayout()
        main_layout.addLayout(form)
        current_branch_label = QtWidgets.QLabel('Current Branch: ')
        current_branch = QtWidgets.QLineEdit()
        current_build_label = QtWidgets.QLabel('Current Build: ')
        current_build = QtWidgets.QLineEdit()
        branch_combo_label = QtWidgets.QLabel('Select Branch: ')
        self.branch_combo = QtWidgets.QComboBox()
        build_combo_label = QtWidgets.QLabel('Select Build: ')
        self.build_combo = QtWidgets.QComboBox()
        self.update_env = QtWidgets.QCheckBox('Auto-Update houdini.env')
        self.update_env.setChecked(False)
        # deprecated
        self.update_env.setVisible(False)
        self.do_analytics = QtWidgets.QCheckBox('Share anonymous MOPs data')
        self.do_analytics.setChecked(False)
        apply_btn = QtWidgets.QPushButton('Apply Update')
        cancel_btn = QtWidgets.QPushButton('Cancel')
        form.addWidget(current_branch_label, 0, 0)
        form.addWidget(current_branch, 0, 1)
        form.addWidget(current_build_label, 1, 0)
        form.addWidget(current_build, 1, 1)
        form.addWidget(branch_combo_label, 2, 0)
        form.addWidget(self.branch_combo, 2, 1)
        form.addWidget(build_combo_label, 3, 0)
        form.addWidget(self.build_combo, 3, 1)
        main_layout.addStretch()
        main_layout.addWidget(self.update_env)
        main_layout.addWidget(self.do_analytics)
        main_layout.addLayout(btn_layout)
        btn_layout.addWidget(apply_btn)
        btn_layout.addWidget(cancel_btn)
        self.setLayout(main_layout)
        # defaults
        current_branch.setEnabled(False)
        current_build.setEnabled(False)
        install_info = get_install_info()
        current_branch.setText(install_info['branch'])
        current_build.setText(install_info['release'])
        # signals / slots
        self.branch_combo.currentIndexChanged.connect(self.set_branch)
        self.build_combo.currentIndexChanged.connect(self.set_build)
        apply_btn.clicked.connect(self.apply)
        cancel_btn.clicked.connect(self.close)
        self.update_env.clicked.connect(self.toggle_env_update)
        # window size
        # self.setFixedSize(300, 200) 
Example #20
Source File: Dialog_text.py    From Sonoff_Devices_DIY_Tools with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
def __init__(self, parent=None):
        super(WIFIDialog, self).__init__(parent)
        # Sets the title and size of the dialog box
        self.setWindowTitle('Connect to a new WIFI')
        self.resize(200, 100)
        # Set the window to modal, and the user can only close the main
        # interface after closing the popover
        self.setWindowModality(Qt.ApplicationModal)
        # Table layout used to layout QLabel and QLineEdit and QSpinBox
        grid = QGridLayout()
        grid.addWidget(QLabel(u'SSID', parent=self), 0, 0, 1, 1)
        self.SSIDName = QLineEdit(parent=self)
        self.SSIDName.setText("SSID")
        grid.addWidget(self.SSIDName, 0, 1, 1, 1)
        grid.addWidget(QLabel(u'password', parent=self), 1, 0, 1, 1)
        self.WIFIpassword = QLineEdit(parent=self)
        self.WIFIpassword.setText("password")
        grid.addWidget(self.WIFIpassword, 1, 1, 1, 1)
        grid.addWidget(
            QLabel(
                u'Please enter the SSID and password of the new wifi your device will connect.After connected,\n the '
                u'device will no longer be on this LAN and info in the list will be refreshed in 5 mins.',
                parent=self),
            2,
            0,
            2,
            2)
        # Create ButtonBox, and the user confirms and cancels
        buttonbox = QDialogButtonBox(parent=self)
        buttonbox.setOrientation(Qt.Horizontal)
        buttonbox.setStandardButtons(
            QDialogButtonBox.Cancel | QDialogButtonBox.Ok)
        buttonbox.accepted.connect(self.accept)
        buttonbox.rejected.connect(self.reject)
        # Vertical layout, layout tables and buttons
        layout = QVBoxLayout()
        # Add the table layout you created earlier
        layout.addLayout(grid)
        # Put a space object to beautify the layout
        spacer = QSpacerItem(
            20, 48, QSizePolicy.Minimum, QSizePolicy.Expanding)
        layout.addItem(spacer)
        # ButtonBox
        layout.addWidget(buttonbox)
        self.setLayout(layout) 
Example #21
Source File: MainWindow.py    From HS_Downloader with MIT License 4 votes vote down vote up
def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(476, 263)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.searchButton = QtWidgets.QPushButton(self.centralwidget)
        self.searchButton.setGeometry(QtCore.QRect(340, 10, 131, 31))
        self.searchButton.setObjectName("searchButton")
        self.selectAll = QtWidgets.QPushButton(self.centralwidget)
        self.selectAll.setGeometry(QtCore.QRect(340, 55, 131, 31))
        self.selectAll.setObjectName("selectAll")
        self.deselectAll = QtWidgets.QPushButton(self.centralwidget)
        self.deselectAll.setGeometry(QtCore.QRect(340, 90, 131, 31))
        self.deselectAll.setObjectName("deselectAll")
        self.line = QtWidgets.QFrame(self.centralwidget)
        self.line.setGeometry(QtCore.QRect(340, 35, 131, 31))
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setObjectName("line")
        self.downloadButton = QtWidgets.QPushButton(self.centralwidget)
        self.downloadButton.setGeometry(QtCore.QRect(340, 220, 131, 31))
        self.downloadButton.setObjectName("downloadButton")
        self.animeView = QtWidgets.QListWidget(self.centralwidget)
        self.animeView.setGeometry(QtCore.QRect(10, 50, 321, 201))
        self.animeView.setObjectName("animeView")
        self.searchField = QtWidgets.QLineEdit(self.centralwidget)
        self.searchField.setGeometry(QtCore.QRect(10, 10, 321, 31))
        self.searchField.setObjectName("searchField")
        self.loadingStatus = QtWidgets.QLabel(self.centralwidget)
        self.loadingStatus.setEnabled(True)
        self.loadingStatus.setGeometry(QtCore.QRect(340, 160, 131, 20))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(11)
        font.setWeight(75)
        font.setBold(True)
        self.loadingStatus.setFont(font)
        self.loadingStatus.setAlignment(QtCore.Qt.AlignCenter)
        self.loadingStatus.setObjectName("loadingStatus")
        self.selectQuality = QtWidgets.QComboBox(self.centralwidget)
        self.selectQuality.setGeometry(QtCore.QRect(340, 190, 131, 22))
        self.selectQuality.setObjectName("selectQuality")
        self.intellTurn = QtWidgets.QCheckBox(self.centralwidget)
        self.intellTurn.setGeometry(QtCore.QRect(340, 130, 131, 17))
        self.intellTurn.setObjectName("intellTurn")
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow) 
Example #22
Source File: attributes.py    From hotbox_designer with BSD 3-Clause Clear License 4 votes vote down vote up
def __init__(self, parent=None):
        super(TextSettings, self).__init__(parent)
        self.text = QtWidgets.QLineEdit()
        self.text.returnPressed.connect(self.text_changed)

        self.size = FloatEdit(minimum=0.0)
        self.size.valueSet.connect(partial(self.optionSet.emit, 'text.size'))

        self.bold = BoolCombo()
        self.bold.valueSet.connect(partial(self.optionSet.emit, 'text.bold'))

        self.italic = BoolCombo()
        method = partial(self.optionSet.emit, 'text.italic')
        self.italic.valueSet.connect(method)

        self.color = ColorEdit()
        self.color.valueSet.connect(partial(self.optionSet.emit, 'text.color'))

        self.halignement = QtWidgets.QComboBox()
        self.halignement.addItems(HALIGNS.keys())
        self.halignement.currentIndexChanged.connect(self.halign_changed)
        self.valignement = QtWidgets.QComboBox()
        self.valignement.addItems(VALIGNS.keys())
        self.valignement.currentIndexChanged.connect(self.valign_changed)

        self.layout = QtWidgets.QFormLayout(self)
        self.layout.setSpacing(0)
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.layout.setHorizontalSpacing(5)
        self.layout.addRow('Content', self.text)
        self.layout.addItem(QtWidgets.QSpacerItem(0, 8))
        self.layout.addRow(Title('Options'))
        self.layout.addRow('Size', self.size)
        self.layout.addRow('Bold', self.bold)
        self.layout.addRow('Italic', self.italic)
        self.layout.addRow('Color', self.color)
        self.layout.addItem(QtWidgets.QSpacerItem(0, 8))
        self.layout.addRow(Title('Alignement'))
        self.layout.addRow('Horizontal', self.halignement)
        self.layout.addRow('Vertical', self.valignement)
        for label in self.findChildren(QtWidgets.QLabel):
            if not isinstance(label, Title):
                label.setFixedWidth(LEFT_CELL_WIDTH) 
Example #23
Source File: _blockchain_dock.py    From torba with MIT License 4 votes vote down vote up
def setupUi(self, BlockchainDock):
        BlockchainDock.setObjectName("BlockchainDock")
        BlockchainDock.resize(416, 167)
        BlockchainDock.setFloating(False)
        BlockchainDock.setFeatures(QtWidgets.QDockWidget.AllDockWidgetFeatures)
        self.dockWidgetContents = QtWidgets.QWidget()
        self.dockWidgetContents.setObjectName("dockWidgetContents")
        self.formLayout = QtWidgets.QFormLayout(self.dockWidgetContents)
        self.formLayout.setObjectName("formLayout")
        self.generate = QtWidgets.QPushButton(self.dockWidgetContents)
        self.generate.setObjectName("generate")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.generate)
        self.blocks = QtWidgets.QSpinBox(self.dockWidgetContents)
        self.blocks.setMinimum(1)
        self.blocks.setMaximum(9999)
        self.blocks.setProperty("value", 1)
        self.blocks.setObjectName("blocks")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.blocks)
        self.transfer = QtWidgets.QPushButton(self.dockWidgetContents)
        self.transfer.setObjectName("transfer")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.transfer)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.amount = QtWidgets.QDoubleSpinBox(self.dockWidgetContents)
        self.amount.setSuffix("")
        self.amount.setMaximum(9999.99)
        self.amount.setProperty("value", 10.0)
        self.amount.setObjectName("amount")
        self.horizontalLayout.addWidget(self.amount)
        self.to_label = QtWidgets.QLabel(self.dockWidgetContents)
        self.to_label.setObjectName("to_label")
        self.horizontalLayout.addWidget(self.to_label)
        self.address = QtWidgets.QLineEdit(self.dockWidgetContents)
        self.address.setObjectName("address")
        self.horizontalLayout.addWidget(self.address)
        self.formLayout.setLayout(1, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout)
        self.invalidate = QtWidgets.QPushButton(self.dockWidgetContents)
        self.invalidate.setObjectName("invalidate")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.invalidate)
        self.block_hash = QtWidgets.QLineEdit(self.dockWidgetContents)
        self.block_hash.setObjectName("block_hash")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.block_hash)
        BlockchainDock.setWidget(self.dockWidgetContents)

        self.retranslateUi(BlockchainDock)
        QtCore.QMetaObject.connectSlotsByName(BlockchainDock) 
Example #24
Source File: reporter_ui.py    From spore with MIT License 4 votes vote down vote up
def build_ui(self):
        self.setGeometry(50, 50, 450, 300)
        self.setMinimumSize(400, 300)
        self.setWindowTitle('Spore Reporter')

        layout = QVBoxLayout()

        #  self.err_wdg = QWidget()
        #  err_layout = QHBoxLayout(self.err_wdg)
        #  layout.addWidget(err_wdg)
        #
        #  err_lbl = 'Ops..\nSpore seems to have caused an error.\n'

        info_msg = 'Help to improve Spore by anonymously submitting your logs'
        self.info_lbl = QLabel(info_msg)
        layout.addWidget(self.info_lbl)

        self.address_edt = QLineEdit()
        self.address_edt.setPlaceholderText('E-Mail Address (optional)')
        layout.addWidget(self.address_edt)

        self.subject_edt = QLineEdit()
        self.subject_edt.setPlaceholderText('Subject (optional)')
        layout.addWidget(self.subject_edt)

        self.msg_edt = QTextEdit()
        self.msg_edt.setPlaceholderText('Message (optional)')
        self.msg_edt.setFixedHeight(60)
        layout.addWidget(self.msg_edt)

        self.log_edt = QTextEdit()
        self.log_edt.setReadOnly(True)
        self.log_edt.setLineWrapMode(QTextEdit.NoWrap)
        layout.addWidget(self.log_edt)

        ctrl_layout = QGridLayout()
        layout.addLayout(ctrl_layout)

        self.submit_btn = QPushButton('Submit')
        ctrl_layout.addWidget(self.submit_btn, 0, 0, 1, 1)

        self.cancel_btn = QPushButton('Cancel')
        ctrl_layout.addWidget(self.cancel_btn, 0, 1, 1, 1)

        line = QFrame()
        line.setFrameShape(QFrame.HLine)
        line.setFrameShadow(QFrame.Sunken)
        ctrl_layout.addWidget(line, 1, 0, 1, 2)

        self.disable_btn = QPushButton('Disable Reporter')
        ctrl_layout.addWidget(self.disable_btn, 2, 0, 1, 1)

        self.auto_btn = QPushButton('Send Reports Automatically')
        ctrl_layout.addWidget(self.auto_btn, 2, 1, 1, 1)

        self.setLayout(layout)