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

How can i take an input from a QLineEdit with python, and put it into a variable when the user hits enter? I'd like not to use the event filter

I just need to know how can i link the value typed into the QLine, to a variable. I tried various methods like the returnPressed() but it didnt work. I already checked other questions, but i'd like to avoid the event filter. thanks from PySide.QtGui…
0
votes
1 answer

QLineEdit: automatically append backslash to directory name

I'm trying to automatically add a backslash to valid file paths in a QLineEdit, which is used to show the current path of a QFileSystemModel. The code looks as follows: fileSystem = new…
Nicolas Holthaus
  • 7,763
  • 4
  • 42
  • 97
0
votes
1 answer

Erase all the inputs with a button

I use for loop to create several QLineEdits, and going to create a button which can erase everything written in all the QLineEdits. It means if I type something in every QLine, and click the button can clear all the lines. My question is how to…
EricBkc
  • 369
  • 2
  • 4
  • 12
0
votes
2 answers

How to make a QLineEdit follow the cursor to show me its coordinates

I want my QWidget to show me the coordinates of my cursor when it's on the Image, I read that the best way is to use QLineEdit, but I didn't find how to use it to do so. How to initiate the QLineEdit and how to show it, in order that it follows the…
Othman Benchekroun
  • 1,998
  • 2
  • 17
  • 36
0
votes
1 answer

How to turn off QAbstractButton animateClick when lineEdit has focus

I am new to QT GUI programming and I am using QT Creator. The problem I am seeing is with my pushbutton and line edit when the user presses the enter key. My program opens a groupbox and allows the user to enter a password and press ok or cancel.…
Ivory244
  • 975
  • 1
  • 8
  • 12
0
votes
0 answers

paste is disabled on QlineEdit using PyQt

I made a simple application in PyQt for inserting data in a database. I used multiples QlineEdit and in all of them I can copy, cut, undo etc. but I cannot paste text. If I right-click on the QlineEdit 'paste' is disabled. Here below the code where…
user3774162
  • 1
  • 1
  • 2
0
votes
1 answer

qt change QLineEdit shape

I'm trying to create a custom shape QLineEdit with QWidget::setMask(). I redefined resizeEvent for my sub class lineEdit. void MyLineEdit::resizeEvent(QResizeEvent *ev) { QPixmap pixmap(":/new/prefix1/region.png"); setFixedSize(ev->size()); …
Mike Shaw
  • 373
  • 7
  • 22
0
votes
1 answer

Pyside retrieving a user input from QLineEdit

I have a QLineEdit object which I use to retrieve the user input. I am doing .text() to get the text. However it returns me something like I just want to get the string inside the Line Edit box. Just…
someuser
  • 43
  • 1
  • 8
0
votes
2 answers

Firing Keyboard event on focusing QlineEdit?

Is there any way for firing external keyboard event after focusing on a specific QlineEdit. Actually, I am developing a multi language application in qt in which I want google tools to be turned off & on based on the line edit on which it is…
krohit
  • 792
  • 1
  • 7
  • 26
0
votes
1 answer

QLineEdit::setInputMask( const QString &mask ) - does not work

Here is the code: // Latitude line edit QLineEdit *lineEdit = new QLineEdit; lineEdit->setInputMask( ">\N999999.99;_" ); But, I am getting compiler warning: Unknown escape sequence '\N' and QLineEdit text does not contain 'N' character, only…
pau
  • 352
  • 3
  • 14
0
votes
1 answer

QT Creator QlineEdit

I am very new to Qt and I have a problem with the QlineEdit. When I run the program it shows me the QSpinEdit not the QLineEdit box. I need to enter 3 values in the QlineEdit and calculate a mark which will display in QMessageBox #include…
user1291092
  • 105
  • 4
  • 9
0
votes
1 answer

QLineEdit setSelection doesn't work

I created a custom QLineEdit for timecode (a timecode looks like this : hh:mm:ss:ff) edition. It react with the keyboard and the mouse. If the user edit the timecode with the mouse (draging up/down a couple of digit) the highlighting is wrong : it…
Thomas Ayoub
  • 29,063
  • 15
  • 95
  • 142
0
votes
2 answers

store input of line edit to string qt

I'm a beginner.I am making a simple gui program using qt in which you enter a url/website and that program will open that webpage in chrome.I used line edit in which user enters url and i used returnPressed() slot, but the problem is (it might sound…
Amol Borkar
  • 2,321
  • 7
  • 32
  • 63
0
votes
1 answer

Can't use QString in a QLineEdit nor QComboBox as a parameter

I'm trying to make a function that replace the text inside a QLineEdit when the user want to revert is name to default using a QPushButton. This is where the code is getting "saved". `//Must get information in the DB lineditPlayerName = new…
Chax
  • 1,041
  • 2
  • 14
  • 36
0
votes
2 answers

qstring to short format for qlineedit

I tried this code but still have problem for QString to short value for example it work well for text = 20 but it return 0 for value = 20.5. but I need value=20. how can I solve it? inline __int16 GetStaticToInteger(QLineEdit* lineEdit) { …
citi
  • 31
  • 2
  • 7