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

Force QCompleter to reappear if user selects directory

I have a dialog where user selects file(s). I added QCompleter to the line edit, which automatically suggests next file name: However if user clicks on file, the suggestions disappear: I want them to reappear if directory is selected and display…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
0
votes
1 answer

QLineEdit.setText only works once in function

I'm currently trying to program for my bachelor thesis. The main part works, so now I want to implement a user interface. I watched some tutorials and worked via trial and error, and my user interface also works. So far so good. But yesterday I…
grün21
  • 15
  • 4
0
votes
1 answer

Define array of QLineEdits in header

I'm trying to define my array of QLineEdits in my header, however im getting an error of "Storage class specified for 'edits'." I have, header.hh private: extern QLineEdit edits[8]; source.cpp void source::setup() { QLineEdit edits[8] = {…
easty
  • 35
  • 6
0
votes
1 answer

How to link up calculations and QLineEdit

I have a problem with managing to code the simple calculator. I have two QLineEdits, which I want to connect together, do simple calculations as addition, multiplication, and then show the result in the third QLineEdit, as shown in this picture.
user6398078
0
votes
1 answer

Qt: Synchronous QLineEdit and QTextEdit

I have a Qt project that has a UI with many QLineEdits and one QTextEdit. I just want to merge the input of the individual QLineEdits into the QTextEdit. For example: when someone types in the first QLineEdit, I want the QTextEdit's first line to…
0
votes
1 answer

How to assign the horizontal gradient to QLineEdit background

The code creates a QLineEdit with the background gradient running from top to bottom. How to make the gradient to go from side to side (essentially turn the Vertical to Horizontal gradient used as background)? line = QtGui.QLineEdit() …
alphanumeric
  • 17,967
  • 64
  • 244
  • 392
0
votes
1 answer

how to subclass QLineEdit to have index

I need to subclass a PyQt5 QLineEdit so that it has an index, such that I could access it by: stringvariable = LineEdit(0).text() stringvariable = LineEdit(1).text() stringvariable = LineEdit(2).text() Is this possible?
nlgootee
  • 35
  • 8
0
votes
2 answers

Python: Connect QlineEdit with QlcdNumber via button

Why doesn't the content of the edit box get transferred into the lcdNumber field? class MainDialog (QDialog, MultiTool_widget_ui.Ui_Form): def __init__(self): #super(MainDialog, self).__init__() OR
Creatronik
  • 189
  • 3
  • 18
0
votes
1 answer

Get the text from a variable and show it in a QLineedit in a different class

I'm trying to get the text of a veriable from a class A, and use the text of it in a QLineEditto show it every time that the text changes in the variable. Something like this: class A(self): variable = None def __init__(self): pass def…
Pablo Flores
  • 667
  • 1
  • 13
  • 33
0
votes
1 answer

Set pattern in QLineEdits for tabs

I have multiple QLineEdit-objects in my user interface, designed with QtDesigner. Now I want to set a pattern in which I can circle through them using the tab-key. Is that possible using code?
arc_lupus
  • 3,942
  • 5
  • 45
  • 81
0
votes
1 answer

Why is QLineEdit::setCursorPosition(int) selecting(highlighting) text?

I have an editable QComboBox that allows a user to type in a name for a new object and add it to the list. They can also edit names for existing items in the list. The problem is...say I have an item in the list called "AF" and I want to rename it…
Doggman9
  • 23
  • 4
0
votes
0 answers

QLineEdit password obfuscation

I am trying to implement a Login process with QT, and I'm curious about the safety of the QLineEdit widget. As I have seen online it seems that password remains stored even when QLineEdit is destroyed. Does overwriting with…
LeFrillo
  • 15
  • 7
0
votes
1 answer

How to increment QLineEdit name to access value?

This seems like a really simple question, but has me stumped. I've got a UI that has multiple QLineEdits for names, start, and end times. For example: clipName1, clipStart1, clipEnd1 clipName2, clipStart2, clipEnd2 clipName2, clipStart3,…
Zak44
  • 341
  • 1
  • 5
  • 24
0
votes
1 answer

Qt QSignalMapper is emitting a signal for every item in the map

I have a function that receives a QList of a class I created. Let's call this hypothetical class "Stuff". So, this function receives a QList of Stuff I iterate through the QList, and depending on the properties of the "Stuff" object, I will…
user751612
  • 163
  • 3
  • 8
0
votes
1 answer

Linking Qline edit with combo box in qt c++

I want to load the value of book name to a text box when I select the book Id from the comboBox. First I wrote the code for loading Book Ids to comboBox from database and it loaded perfectly. This is the method. void…
user3279893
  • 147
  • 3
  • 16