diff options
author | aavit <qt-info@nokia.com> | 2011-10-26 08:58:13 (GMT) |
---|---|---|
committer | aavit <qt-info@nokia.com> | 2011-10-26 08:58:13 (GMT) |
commit | 4310e4325498fa6613aef53d61f2c5e1cec151c8 (patch) | |
tree | 8cca71edbd04ef311acdc12f9736e2be500d5766 /src/gui/text | |
parent | 207fb45ce7bac66ab53a0770d2bfb50d8d1997d8 (diff) | |
parent | 9ff6bc28d5977bde97e8429328028e46572be445 (diff) | |
download | Qt-4310e4325498fa6613aef53d61f2c5e1cec151c8.zip Qt-4310e4325498fa6613aef53d61f2c5e1cec151c8.tar.gz Qt-4310e4325498fa6613aef53d61f2c5e1cec151c8.tar.bz2 |
Merge remote-tracking branch 'qt-mainline/4.8'
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfontengine_win.cpp | 5 | ||||
-rw-r--r-- | src/gui/text/qtextcontrol.cpp | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index fc11387..bb5e041 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 aeeef85..5babbc2 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(); |