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
2
votes
1 answer

Qt Validators - how do I reject intermediate results?

As far as I understand, a validator can return three results: Invalid, Intermediate and Acceptable. Suppose my line edit has a regexp validator set with the following regular expression: [ab][cd] So, valid values are: ac, ad, bc, bd: If I try to…
Armen Tsirunyan
  • 130,161
  • 59
  • 324
  • 434
2
votes
3 answers

PyQt QLineEdit with QValidator

I have a QLineEdit in my project. I want to use the QValidation on lineEdit. #Create lineEdit itemValue = QtWidgets.QLineEdit() #Create валидатор objValidator = QtGui.QDoubleValidator(self) #setup range objValidator.setRange(-10.0, 100.0,…
aarexer
  • 523
  • 6
  • 20
2
votes
1 answer

How to detect mouse click on QLineEdit

In my QWidget there are some subwidgets like a QLineEdit and QLabels. I can easily check if my mouse is over a QLabel and if it was clicked on the right button. Not so on QLineEdit. I tried to subclass QLineEdit and re-implement the mouseRelease,…
user2366975
  • 4,350
  • 9
  • 47
  • 87
2
votes
2 answers

QLineEdit hover-over Signal - when mouse is over the QlineEdit

I have a QLineEdit, and I need to know if there is a signal which can track mouse hover over that QLineEdit, and once mouse is over that QLineEdit it emits a signal. I have seen the documents, and found we have the following signals:…
paarth batra
  • 1,392
  • 4
  • 29
  • 53
2
votes
0 answers

PyQt - comboBox and/or lineEdit value as subProcess.call argument

I am new to Python and Qt4 and am running into some problems with taking user entered/selected information and then using them as arguments for other python files. Here's the two situations & code: Users enter an ID # into a lineEdit box, and on…
2
votes
2 answers

Connecting multiple signals to a single slot in Qt

I'm trying to keep track of the textChanged() signal on for handful of QTextEdits. I want to do the same thing regardless of the text edit emitting the signal: uncheck its associated checkbox in a QListWidget if it becomes empty and leave it checked…
Alex Wood
  • 821
  • 3
  • 12
  • 27
2
votes
1 answer

Selecting text for QLinEdit by double clicking on a item in Tablewidget

In a dialog, I have a table-widget and multiple line edits. The user clicks the mouse in one of the line-edits, and then double-clicks on an item in the table-widget. In the double-click slot (self.myfunct), how do I determine which line-edit had…
Jagat
  • 61
  • 7
2
votes
1 answer

PyQt Button Selection

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…
user3011077
  • 23
  • 1
  • 3
2
votes
1 answer

How to use QLineEdit mask with Russian letters?

I need that case of QLineEdit was always lower. I will use it with russian letters.
punksta
  • 2,738
  • 3
  • 23
  • 41
2
votes
2 answers

pyside / pyqt: Getting values from dynamically created qlineedits on button clicked

I have a program that creates a number of qlineedits and buttons depending on the users input: On the image above 4 lines have been added with a button after the grayed out "Next" button was clicked. Now I want to get the input from the user into a…
user2832718
  • 69
  • 3
  • 11
2
votes
3 answers

Drag and drop from a QListWidget to a QLineEdit

I have a QListWidget with rows of simple text. I want to set it up so the user can drag and drop this data into some QLineEdit objects. I have turned on drag and drop for both types but it doesn't allow me to drag and drop from QListWidget to…
RushK
  • 525
  • 1
  • 5
  • 13
2
votes
2 answers

Retain the cursor position in QTextEdit

I have a QTextEdit control. It has a maximum limit (maximum number of characters it can hold). To implement this I have connected a slot to the textChanged() signal which removes the extra character when the total number of characters exceeds the…
asitdhal
  • 621
  • 2
  • 7
  • 15
2
votes
1 answer

Cursor is not blinking after QlineEdit setInputMask()

I am using setInputMask() to validate ipaddress in qlineEdit. But after using setInputMask(), cursor is not blinking. Do anyone is having idea how this can be fixed to make cursor behave normal after setInputMask().
user967400
  • 53
  • 5
2
votes
1 answer

How to connect QLineEdit focusOutEvent

I have designed a window with a QLineEdit in PyQt4 with the help of Designer. I converted .ui to .py using pyuic4. I created another .py file and imported and subclassed Ui_Class. I want to perform some task when QLineEdit lost focus. Just line…
Rao
  • 2,902
  • 14
  • 52
  • 70
2
votes
3 answers

How to create a hotkey field in Qt

What is the easiest way to allow user to input a key combination? It would basically look like QLineEdit field but it would accept key combinations only. For example, there is something already in the Qt Designer where you can assign a shortcut…
warunanc
  • 2,221
  • 1
  • 23
  • 40