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
1 answer

Retrieving information from QLineEdit as soon as there is input?

I have the following PyQT code: self.datestartbox = QLineEdit(self) # Create a textbox self.dateendbox = QLineEdit(self) # Create a textbox How can I get the user input as soon there is text in the fields? At the moment I can only get it when user…
Markus T
  • 19
  • 3
0
votes
1 answer

How to get value form QLineEdit() pyqt5 with pushing button

I have created the QLineEdit object and trying to get valuse from this widget, but at the end I've got an error: qlineedit1 = QLineEdit() qlineedit1.setFixedSize(btn_x_size, btn_y_size) gridLayout.addWidget(qlineedit1, i, j) value =…
Alex D
  • 23
  • 1
  • 7
0
votes
1 answer

QTableWidget and QLineEdit - position and text content

I'm having a hard time figuring out how to get the position(column and row) and the content in the QLineEdit. I'm using a eventFilter to get the signal but from there i'm stuck. any advice? Thank you ui->tableWidget->setRowCount(5); …
VMI
  • 61
  • 10
0
votes
1 answer

Qt - Get numbers in specific area (from QLineEdit)

I have a QTableWidget with some columns and rows and want to add a filter for a particular column. For that, I've added a QLineEdit in my Window. I'm already able to filter the rows, when I add only one number in the QLineEdit: for(int i=0;…
erniberni
  • 313
  • 5
  • 17
0
votes
1 answer

QLineEdit doubleValidator starting with point

I have a UI with a QLineEdit which only accepts float/double values with the help of a QDoubleValidator. It only accepts values if I enter a leading number like: 0.234. But I'd prefer to be able to enter values directly without a leading number like…
haggi krey
  • 1,885
  • 1
  • 7
  • 9
0
votes
1 answer

Each subject has a subject code.When i select one subject its subject code should be displayed in the edit box

I have a new QLineEdit(box) for the subject code.Each subject has a subject code(for eg Sentiment Analysis has code CS01,Data Cleansing has CS02,etc.).When i select one subject(Sentiment Analysis) its subject code(CS01) should be displayed in the…
Rakshith
  • 77
  • 1
  • 7
0
votes
1 answer

Python: Having multiple QLineEdit boxes (pyqt4)

I would like to have 2 input text boxes next to each other. I've attempted to copy/past the code for one text box but that has not yielded the proper result. Only one text box shows. If possible I'd like to get the labels to sit in-line with the…
0
votes
1 answer

Type values in lineedit and then add it to a comboBox by clicking a button? PyQt4

I want to add multiple value typed in lineedit to a combobox by clicking a button (one value at one time). My sample codes are as below: import os, sys import PyQt4 from PyQt4.QtGui import * from PyQt4.QtCore import * class Example(QWidget): …
ryan9025
  • 267
  • 6
  • 17
0
votes
1 answer

By clicking a button, print some texts entered in QLineEdit when a checkbox is checked PyQt4

By clicking a button, I want to print some texts that is entered in QLineEdit when a checkbox is checked. My example codes are as below: import sys import PyQt4 from PyQt4 import QtGui, QtCore from PyQt4.QtGui import * from PyQt4.QtCore import…
ryan9025
  • 267
  • 6
  • 17
0
votes
1 answer

Application crashes on setupUi in QLineEdit consturctor only in MacOS

I have a Qt4.8 QWidget with generated Ui_ file class QMyWidget: public QWidget { Q_OBJECT public: Ui_MyGeneratedUi ui; ... } It works fine on Windows and Linux, but when I try to QMyWidget() { > ui.setupUi(this); ... } on MacOS…
0
votes
0 answers

Returning the values of a table view in one window to a line edit in another

The following code is used by me in order to send the value in a table view in one window to the line edit in another window. but i get an error! how can i correct it? void firstWindow::on_tableView_activated(const QModelIndex &index) { QString…
0
votes
1 answer

How to handle actions from context menu of a QLineEdit in Qt?

I would like to intercept the paste action of a QLineEdit context menu that is created by default in any QLineEdit widget (see picture below) Is there a way to redirect the Paste action of the context menu by any means?
Woltan
  • 13,723
  • 15
  • 78
  • 104
0
votes
2 answers

How to make linedit ready to be typed into when pushbutton is clicked

In my program, the user has to regularly push a button and then type a number into linedit. Every time the user clicks the button they have to click on the linedit again so they can type into it. Is there a way to automate this process so when the…
Abhi Garg
  • 73
  • 7
0
votes
1 answer

Qt: How to make custom widget that aligns like QTextField

I am trying to make a DirectoryEditWidget, i.e. a widget similar to a QLineEdit widget, but with a browse-button to allow the user to browse the file system for the directory. The functionality is working in the implementation below, but I would…
Janus
  • 5,421
  • 2
  • 26
  • 37
0
votes
1 answer

PyQt5 5.8.2 QLineEdit has no attribute 'setPlaceHolderText'

I'm trying figure out whats wrong with my PyQt5 install, I've looked at all the documentation and I should be able to use placeHolderText and setPlaceHolderText() but it doesn't look like it does. The QtWidgets.QLineEdit() works and shows up on my…
pulsair
  • 1
  • 3