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
2 answers

how to assign line edit value to a variable when enter key is pressed

I need to take what number is typed into a QLineEdit object and assign it to a variable x when the enter key is pressed. How can I do this with the new signals and slots mechanism that was implemented in Qt 4.5 ? import sys from PyQt4 import…
Jkallus
  • 431
  • 1
  • 4
  • 16
0
votes
2 answers

onmouseover and click event QLineEdit

How can I define onmouseover and click event for a QLineEdit? I want to make 2 signals as onmouseover() and clicked() for QLineEdit
Aidin.T
  • 731
  • 3
  • 10
  • 25
0
votes
1 answer

How to give output of a file as input to other file,How to give the text entered in LineEdit in pyqt4 to another file as an input string

import sys from PyQt4.QtCore import SIGNAL from PyQt4.QtGui import QDialog, QApplication, QPushButton, QLineEdit, QFormLayout class Form(QDialog): def __init__(self, parent=None): super(Form, self).__init__(parent) self.le =…
user1994124
  • 53
  • 1
  • 4
0
votes
1 answer

program to take input from line edit and dispaly in line edit

Hi I'm new to QT i need a program to take input from line edit and using those values perform some operations using those values anfd give output to line edit.... I wrote some code but its not working.... please check it. Code: enter code…
0
votes
1 answer

Creating A simple Add Calculator

void FindCrap::on_BtnAdd_clicked() { QString fnum = ui->TxtFnum->text(); QString snum = ui->TxtSnum->text(); ui->TxtAns->setText(QString(fnum.toInt() + snum.toInt())); } nothing is happening when i run this code .. not even an error . the BtnAdd…
0
votes
1 answer

Show text in a LineEdit C++ Qt Designer

I have two windows in Qt Designer, and I want to open a file .txt with text. This code belongs to the second window (pacientes.ui) and I want to show in the first window (ventana.ui) three line of text in three LineEdit (the file .txt it has three…
Jaime SPA
  • 75
  • 1
  • 7
0
votes
1 answer

contoling an interval in a linedit for ints

I have a lineEdit I use so the user can enter a frequency interval, // Making the lineedit objects only accept numbers and align it leftside ui->frequency->setValidator(new QIntValidator(36, 1000,…
SamuelNLP
  • 4,038
  • 9
  • 59
  • 102
0
votes
1 answer

QLineEdit and findChild()

I am trying to set the text of a line edit that is found using findChild() mainwindow.cpp void MainWindow::setValue(QString line, QString value){ QLineEdit * edit = centralWidget()->findChild(line); …
moesef
  • 4,641
  • 16
  • 51
  • 68
0
votes
1 answer

Qt - How to Use Key Pressed Event for a LineEdit which accepts only the Integers

I'm a new bie to Qt C++.. I have a QLineEdit. In which i have to Enter only the integers. If i press an Alphabet or any any other character my QLineEdit should not accept it. How to do this in qt with C++? Please Help To solve this.
New Moon
  • 787
  • 6
  • 21
  • 35
0
votes
1 answer

How to set the different QLineEdit Text in a TableView

I have 3 QLineEdits (say Name, Address & Phone No.), a QPushButton (Add button) and a QTableView. When I have entered text in all the QLineEdits, and if I click the Add button, all 3 texts of the QLineEdits should be added in the first row of the…
New Moon
  • 787
  • 6
  • 21
  • 35
0
votes
1 answer

preesing enter on QLineEdit terminates the screen

i have a QLineEdit on my main screen define by QDialog.along with it i have a table which contains dynamic data displayed by QThread with 50 data in every 2 seconds.when i input any value in QLinrEdit and then press enter then the screen…
Mcolorz
  • 145
  • 1
  • 5
  • 20
0
votes
0 answers

QtJambi - Unicode QLineEdit?

Is it possible to set QLineEdits in QtJambi to show unicode text? I need to display unicode subscript characters in a QLineEdit, though just setting the text of the QLineEdit results in aesthetic error ( A strange line character; | ). I've read…
Anti Earth
  • 4,671
  • 13
  • 52
  • 83
0
votes
1 answer

Qt: How do I make loops that wait for user input on each iteration?

I'm not sure how to make the loop wait and iterate with a different input. For example: DO { // DO STUFF }WHILE (Whatever is in lineEdit widget is not 'N') // User picks between Y and N However, I can't seem to implement any way to wait at the…
Louis93
  • 3,843
  • 8
  • 48
  • 94
0
votes
2 answers

Qt : Tooltip on wrong input

I have a QLineEdit, on which I have set a QRegExpValidator, that allows the user to input only one whitespace between words. Now I want that whenever the user tries to enter more than one whitespaces, the tooltip of the QLineEdit should show up, but…
Jaydeep Solanki
  • 2,895
  • 5
  • 36
  • 50
-1
votes
1 answer

Get the len of QLineEdit in PyQt5

I am writing a project that comes and takes the file address(path) from the user. And when the user clicks on the next button, she enters the loading page. I encountered a problem here that when the user does not specify the address and path of the…