I've got a QList of QLineEdit*'s
QList<QLineEdit*> example;
Example will hold 100 items of lineEdits.
When I try to save or load to a file, it fails to save or load the QList properly, if at all. I get a much lower than expected count of data.
I see on QList<T>'s resource page here that there's the correct operator for << & >>,
ho...
In Qt, there is a QCompleter class which provides auto-complete funtionanity.
I want to use QListView to finish the same thing. In the following code, When the QListView shows, QLineEdit will lose focus. How could I keep QLineEdit's focus?
1) mdict.h:
#include <QtGui/QWidget>
class QLineEdit;
class QListView;
class QModelIndex;
class...
I'm trying to keep track of the textChanged() signal on for handful of QTextEdits. I want to do the same thing regardless of the text edit emitting the signal: uncheck its associated checkbox in a QListWidget if it becomes empty and leave it checked otherwise. The function I have so for is as follows:
void MainWindow::changed()
{
QS...
I have a series of QTextEdits and QLineEdits connected to a slot through a QSignalMapper(which emits a textChanged(QWidget*) signal). When the connected slot is called (pasted below), I need to be able to differentiate between the two so I know whether to call the text() or toPlainText() function. What's the easiest way to determine the ...
I have a QLabel and a QLineEdit inside a QWidget. When I have the widget inside a QScrollArea, the line edit does not expand to occupy the excess width of the window. When the widget is not inside the scroll area, it does expand.
I've tried setting the size policy of the line edit and the widget, to expand horizontally, but it doesn't ...
I found that I can set a tooltip on a QLineEdit as such:
equation = new QLineEdit();
equation->setToolTip("Example: a*b+c+~c");
However, I would like the tooltip to be displayed when that QLineEdit is focused.
How do I do that?
Thanks in advance.
...
I have a Qt widget which should only accept a hex string as input. It is very simple to restrict the input characters to [0-9A-Fa-f], but I would like to have it display with a delimiter between "bytes" so for example if the delimiter is a space, and the user types 0011223344 I would like the line edit to display 00 11 22 33 44 Now if th...
I want to be able to know if in the QLineEdit it was a click. So I guess I should reimplement the following function(??):
void QLineEdit::focusInEvent ( QFocusEvent * e ) [virtual protected]
How I should do that?
Also, please tell me how to use focusInEvent() function in order to know if QLineEdit myEdit; object got focus.
EDIT: H...
I have given my code below, have problem in implementing a function
I want the text in lineedit with objectname 'host' in a string say 'shost'. when the user click the pushbutton with name 'connect'.How do i do it? I tried and failed. How to implement this function?
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
...
Hi,
I have created a dialog using qt designer. There is a QLineEdit object in the dialog with some default content. When dialog initializes focus goes to the QLineEdit, I want the default content to be auto selected so once user start writing previous content will be overwritten.
Thanks,
GG
[EDIT]
{ in constructor }
dialog->accept(); ...
I have a QLineEdit, and I want to set a placeholder text. When I call setPlaceholderText(string) I get an AttributeError, but:
>>> from PyQt4 import QtCore
>>> QtCore.PYQT_VERSION_STR
'4.7.4'
>>> QtCore.QT_VERSION_STR
'4.7.0'
and from the QAssistant:
This property holds the line edit's
placeholder text.
...
This property was...