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

How to make bullet points bigger in password mode for QLineEdit?

I have a QLineEdit to which I set the echoMode to QLineEdit::Password like this: myLineEdit->setEchoMode(QLineEdit::Password); The bullets are shown, but they are too small for the purpose of my application: I need to make them bigger like…
trangan
  • 341
  • 8
  • 22
2
votes
2 answers

How to set Stylesheet for only one side of border in QLineEdit and QPushButton?

I tried to create a combo box manually. So a line edit should be combined with a (dropdown) push button. Therefore I want to hide the right border of line edit and left border of push button. I tried with…
trangan
  • 341
  • 8
  • 22
2
votes
0 answers

PyQt5 setText with a signal class

I'm trying to update QLineEdit() with setText. However, that is made through a signal thread class (A) that is able to send every time signal to a widget class (B) [deputy to change the text]. let see an example: classB(QWidget): def __init__(self,…
pippo87
  • 23
  • 3
2
votes
1 answer

Assign keyboard shortcut to QLineEdit from Qt Designer

I have a form designed in Qt Designer (with PyQt5). I use a line-edit there for entering some input. What I want is to add the ability to use a keyboard combo (something like Ctrl+B or one of the function keys) in the line-edit. Once that combo or…
shafuq
  • 465
  • 6
  • 20
2
votes
1 answer

QLineEdit not release the focus when click in QGroupBox

int main(int ac, char **av) { QApplication app(ac, av); Dialog *dialog = new Dialog(); dialog->show(); return app.exec(); } namespace Ui { class Dialog; } class Dialog : public QDialog { …
Nick.Rhan
  • 167
  • 2
  • 7
2
votes
3 answers

Set properties of multiple QLineEdit using a loop

I was wondering if it is possible to set multiple setFixedHeight() properties using a for loop: for num in range(1, 6): self.LineEdit[num].setFixedHeight() currently I have twelve QLineEdit boxes LineEdit1, LineEdit2, ... , LineEdit12 and I'm…
artomason
  • 3,625
  • 5
  • 20
  • 43
2
votes
1 answer

PyQt auto-space qlineedit characters

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…
And3r50n 1
  • 337
  • 1
  • 5
  • 21
2
votes
2 answers

Recognize if a QLineEdit loses a focus

In one of my projects I have a series of QLineEdit Widgets, that should accept double numbers, that are lying in a certain range. For certain reasons I can not use QDoubleSpinBox. Now I'm using QDoubleValidator to check, if my number lies in the…
Aleph0
  • 5,816
  • 4
  • 29
  • 80
2
votes
0 answers

QLineEdit Password - Obscure All But Last Character

We are using a QLineEdit for password entry, with echo mode set to 'Password'. A request was made to obscure all characters typed except for the last, an entry feature I've seen on some smartphones. How would I go about implementing such a thing?
SixDegrees
  • 781
  • 1
  • 8
  • 19
2
votes
2 answers

Retrieve date from column index position in pandas and paste in PyQt

I want to retrieve the date of one index position of a Pandas data frame and paste it into the LineEdit of a PyQt Application. What I have so far is: purchase = sales [['Total','Date']] pandas_value = purchase.iloc[-1:]['Date'] # last…
rainer
  • 3,295
  • 5
  • 34
  • 50
2
votes
1 answer

QLineEdit: show new text before processing textEdited signal

I have a QLineEdit and a slot that processes the textEdited signal. I don't want to validate the text, just use it to filter a list of names (different widget) with the ones matching the text in the QLineEdit. I have found that the text shown in the…
Pablovx
  • 35
  • 6
2
votes
0 answers

Strange behavior with QTreeView / QFileSystemModel / QLineEdit

I have a QTreeView linked to a QFileSystemModel. I also have a QLineEdit with two purposes : when the user click the QTreeView, the QLineEdit is populate with the item clicked (path & filename if applied) when the user edit the QLineEdit and press…
Aesope
  • 445
  • 6
  • 15
2
votes
3 answers

How to change backgroundcolor of QLineEdit in a QGraphicsScene

I have a QGraphicsScene and add a QlineEdit but changing color just doesn't work. QGridLayout *layout = new QGridLayout(this); QGraphicsView *view = new QGraphicsView(this); QGraphicsScene *scene = new QGraphicsScene(this); QWidget *widget = new…
J.W.
  • 81
  • 10
2
votes
1 answer

How to add QLineEdit to QMessageBox PyQt5

I want a copyable text on my QMessageBox so I thought I can put a QLineEdit on QMessageBox then set the text of QLineEdit whatever I want, so user can choose the text and copy it. But I couldn't success. Is there a way to add QLineEdit to…
GLHF
  • 3,835
  • 10
  • 38
  • 83
2
votes
2 answers

How to disable a Button unless a Edit Field isn't empty?

I've got a QLineEdit field and a QPushButton. The button should be disabled as long the QLineEdit is empty. How to do that?
eco
  • 321
  • 2
  • 4
  • 11