Questions tagged [qlineedit]

QLineEdit is a component of the Qt library which is basically a text editor that has only one line, and which allows one to make inputting and editing of text. A related class is QTextEdit which allows multi-line, rich text editing.

A minimalistic example of a QLineEdit that is shown in a new window, and contains the infamous "Hello, World!" line:

#include <QtGui>
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a( argc, argv );
    QLineEdit * myLine = new QLineEdit( "Hello, World!" );
    myLine->show();
    return a.exec();
}

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

600 questions
0
votes
1 answer

How to change the text of QLineEdit while QTableWidget is being updating with data?

enter image description hereI'm creating a Qt application in which there is a QTableWidget and a QLineEdit. The QTableWidget is updated by a thread with lots of data and it takes time.While the QTableWidget is being updated QLineEdit becomes…
0
votes
2 answers

(PyQt5) Create list of QLineEdit

How to make a list of line editors without many variables? (smth like self.line_1 = QLineEdit(self), self.line_2 = QLineEdit(self), ... , self.line_9000 = QLineEdit(self)) For example, I want to create this window with ability to get access to each…
Double_Mind
  • 59
  • 1
  • 9
0
votes
0 answers

How to get text from a QLineEdit in a different Qt plugin

I have an interface MyInterface: class MyInterface { public: virtual ~MyInterface() {} virtual QMap *inputsMap() const = 0; }; I have a class MyImplementingClass that implements MyInterface. However, I'm unable to get…
Program-Me-Rev
  • 6,184
  • 18
  • 58
  • 142
0
votes
2 answers

How to make pushButton and lineEdit to connect and calculate in pushButton?

since there isn't any useful How-To for beginners of PyQt5, I'm stuck with a little problem 。 @pyqtSlot() def on_pushButton_17_clicked(self): """ Slot documentation goes here. """ A=self.lineEdit_22.text() …
Zoe.peace
  • 1
  • 1
0
votes
1 answer

Python Pyqt QtGui.QLineEdit.clear()

I tried to set some strings by using QtGui.QLineEdit.setText() at the end of program and clear the strings using QtGui.QLineEdit.clear() at the beginning of the program. However, it never clears the strings. All I want to do is to clear the content…
Dogod
  • 283
  • 5
  • 12
0
votes
1 answer

Python PyQt5: How to change the color of QLabel if QLineEdit is empty?

With myQLineEdit.textChanged.connect( lambda: myQLabel.setStyleSheet("QLabel { color: green}")) I can change the text color while I'm typing. How can I change the text color if the QLineEdit is blank?
Ramón Wilhelm
  • 967
  • 2
  • 18
  • 39
0
votes
1 answer

How to change the focus of QLineEdit automatically to another QLineEdit after input satisfy a criterion?

I have two QLineEdit widgets, edt1 and edt2. Each QLineEdit can only accept two digits. After I input xx (e.g. 10) in edt1, which can satisfy the input criterion, how to change the focus from edt1 to edt2 automatically. Is there built in function to…
stackname
  • 101
  • 2
  • 9
0
votes
1 answer

In Qt how to add a file with a QFileDialog in a QLineEdit

I have one window which has a button named "..." which open an other window which has also a button named "..." which open a QFileDialog. Next to the button of the second window, there are 10 QLineEdit to get 10 files. With the QFileDialog, I can't…
Meugiwara
  • 599
  • 1
  • 7
  • 13
0
votes
0 answers

PyQt4 - QLineEdit.text() exported to a list[] position

I will try to lay this out as best I can. I am writing a GUI with PyQt4 using Python 3.4.3. The code I am writing stores information in a list and then pulls information from said list in order to complete tasks based on comparative logic between…
0
votes
0 answers

Link QPushButton and QLineEdit

I work on Qt and I don't understand how to link QPushButton and QLineEdit. I did this for the QPushButton : QHBoxLayout accountlayout; QLabel accountlabel("AccountServer"); QLineEdit accountlineedit; QPushButton …
Meugiwara
  • 599
  • 1
  • 7
  • 13
0
votes
2 answers

QLineEdit InputMask and blanks inserted

I have a QLineEdit with an InputMask set to ">AAAA90", that is, I expect the text to consists of exactly 4 uppercase Ascii letters and between 1-2 digits. If the user types "AA1" however, the QLineEdit will show AA 1, namely it will insert two…
Reimundo Heluani
  • 918
  • 9
  • 18
0
votes
1 answer

PyQt4: AttributeError: 'QLineEdit' object has no attribute 'setPlaceholderText'

I have a QLineEdit, and I want to set a placeholder text. When I call setPlaceholderText(string) I get an AttributeError, but: >>> from PyQt4 import QtCore >>> QtCore.PYQT_VERSION_STR '4.7.4' >>> QtCore.QT_VERSION_STR '4.7.0' and from the…
rubik
  • 8,814
  • 9
  • 58
  • 88
0
votes
0 answers

How can I specify the QLineEdit input while typing

I wanna specify the QLineEdit input while typing that if I set the LineEdit to write text only the user can't type any numbers or symbols and so on itried to write this Name = QLineEdit(self) regex = QRegExp('([A-Z]?[a-z])') validator =…
0
votes
1 answer

QComboBox Look Changes When I Use setEditable(true)

I wanted to center align text items in a QComboBox but to do this I need to set Editable to true. When I do this the look changes significantly. This is on Windows 7. QComboBox when setEditable(false) QComboBox when setEditable(true) I think the…
0
votes
1 answer

QRegExp for IP Address of QlineEDit in QT

How we can validate for QlineEdit control when i want to enter the IP Address into QlineEdit control, that control should be allow only IP address . don't allow any alphabets ,characters except dot(.) All the parts should be in range of 0-255 IP…
Rishabh Bansal
  • 51
  • 1
  • 1
  • 9