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 turn a Clickable QLineEdit to a normal one after first click?

I have a clickable lineEdit: > class ClickableLineEdit(QtGui.QLineEdit): #This is the Class which let you to have a clickable QLineEdit clicked = QtCore.pyqtSignal() def mousePressEvent(self, event): self.clicked.emit() …
Ash
  • 263
  • 3
  • 14
0
votes
1 answer

Qt4: Decorating a QLineEdit (painting around it)

I am trying to "decorate" a QLineEdit, or to be more accurate, to paint my own custom frame around it, to get the following result: I tried to use Qt Style Sheets (CSS), but this will only enable trivial frame decorating (changing…
so.very.tired
  • 2,958
  • 4
  • 41
  • 69
0
votes
1 answer

Applying max length to QLineEdit

ALL, In here I got a suggestion to override keyPressEvent in order to give a notification about the maximum length limit for QLineEdit. However, I believe this won't work if I try to paste the text from keyboard either by using Ctrl+V or context…
Igor
  • 5,620
  • 11
  • 51
  • 103
0
votes
1 answer

QT setInputMask() : how to interpolate string with user input in QLineEdit

I want the user to enter the input in QLineEdit in the following format Array {99, 99, 99, 99} where 1) Array { } is already present in the lineEdit. User only enters comma separated integers. 2) The no. of integers entered may vary. I tried using…
Sunit Gautam
  • 5,495
  • 2
  • 18
  • 31
0
votes
2 answers

Qt - QLineEdit doesn't update the page and URL

I've got a small problem with my web browser project. Whenever I enter the URL address (via QLineEdit), the browser doesn't show the page, and whenever I change the page (via click on-site with starting page included) the address doesn't show up on…
s4ilor
  • 29
  • 3
0
votes
2 answers

Event QComboBox to Custom QLineEdit

The Problem: I have a custom event on QLineEdit inside a custom QComboBox and only specific events are being passed from QComboBox to QLineEdit when I want. I can't get tab to be passed. I want when an event passed to QComboBox it will be passed to…
DevilGale
  • 63
  • 6
0
votes
0 answers

Problems with QTreeWidget

Good morning, I am learning about programming and GUI in Qt c++ and I have some doubts: Let's suppose you have this GUI shown in the picture. No worries about how has it been created. It has: QTreeWidget QLineEdit QPushButton1 QPushButton2 How…
Minikornio
  • 47
  • 5
0
votes
1 answer

setSpacing does not work for QHBoxLayout?

I need to create an element like ComboBox which is combination of LineEdit and a Button. QHBoxLayout *lineEditWithButtonForm = new QHBoxLayout( this ); lineEditWithButtonForm->setSpacing( 0 ); lineEditWithButtonForm->setContentsMargins( 0, 0, 0, 0…
gnase
  • 580
  • 2
  • 10
  • 25
0
votes
2 answers

Customizing QLineEdit

I have read some posts but none of them apply to what I want to do. I need a QLineEdit that will edit a vector of numbers (let's say a vector of 3 doubles). I want to represent my vector in parenthesis in the QLineEdit and separate the vector…
santahopar
  • 2,933
  • 2
  • 29
  • 50
0
votes
0 answers

Getting an input from QLineEdit and sending it to another python file for calculation

I am writing a GUI. My GUI receives an integer input through QLineEdit and the input should be transferred to another python script where it performs calculations. The GUI.py file calls the python file Calculation.py through subprocess.call. When I…
Krish
  • 35
  • 6
0
votes
1 answer

Qt - style characters from index x to the end

How to style characters from index x (eg. x=10) to end of text in QLineEdit? Example: Text in QLineEdit: 0123456789 And I want make characters from index 2 (that is 2) to the end should be bold. 0123456789
Guruku
  • 653
  • 1
  • 7
  • 6
0
votes
0 answers

QLineEdit should have a fixed size

I have designed an UI with Qt but I am facing an issue. In my UI I use two QLineEdit for IP addresses. They have a fixed width using setFixedWidth. When the childWidget that contains them is set on top with parentLayout->setAlignment(&childWidget,…
Laurent Mesguen
  • 354
  • 2
  • 6
  • 22
0
votes
1 answer

QLineEdit returns empty string

I'm trying to access the text written in a QLineEdit from another class, but it is returning an empty string. Here is a minimalistic functional piece of code (Python 2.7): import sys from PyQt5 import QtWidgets, QtGui, QtCore from PyQt5.QtWidgets…
Iridium
  • 31
  • 1
  • 8
0
votes
1 answer

Validate XML value input in Qt?

I would like to avoid code injections, so I subclassed a QValidator for check, if string in QLineEdit does not contain "dangerous" chars f.e. <,>,&,",'. Is there any simpler way to validate input from given string? Thank you for your…
0
votes
0 answers

setInputMask leads to thick cursor

When using setInputMask the text-cursor width changes. Due to that I can't place the cursor between two characters but it selects the whole character. Is there a way to bypass this behaviour?
easysaesch
  • 159
  • 1
  • 14