summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qlinecontrol_p.h
diff options
context:
space:
mode:
authorAdriano Rezende <adriano.rezende@openbossa.org>2009-09-08 11:15:49 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-08 11:17:50 (GMT)
commita9572a07f1512fe1266629632e5c4f1613abeb8d (patch)
tree8ac39bf3b49d8f9ee3879f9ba7edead81b7e55e8 /src/gui/widgets/qlinecontrol_p.h
parent9d9b7f53750dce2da88d7d11d312b4b36250b5c5 (diff)
downloadQt-a9572a07f1512fe1266629632e5c4f1613abeb8d.zip
Qt-a9572a07f1512fe1266629632e5c4f1613abeb8d.tar.gz
Qt-a9572a07f1512fe1266629632e5c4f1613abeb8d.tar.bz2
Fixed QLineEdit to correctly adjust the horizontal scrolling
The widget needs to use the naturalTextWidth to adjust the horizontal scrolling, otherwise it will not fit correctly the text in the visible area when resized. Merge-request: 1410 Reviewed-by: Alan Alpert
Diffstat (limited to 'src/gui/widgets/qlinecontrol_p.h')
-rw-r--r--src/gui/widgets/qlinecontrol_p.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h
index a81f138..f46abf1 100644
--- a/src/gui/widgets/qlinecontrol_p.h
+++ b/src/gui/widgets/qlinecontrol_p.h
@@ -109,6 +109,7 @@ public:
int width() const;
int height() const;
int ascent() const;
+ qreal naturalTextWidth() const;
void setSelection(int start, int length);
@@ -410,6 +411,11 @@ inline int QLineControl::width() const
return qRound(m_textLayout.lineAt(0).width()) + 1;
}
+inline qreal QLineControl::naturalTextWidth() const
+{
+ return m_textLayout.lineAt(0).naturalTextWidth();
+}
+
inline int QLineControl::height() const
{
return qRound(m_textLayout.lineAt(0).height()) + 1;