Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.4.0
-
None
Description
I one uses the methods text() and displayText() on a QLineEdit, the documentation states the it should return the same value. When a inputMask("HHHH;0") is set, the values are no longer the same.
On Tue Jul 22 11:17:39 2008 Morten Engvoldsen wrote:
- How to reproduce:
1. Build and compile the code.
2. Start the application
- Expected result:
Both labels should contain the same string "0100" - Actual result:
One label sais "0100" and the other "1"
Contents:
#include <QtGui>
class MainWidget : public QWidget {
Q_OBJECT
public:
MainWidget();
QLabel *label_1,*label_2;
QLineEdit *lineEdit;
};
MainWidget::MainWidget(){
lineEdit = new QLineEdit("0100",this);
lineEdit->setInputMask("HHHH;0");
label_1 = new QLabel(" String: '" + lineEdit->text() + "'");
label_2 = new QLabel(" String: '" + lineEdit->displayText() + "'");
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(lineEdit);
layout->addWidget(label_1);
layout->addWidget(label_2);
setLayout(layout);
}
int main(int argc, char *argv[])
{ QApplication app(argc, argv); MainWidget mainWid; mainWid.show(); return app.exec(); }#include "main.moc"