summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-15 17:11:11 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-15 17:11:11 (GMT)
commit7455ba4fdc82bc8e7174184090ddfbf03c312446 (patch)
tree4c30852ee30c8974b2482c5525dc8046a4d0cb52 /src/gui/text
parentf95d5bde3ba66dd182802addd15dabbfa85611e1 (diff)
parent42dda19d82ceea48f19d356cfaf2b26acb763df8 (diff)
downloadQt-7455ba4fdc82bc8e7174184090ddfbf03c312446.zip
Qt-7455ba4fdc82bc8e7174184090ddfbf03c312446.tar.gz
Qt-7455ba4fdc82bc8e7174184090ddfbf03c312446.tar.bz2
Merge remote branch 'qt/master' into staging-2-master
Conflicts: tests/auto/qlineedit/tst_qlineedit.cpp
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfont.cpp5
-rw-r--r--src/gui/text/qfontengine_s60.cpp2
-rw-r--r--src/gui/text/qtextcontrol.cpp8
-rw-r--r--src/gui/text/qtextlayout.cpp6
-rw-r--r--src/gui/text/qzipreader_p.h4
5 files changed, 16 insertions, 9 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index bbd35f1..dd9e69e 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -629,8 +629,9 @@ QFontEngineData::~QFontEngineData()
Returns the name of the font within the underlying window system.
- Only on X11 when Qt was built without FontConfig support the XLFD (X Logical Font Description)
- is returned; otherwise an empty string.
+ On X11, this function will return an empty string if Qt is built with
+ FontConfig support; otherwise the XLFD (X Logical Font Description) is
+ returned.
Using the return value of this function is usually \e not \e
portable.
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp
index 9dd4af7..3ea084b 100644
--- a/src/gui/text/qfontengine_s60.cpp
+++ b/src/gui/text/qfontengine_s60.cpp
@@ -44,7 +44,7 @@
#include "qglobal.h"
#include <private/qapplication_p.h>
#include "qimage.h"
-#include "qt_s60_p.h"
+#include <private/qt_s60_p.h>
#include <e32base.h>
#include <e32std.h>
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 8d3923f..f345cd1 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -441,7 +441,6 @@ void QTextControlPrivate::setContent(Qt::TextFormat format, const QString &text,
QObject::connect(doc, SIGNAL(documentLayoutChanged()), q, SLOT(_q_documentLayoutChanged()));
// convenience signal forwards
- QObject::connect(doc, SIGNAL(contentsChanged()), q, SIGNAL(textChanged()));
QObject::connect(doc, SIGNAL(undoAvailable(bool)), q, SIGNAL(undoAvailable(bool)));
QObject::connect(doc, SIGNAL(redoAvailable(bool)), q, SIGNAL(redoAvailable(bool)));
QObject::connect(doc, SIGNAL(modificationChanged(bool)), q, SIGNAL(modificationChanged(bool)));
@@ -452,8 +451,11 @@ void QTextControlPrivate::setContent(Qt::TextFormat format, const QString &text,
if (!document)
doc->setUndoRedoEnabled(false);
+ //Saving the index save some time.
+ static int contentsChangedIndex = QTextDocument::staticMetaObject.indexOfSignal("contentsChanged()");
+ static int textChangedIndex = QTextControl::staticMetaObject.indexOfSignal("textChanged()");
// avoid multiple textChanged() signals being emitted
- QObject::disconnect(doc, SIGNAL(contentsChanged()), q, SIGNAL(textChanged()));
+ QMetaObject::disconnect(doc, contentsChangedIndex, q, textChangedIndex);
if (!text.isEmpty()) {
// clear 'our' cursor for insertion to prevent
@@ -488,7 +490,7 @@ void QTextControlPrivate::setContent(Qt::TextFormat format, const QString &text,
}
cursor.setCharFormat(charFormatForInsertion);
- QObject::connect(doc, SIGNAL(contentsChanged()), q, SIGNAL(textChanged()));
+ QMetaObject::connect(doc, contentsChangedIndex, q, textChangedIndex);
emit q->textChanged();
if (!document)
doc->setUndoRedoEnabled(previousUndoRedoState);
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 26c7c1e..af91603 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1331,7 +1331,7 @@ void QTextLayout::drawCursor(QPainter *p, const QPointF &pos, int cursorPosition
QTextLine l(line, d);
const QScriptLine &sl = d->lines[line];
- const qreal x = position.x() + l.cursorToX(cursorPosition);
+ qreal x = position.x() + l.cursorToX(cursorPosition);
int itm = d->findItem(cursorPosition - 1);
QFixed base = sl.base();
@@ -1350,6 +1350,10 @@ void QTextLayout::drawCursor(QPainter *p, const QPointF &pos, int cursorPosition
&& (p->transform().type() > QTransform::TxTranslate);
if (toggleAntialiasing)
p->setRenderHint(QPainter::Antialiasing);
+#if defined(QT_MAC_USE_COCOA)
+ // Always draw the cursor aligned to pixel boundary.
+ x = qRound(x);
+#endif
p->fillRect(QRectF(x, y, qreal(width), (base + descent + 1).toReal()), p->pen().brush());
if (toggleAntialiasing)
p->setRenderHint(QPainter::Antialiasing, false);
diff --git a/src/gui/text/qzipreader_p.h b/src/gui/text/qzipreader_p.h
index 67a2ace..9b73373 100644
--- a/src/gui/text/qzipreader_p.h
+++ b/src/gui/text/qzipreader_p.h
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
class QZipReaderPrivate;
-class Q_AUTOTEST_EXPORT QZipReader
+class Q_GUI_EXPORT QZipReader
{
public:
QZipReader(const QString &fileName, QIODevice::OpenMode mode = QIODevice::ReadOnly );
@@ -73,7 +73,7 @@ public:
bool isReadable() const;
bool exists() const;
- struct Q_AUTOTEST_EXPORT FileInfo
+ struct Q_GUI_EXPORT FileInfo
{
FileInfo();
FileInfo(const FileInfo &other);