summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authoraavit <qt-info@nokia.com>2011-10-26 10:58:13 +0200
committeraavit <qt-info@nokia.com>2011-10-26 10:58:13 +0200
commit4310e4325498fa6613aef53d61f2c5e1cec151c8 (patch)
tree8cca71edbd04ef311acdc12f9736e2be500d5766 /src/gui/text
parent207fb45ce7bac66ab53a0770d2bfb50d8d1997d8 (diff)
parent9ff6bc28d5977bde97e8429328028e46572be445 (diff)
Merge remote-tracking branch 'qt-mainline/4.8'
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontengine_win.cpp5
-rw-r--r--src/gui/text/qtextcontrol.cpp8
2 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp
index fc11387367..bb5e041a33 100644
--- a/src/gui/text/qfontengine_win.cpp
+++ b/src/gui/text/qfontengine_win.cpp
@@ -138,8 +138,11 @@ static void resolveGetCharWidthI()
{
if (resolvedGetCharWidthI)
return;
+
+ QSystemLibrary gdi32(QLatin1String("gdi32"));
+ ptrGetCharWidthI = (PtrGetCharWidthI)gdi32.resolve("GetCharWidthI");
+
resolvedGetCharWidthI = true;
- ptrGetCharWidthI = (PtrGetCharWidthI)QSystemLibrary::resolve(QLatin1String("gdi32"), "GetCharWidthI");
}
#endif // !defined(Q_WS_WINCE)
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index aeeef85c9e..5babbc22ef 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -408,7 +408,6 @@ void QTextControlPrivate::init(Qt::TextFormat format, const QString &text, QText
setContent(format, text, document);
doc->setUndoRedoEnabled(interactionFlags & Qt::TextEditable);
- q->setCursorWidth(-1);
}
void QTextControlPrivate::setContent(Qt::TextFormat format, const QString &text, QTextDocument *document)
@@ -2236,7 +2235,10 @@ int QTextControl::cursorWidth() const
{
#ifndef QT_NO_PROPERTIES
Q_D(const QTextControl);
- return d->doc->documentLayout()->property("cursorWidth").toInt();
+ int width = d->doc->documentLayout()->property("cursorWidth").toInt();
+ if (width == -1)
+ width = QApplication::style()->pixelMetric(QStyle::PM_TextCursorWidth);
+ return width;
#else
return 1;
#endif
@@ -2248,8 +2250,6 @@ void QTextControl::setCursorWidth(int width)
#ifdef QT_NO_PROPERTIES
Q_UNUSED(width);
#else
- if (width == -1)
- width = QApplication::style()->pixelMetric(QStyle::PM_TextCursorWidth);
d->doc->documentLayout()->setProperty("cursorWidth", width);
#endif
d->repaintCursor();