Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
4.8.7, 5.5.1
-
None
-
Kubuntu 16.04, Qt packages from Ubuntu repositories.
Description
According to the documentation QStyle::PM_TextCursorWidth is supposed to report the width of the text cursor in QLineEdit and QTextEdit widgets.
It appears to report the width of a normal cursor, even when you set an input mask. When an input mask is set, the cursor grows wider. On my system it's 5 pixels instead of 1.
Repro:
- Place the below code in another widget, e.g. QMainWindow
- Run program
- Observe cursor is wider than usual, even when the cursor is at EOL
- Observe "1" in the debug output
QLineEdit* line_edit = new QLineEdit; layout()->addWidget(line_edit); line_edit->setInputMask("HHHHHHHH"); QStyleOption option; option.initFrom(line_edit); qDebug() << line_edit->style()->pixelMetric(QStyle::PM_TextCursorWidth, &option, line_edit);