Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get the content of QLineEdit

Tags:

c++

qt

I want to use QLineEdit for input. My problem is that I don't know how I can read its contents.

Let's say I have:

QLineEdit *edit = new QLineEdit("");

After adding it to the GUI how can get the content? Thanks in advance.

like image 838
Engine Avatar asked Jan 10 '13 13:01

Engine


People also ask

What is the qlineedit widget?

The QLineEdit widget is a one-line text editor. More... A line edit allows the user to enter and edit a single line of plain text with a useful collection of editing functions, including undo and redo, cut and paste, and drag and drop (see setDragEnabled ()).

How do I suppress text in qlineedit?

The most common setting is Normal, in which the text entered by the user is displayed verbatim, but QLineEdit also supports modes that allow the entered text to be suppressed or obscured: these include NoEcho, Password and PasswordEchoOnEdit. The widget's display and the ability to copy or drag the text is affected by this setting.

What is PyQt5 qlineedit?

Last Updated : 18 Aug, 2020 QLineEdit : It allows the user to enter and edit a single line of plain text with a useful collection of editing functions, including undo and redo, cut and paste, and drag and drop. It is the basic widget in PyQt5 to receive keyboard input, input can be text, numbers or even symbol as well.

How to change the size of labels in qlineedit?

An input box or line edit is added to the window, this is called a QLineEdit. You can connect every keypress in the input box ( QLineEdit) with a method call. In that method set the labels text and adjust the labels size.


1 Answers

It has a text property, so simply do:

edit->text();
like image 176
Angew is no longer proud of SO Avatar answered Oct 24 '22 04:10

Angew is no longer proud of SO