The answer is probably really simple but I searched like 30 mins and couldn't find anything. I just want to set QLineEdit like what does \n
do. To be more specific, when I start to type in QLineEdit, if it's a long sentence and bigger than the width of QLineEdit, it's going straight like forever. I want to start it on a new line when the text is reach end of the QLineEdit box. Even I press enter while typing, it does not go to a new line. How can I fix this? Is QLineEdit only 1 row and doesn't go bottom line?
Asked
Active
Viewed 1,020 times
-1

GLHF
- 3,835
- 10
- 38
- 83
-
Read the first line of [the documentation](http://doc.qt.io/qt-5/qlineedit.html). – BrenBarn May 30 '16 at 19:10
-
@BrenBarn Yep as I thought, then is there a method like what I want like QLineEdit? – GLHF May 30 '16 at 19:10
-
Perhaps [QTextEdit](http://doc.qt.io/qt-5/qtextedit.html), or perhaps try googling for what you specifically need. – BrenBarn May 30 '16 at 19:12
1 Answers
0
The "Line" is right there in its name, so yes, it supports "only 1 row".
The QLineEdit widget is a one-line text editor.
What you want is QPlainTextEdit
or QTextEdit
if you need styling.

Aleksei Zabrodskii
- 2,220
- 3
- 19
- 41