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

QLineEdit the function selectAll() didn't work?

I user QLineEdit like this, and anybody know anything is wrong: if (event->modifiers() == Qt::ControlModifier && event->key()== Qt::Key_A) { qDebug() << "Ctrl+A pressed"; m_lineEdit->setFocus(Qt::ShortcutFocusReason); …
seme
  • 43
  • 7
0
votes
2 answers

How to enter a character to QLineEdits from QPushButtons depending on the focus in Qt

I am using Qt Creator to make a UI.UI consists of two or more QLineEdits and ten QPushButtons to input 0-9 numberic characters to QLineEdits. How can I enter 0-9 number strings in both QLineEdits one by one. If I press QPushButton with label '5'and…
Saad Rafey
  • 531
  • 2
  • 6
  • 18
0
votes
1 answer

Saving values in QLineEdit

I have a couple QLineEdit widgets in my project. I enter something, call methods and close the window. Can I save values in QLineEdit widgets, so when I open an app, values which I entered were there? I only can set values by default using…
Kate
  • 93
  • 1
  • 1
  • 6
0
votes
0 answers

Selective keyPressEvent, filter for its sender QLineEdit

I've created a QWidget, which contains three QLineEdits. Then I added a overwrote the keyPressEvent so that this lineEdit_3 reacts on key press. Working good. void MySuperWidget::keyPressEvent(QKeyEvent* keyEv) { switch (keyEv->key()) { case…
Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103
0
votes
1 answer

How to change a QLabel to a QLineEdit when mouse pressed?

I am trying to create a custom class so that whenever a mouse press event occurs, a QLabel should change to a QLineEdit. So, after searching, I found this code on a Qt website. But, unfortunately, it is not working. A user who posted this question…
Anvesh Chary
  • 65
  • 1
  • 11
0
votes
1 answer

Qt Acces to dynamic qt LineEdit

I am programming a configurator. If the Addbutton is clicked, it adds several Labels and LineEdits dynamicly (See the Code below). My Problem is following: After I create the Labels and LineEdits they will be shown, but if the user changes the…
Frederik Ubben
  • 143
  • 1
  • 12
0
votes
0 answers

How can I get Qlineedit to become unicode? pyqt

Hi I ran into a problem when trying to process the information in a series of Qlineedits. Im living in Norway and the characters "æøå" arent accepted by my script. This is the failing code. Retrieves the information of all my lineinputs and stores…
0
votes
1 answer

QLineEdit Qt in c++ removing QLineEdit

I'm trying to make an adress book in Qt and i am using the following code: #include "mainwindow.h" #include "ui_mainwindow.h" int counter = 1; MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { …
user3576310
  • 11
  • 1
  • 2
0
votes
1 answer

qlineedit with clearbutton only when mouse is over the QLineEdit

I would like to have a QLineEdit that shows the clearbutton only when the mouse is over the QLineEdit (and of course the field is not empty). I've captured the enter- and leave- events which set the property respectively. This works fine with the…
0
votes
1 answer

How to move the focus from a QLineEdit to a QTableView editable cell

I am using a QMainWindow with few QLineEdits and with some QPushButtons in it. When the focus is in a QLineEdit (if I type something in the QLineEdit) and if I press the F5 key, I want to show a QDialog. That QDialog contains a QTableView. My…
New Moon
  • 787
  • 6
  • 21
  • 35
0
votes
2 answers

QLineedit disabling/re-enabling.

I have an equation with four variables, only 3 need to be defined for the program to run. When 3 of the parameters have been defined (via lineedits in my GUI) I'd like the fourth to be greyed out. I only know how to link two parameters at the moment…
SageDO
  • 27
  • 1
  • 1
  • 8
0
votes
0 answers

Adding QToolButton inside QlineEdit

I am trying to implement a qToolButton onto the qLineEdit. Basically this toolButton serves something like a file browser. I did found a few links but I am simply not getting it, for example from here as I am doing out my UI using the Qt Designer. I…
yan
  • 631
  • 9
  • 30
0
votes
0 answers

How to update text in QLineEdit using setText() inside slot function [Qt5.4]

I am just starting out with Qt (5.4 to be precise), using it to build a GUI for a C++ project to control some hardware. Now my problem is, I cant update any QLineEdit (or QLabel, but this seems to be the same problem) text displayed using its…
user2235370
  • 51
  • 1
  • 1
  • 4
0
votes
1 answer

PyQt5 - Signals&Slots - How to enable a button through content change of lineEdit?

since there isn't any useful How-To for beginners of PyQt5, I'm stuck with a little problem about signals & slots. I do have a lineEdit which will get a directory path by a dialog (which works fine). If one starts the program this lineEdit is empty…
camaro
  • 118
  • 12
0
votes
0 answers

PyQt4 Completer to a qlineedit

I am trying to make a completer for an line edit widget. Here is the signal : QtCore.QObject.connect(self.lineEdit, QtCore.SIGNAL(_fromUtf8("textEdited(QString)")),self.get_data) And here is the function : def get_data (self): try: …