qlineedit

PyQt4 filter by text on a QListView using setRowHidden

烈酒焚心 提交于 2021-02-16 15:09:25
问题 I have a dialog which looks like this: That dialog has the following code connected to the filter button: class Dialog(QtGui.QDialog, addWin.Ui_Dialog): ... self.list = QListView() self.filter.clicked.connect(self.filterClicked) ... def filterClicked(self): filter_text = str(self.lineEdit.text()).lower() for row in range(self.model.rowCount()): if filter_text in str(self.model.item(row).text()).lower(): self.list.setRowHidden(row, True) else: self.list.setRowHidden(row, False) However, when I

PyQt4 filter by text on a QListView using setRowHidden

∥☆過路亽.° 提交于 2021-02-16 15:08:58
问题 I have a dialog which looks like this: That dialog has the following code connected to the filter button: class Dialog(QtGui.QDialog, addWin.Ui_Dialog): ... self.list = QListView() self.filter.clicked.connect(self.filterClicked) ... def filterClicked(self): filter_text = str(self.lineEdit.text()).lower() for row in range(self.model.rowCount()): if filter_text in str(self.model.item(row).text()).lower(): self.list.setRowHidden(row, True) else: self.list.setRowHidden(row, False) However, when I

Uppercase input in QLineEdit python way

给你一囗甜甜゛ 提交于 2021-02-10 08:09:07
问题 I had drawn up an UI using the QT Designer but found out that there are no parameters for me to set QLineEdit inputs to be uppercase. After doing some online searching, I have only seen a very few handful of results that cater to my needs, however all are coded in Qt. Example, this link And so, are there ways for me to do this in the pythonic way? 回答1: Try this, I believe this serves your purpose. I won't call it much pythonic. More like PyQt override. #minor code edit from PyQt4 import QtGui

Uppercase input in QLineEdit python way

笑着哭i 提交于 2021-02-10 08:08:28
问题 I had drawn up an UI using the QT Designer but found out that there are no parameters for me to set QLineEdit inputs to be uppercase. After doing some online searching, I have only seen a very few handful of results that cater to my needs, however all are coded in Qt. Example, this link And so, are there ways for me to do this in the pythonic way? 回答1: Try this, I believe this serves your purpose. I won't call it much pythonic. More like PyQt override. #minor code edit from PyQt4 import QtGui

PyQt auto-space qlineedit characters

荒凉一梦 提交于 2021-01-28 01:31:59
问题 Am having a qlineedit where a user types a verification code. I want to be able to space these numbers automatically every after 5 characters just like it is when activating windows where dashes are automatically added. For example 12345 67890 12345 67890 回答1: If the number of digits is fixed the best option is to use setInputMask(), in your case: if __name__ == '__main__': app = QApplication(sys.argv) le = QLineEdit() le.setInputMask(("ddddd "*4)[:-1]) le.show() sys.exit(app.exec_()) In the

QLineEdit in QTableWdiget cell not losing focus

霸气de小男生 提交于 2020-05-17 08:47:03
问题 I'm currently trying to make a graphical interface using PyQt5. Everything has been working fine until now (I have some experience in this after all), but I've been struggling with this problem for a few days now and I can't find a solution anywhere. In my app I display a FigureCanvas from matplotlib (along with various other widgets) where I have a key event connected to a function which picks a point from a mouse click and saves this point in a QTableWidget. However, I want the user to be

QLineEdit in QTableWdiget cell not losing focus

时光怂恿深爱的人放手 提交于 2020-05-17 08:46:06
问题 I'm currently trying to make a graphical interface using PyQt5. Everything has been working fine until now (I have some experience in this after all), but I've been struggling with this problem for a few days now and I can't find a solution anywhere. In my app I display a FigureCanvas from matplotlib (along with various other widgets) where I have a key event connected to a function which picks a point from a mouse click and saves this point in a QTableWidget. However, I want the user to be

Display text from QLineEdit in a QTextEdit already containing some text and update it in real time

喜欢而已 提交于 2020-02-28 07:26:06
问题 What is the procedure to make a text being written in a QLineEdit widget, dynamically display inside a QTextEdit that already contains some text? For example, let us say that a QLineEdit asks for a name where one writes "John". Is it possible to display it in real time inside a QTextEdit containing : The name is + textFromQLineEdit + , age 24 ? The displayed text has to dynamically take into account the changes being made to the QLineEdit so that the user does not need to press a button or

PyQt Button Selection

本秂侑毒 提交于 2020-01-30 01:39:34
问题 I have a PyQt GUI set up that has a selection of QPushButtons and a QLineEdit text box (among other things). The text box is set up so as to call a function upon returnPressed(). My problem is that when I click on the text box and put in text, one of the buttons becomes selected which means that when I press enter in the text box it activates both the button and the text box function. Is there a way around this? Some way to stop any buttons from being selected while the text box is being