diff options
Diffstat (limited to 'src/gui')
31 files changed, 302 insertions, 86 deletions
diff --git a/src/gui/image/qgifhandler_p.h b/src/gui/image/qgifhandler_p.h index bf4ba30e20..80c9e145c5 100644 --- a/src/gui/image/qgifhandler_p.h +++ b/src/gui/image/qgifhandler_p.h @@ -47,6 +47,17 @@ #ifndef QGIFHANDLER_P_H #define QGIFHANDLER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtGui/qimageiohandler.h> #include <QtGui/qimage.h> #include <QtCore/qbytearray.h> diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 32c81e39fa..72972ff163 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2927,6 +2927,8 @@ QImage QImage::mirrored_helper(bool horizontal, bool vertical) const result.d->colortable = d->colortable; result.d->has_alpha_clut = d->has_alpha_clut; result.d->devicePixelRatio = d->devicePixelRatio; + result.d->dpmx = d->dpmx; + result.d->dpmy = d->dpmy; do_mirror(result.d, d, horizontal, vertical); diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp index 195b56afbe..4fd598a6fe 100644 --- a/src/gui/image/qimage_conversions.cpp +++ b/src/gui/image/qimage_conversions.cpp @@ -163,7 +163,9 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im const uint *ptr = fetch(buffer, srcData, x, l); ptr = srcLayout->convertToARGB32PM(buffer, ptr, l, srcLayout, 0); ptr = destLayout->convertFromARGB32PM(buffer, ptr, l, destLayout, 0); - store(srcData, ptr, x, l); + // The conversions might be passthrough and not use the buffer, in that case we are already done. + if (srcData != (const uchar*)ptr) + store(srcData, ptr, x, l); x += l; } srcData += data->bytes_per_line; diff --git a/src/gui/image/qjpeghandler_p.h b/src/gui/image/qjpeghandler_p.h index f5676d9b14..4342782f03 100644 --- a/src/gui/image/qjpeghandler_p.h +++ b/src/gui/image/qjpeghandler_p.h @@ -42,6 +42,17 @@ #ifndef QJPEGHANDLER_P_H #define QJPEGHANDLER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtGui/qimageiohandler.h> #include <QtCore/QSize> #include <QtCore/QRect> diff --git a/src/gui/image/qpixmap_blitter_p.h b/src/gui/image/qpixmap_blitter_p.h index 1f723178d8..481fb0bc24 100644 --- a/src/gui/image/qpixmap_blitter_p.h +++ b/src/gui/image/qpixmap_blitter_p.h @@ -42,6 +42,17 @@ #ifndef QPIXMAP_BLITTER_P_H #define QPIXMAP_BLITTER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qpa/qplatformpixmap.h> #include <private/qpaintengine_blitter_p.h> diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 6f688c09aa..51b1db8cf1 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -176,7 +176,9 @@ bool QGuiApplicationPrivate::noGrab = false; static qreal fontSmoothingGamma = 1.7; extern void qRegisterGuiVariant(); +#ifndef QT_NO_ANIMATION extern void qRegisterGuiGetInterpolator(); +#endif extern void qInitDrawhelperAsm(); extern void qInitImageConversions(); @@ -588,6 +590,7 @@ QGuiApplication::~QGuiApplication() #endif //QT_NO_SESSIONMANAGER clearPalette(); + QFontDatabase::removeAllApplicationFonts(); #ifndef QT_NO_CURSOR d->cursor_list.clear(); @@ -1312,8 +1315,10 @@ void QGuiApplicationPrivate::init() // trigger registering of QVariant's GUI types qRegisterGuiVariant(); +#ifndef QT_NO_ANIMATION // trigger registering of animation interpolators qRegisterGuiGetInterpolator(); +#endif // set a global share context when enabled unless there is already one #ifndef QT_NO_OPENGL diff --git a/src/gui/kernel/qplatforminputcontextfactory.cpp b/src/gui/kernel/qplatforminputcontextfactory.cpp index ee80a70939..3e2f234d99 100644 --- a/src/gui/kernel/qplatforminputcontextfactory.cpp +++ b/src/gui/kernel/qplatforminputcontextfactory.cpp @@ -83,7 +83,7 @@ QPlatformInputContext *QPlatformInputContextFactory::create() QString icString = QString::fromLatin1(qgetenv("QT_IM_MODULE")); if (icString == QLatin1String("none")) - icString = QStringLiteral("compose"); + return 0; ic = create(icString); if (ic && ic->isValid()) diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp index 0c47005807..a7ff94ac4f 100644 --- a/src/gui/kernel/qplatformscreen.cpp +++ b/src/gui/kernel/qplatformscreen.cpp @@ -305,10 +305,10 @@ void QPlatformScreen::resizeMaximizedWindows() if (platformScreenForWindow(w) != this) continue; - if (w->windowState() & Qt::WindowFullScreen || w->geometry() == oldGeometry) - w->setGeometry(newGeometry); - else if (w->windowState() & Qt::WindowMaximized || w->geometry() == oldAvailableGeometry) + if (w->windowState() & Qt::WindowMaximized || w->geometry() == oldAvailableGeometry) w->setGeometry(newAvailableGeometry); + else if (w->windowState() & Qt::WindowFullScreen || w->geometry() == oldGeometry) + w->setGeometry(newGeometry); } } diff --git a/src/gui/kernel/qplatformtheme_p.h b/src/gui/kernel/qplatformtheme_p.h index 217c284a9e..f493037ddd 100644 --- a/src/gui/kernel/qplatformtheme_p.h +++ b/src/gui/kernel/qplatformtheme_p.h @@ -46,9 +46,11 @@ // W A R N I N G // ------------- // -// This file is part of the QPA API and is not meant to be used -// in applications. Usage of this API may make your code -// source and binary incompatible with future versions of Qt. +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. // #include <QtCore/QtGlobal> diff --git a/src/gui/kernel/qshapedpixmapdndwindow_p.h b/src/gui/kernel/qshapedpixmapdndwindow_p.h index 20674b6b19..1b56f47bd5 100644 --- a/src/gui/kernel/qshapedpixmapdndwindow_p.h +++ b/src/gui/kernel/qshapedpixmapdndwindow_p.h @@ -42,6 +42,17 @@ #ifndef QSHAPEDPIXMAPDNDWINDOW_H #define QSHAPEDPIXMAPDNDWINDOW_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtGui/QWindow> #include <QtGui/QPixmap> #include <QtGui/QBackingStore> diff --git a/src/gui/kernel/qsimpledrag_p.h b/src/gui/kernel/qsimpledrag_p.h index 36ea4c1ec5..d17440f7a2 100644 --- a/src/gui/kernel/qsimpledrag_p.h +++ b/src/gui/kernel/qsimpledrag_p.h @@ -39,8 +39,19 @@ ** ****************************************************************************/ -#ifndef QSIMPLEDRAG_H -#define QSIMPLEDRAG_H +#ifndef QSIMPLEDRAG_P_H +#define QSIMPLEDRAG_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// #include <qpa/qplatformdrag.h> diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 8c0db2c0c7..2cf4f41126 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -391,11 +391,30 @@ void QWindowPrivate::setTopLevelScreen(QScreen *newScreen, bool recreate) q->destroy(); connectToScreen(newScreen); if (newScreen && shouldRecreate) - q->create(); + create(true); emitScreenChangedRecursion(newScreen); } } +void QWindowPrivate::create(bool recursive) +{ + Q_Q(QWindow); + if (!platformWindow) { + platformWindow = QGuiApplicationPrivate::platformIntegration()->createPlatformWindow(q); + QObjectList childObjects = q->children(); + for (int i = 0; i < childObjects.size(); i ++) { + QObject *object = childObjects.at(i); + if (object->isWindowType()) { + QWindow *window = static_cast<QWindow *>(object); + if (recursive) + window->d_func()->create(true); + if (window->d_func()->platformWindow) + window->d_func()->platformWindow->setParent(platformWindow); + } + } + } +} + void QWindowPrivate::clearFocusObject() { } @@ -516,18 +535,7 @@ bool QWindow::isVisible() const void QWindow::create() { Q_D(QWindow); - if (!d->platformWindow) { - d->platformWindow = QGuiApplicationPrivate::platformIntegration()->createPlatformWindow(this); - QObjectList childObjects = children(); - for (int i = 0; i < childObjects.size(); i ++) { - QObject *object = childObjects.at(i); - if(object->isWindowType()) { - QWindow *window = static_cast<QWindow *>(object); - if (window->d_func()->platformWindow) - window->d_func()->platformWindow->setParent(d->platformWindow); - } - } - } + d->create(false); } /*! diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h index 0d13cfa648..40bfad908f 100644 --- a/src/gui/kernel/qwindow.h +++ b/src/gui/kernel/qwindow.h @@ -85,6 +85,7 @@ class QPlatformWindow; class QBackingStore; class QScreen; class QAccessibleInterface; +class QWindowContainer; class Q_GUI_EXPORT QWindow : public QObject, public QSurface { @@ -359,6 +360,7 @@ private: friend class QGuiApplication; friend class QGuiApplicationPrivate; + friend class QWindowContainer; friend Q_GUI_EXPORT QWindowPrivate *qt_window_private(QWindow *window); }; diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index 808181d48c..cd789a6b71 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -133,6 +133,7 @@ public: void _q_clearAlert(); bool windowRecreationRequired(QScreen *newScreen) const; + void create(bool recursive); void setTopLevelScreen(QScreen *newScreen, bool recreate); void connectToScreen(QScreen *topLevelScreen); void disconnectFromScreen(); diff --git a/src/gui/opengl/qopengl_p.h b/src/gui/opengl/qopengl_p.h index 3cf636751a..5926fc8fba 100644 --- a/src/gui/opengl/qopengl_p.h +++ b/src/gui/opengl/qopengl_p.h @@ -42,6 +42,17 @@ #ifndef QOPENGL_P_H #define QOPENGL_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qopengl.h> #include <private/qopenglcontext_p.h> #include <QtCore/qset.h> diff --git a/src/gui/opengl/qopenglqueryhelper_p.h b/src/gui/opengl/qopenglqueryhelper_p.h index a7136c1cb7..bfafb30518 100644 --- a/src/gui/opengl/qopenglqueryhelper_p.h +++ b/src/gui/opengl/qopenglqueryhelper_p.h @@ -42,6 +42,17 @@ #ifndef QOPENGLQUERYHELPER_P_H #define QOPENGLQUERYHELPER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qglobal.h> #if !defined(QT_OPENGL_ES_2) diff --git a/src/gui/opengl/qopengltexture_p.h b/src/gui/opengl/qopengltexture_p.h index a732805f55..c50139ee59 100644 --- a/src/gui/opengl/qopengltexture_p.h +++ b/src/gui/opengl/qopengltexture_p.h @@ -42,6 +42,17 @@ #ifndef QABSTRACTOPENGLTEXTURE_P_H #define QABSTRACTOPENGLTEXTURE_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #ifndef QT_NO_OPENGL #include "private/qobject_p.h" diff --git a/src/gui/opengl/qopengltextureblitter_p.h b/src/gui/opengl/qopengltextureblitter_p.h index b4310e5f94..75f85093ec 100644 --- a/src/gui/opengl/qopengltextureblitter_p.h +++ b/src/gui/opengl/qopengltextureblitter_p.h @@ -42,6 +42,17 @@ #ifndef QOPENGLTEXTUREBLITTER_P_H #define QOPENGLTEXTUREBLITTER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtGui/qopengl.h> #include <QtGui/QMatrix3x3> diff --git a/src/gui/opengl/qopengltexturehelper_p.h b/src/gui/opengl/qopengltexturehelper_p.h index 782486b90d..a920a08c71 100644 --- a/src/gui/opengl/qopengltexturehelper_p.h +++ b/src/gui/opengl/qopengltexturehelper_p.h @@ -42,6 +42,17 @@ #ifndef QOPENGLTEXTUREHELPER_P_H #define QOPENGLTEXTUREHELPER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qglobal.h> #ifndef QT_NO_OPENGL diff --git a/src/gui/opengl/qopenglversionfunctionsfactory_p.h b/src/gui/opengl/qopenglversionfunctionsfactory_p.h index 2312e900f9..c644bc9082 100644 --- a/src/gui/opengl/qopenglversionfunctionsfactory_p.h +++ b/src/gui/opengl/qopenglversionfunctionsfactory_p.h @@ -51,6 +51,17 @@ #ifndef QOPENGLVERSIONFUNCTIONFACTORY_P_H #define QOPENGLVERSIONFUNCTIONFACTORY_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #ifndef QT_NO_OPENGL #include <QtCore/QtGlobal> diff --git a/src/gui/opengl/qtriangulatingstroker_p.h b/src/gui/opengl/qtriangulatingstroker_p.h index 2328f75af8..dc3a13e698 100644 --- a/src/gui/opengl/qtriangulatingstroker_p.h +++ b/src/gui/opengl/qtriangulatingstroker_p.h @@ -42,6 +42,17 @@ #ifndef QTRIANGULATINGSTROKER_P_H #define QTRIANGULATINGSTROKER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <private/qdatabuffer_p.h> #include <qvarlengtharray.h> #include <private/qvectorpath_p.h> diff --git a/src/gui/painting/qblittable_p.h b/src/gui/painting/qblittable_p.h index 0f846741b3..b13b793a3d 100644 --- a/src/gui/painting/qblittable_p.h +++ b/src/gui/painting/qblittable_p.h @@ -42,6 +42,17 @@ #ifndef QBLITTABLE_P_H #define QBLITTABLE_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qsize.h> #include <QtGui/private/qpixmap_blitter_p.h> diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index a2301e3cd8..926a1696b0 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -533,8 +533,8 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) QPointF p = QPointF(points[0], points[1]) * state->matrix; patternOffset = state->lastPen.dashOffset()*64; - lastPixel.x = -1; - lastPixel.y = -1; + lastPixel.x = INT_MIN; + lastPixel.y = INT_MIN; bool closed; const QPainterPath::ElementType *e = subPath(type, end, points, &closed); @@ -588,8 +588,8 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) QPointF p = QPointF(points[0], points[1]) * state->matrix; QPointF movedTo = p; patternOffset = state->lastPen.dashOffset()*64; - lastPixel.x = -1; - lastPixel.y = -1; + lastPixel.x = INT_MIN; + lastPixel.y = INT_MIN; const qreal *begin = points; const qreal *end = points + 2*path.elementCount(); diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h index 5fc3559da4..84e22b2653 100644 --- a/src/gui/painting/qcosmeticstroker_p.h +++ b/src/gui/painting/qcosmeticstroker_p.h @@ -42,6 +42,17 @@ #ifndef QCOSMETICSTROKER_P_H #define QCOSMETICSTROKER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <private/qdrawhelper_p.h> #include <private/qvectorpath_p.h> #include <private/qpaintengine_raster_p.h> diff --git a/src/gui/painting/qpaintengine_blitter_p.h b/src/gui/painting/qpaintengine_blitter_p.h index 56661a7d90..72dba8e49e 100644 --- a/src/gui/painting/qpaintengine_blitter_p.h +++ b/src/gui/painting/qpaintengine_blitter_p.h @@ -42,6 +42,17 @@ #ifndef QPAINTENGINE_BLITTER_P_H #define QPAINTENGINE_BLITTER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "private/qpaintengine_raster_p.h" #ifndef QT_NO_BLITTABLE diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 86a0bf1066..c3be9da2f7 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -822,6 +822,13 @@ QFontEngine *loadSingleEngine(int script, QFontCache::Key key(def,script); QFontEngine *engine = QFontCache::instance()->findEngine(key); if (!engine) { + // If the font data's native stretch matches the requested stretch we need to set stretch to 100 + // to avoid the fontengine synthesizing stretch. If they didn't match exactly we need to calculate + // the new stretch factor. This only done if not matched by styleName. + bool styleNameMatch = !request.styleName.isEmpty() && request.styleName == style->styleName; + if (!styleNameMatch && style->key.stretch != 0 && request.stretch != 0) + def.stretch = (request.stretch * 100 + 50) / style->key.stretch; + engine = pfdb->fontEngine(def, size->handle); if (engine) { Q_ASSERT(engine->type() != QFontEngine::Multi); @@ -931,7 +938,7 @@ static unsigned int bestFoundry(int script, unsigned int score, int styleStrategy, const QtFontFamily *family, const QString &foundry_name, QtFontStyle::Key styleKey, int pixelSize, char pitch, - QtFontDesc *desc, int force_encoding_id) + QtFontDesc *desc, int force_encoding_id, QString styleName = QString()) { Q_UNUSED(force_encoding_id); Q_UNUSED(script); @@ -953,7 +960,7 @@ unsigned int bestFoundry(int script, unsigned int score, int styleStrategy, FM_DEBUG(" looking for matching style in foundry '%s' %d", foundry->name.isEmpty() ? "-- none --" : foundry->name.toLatin1().constData(), foundry->count); - QtFontStyle *style = bestStyle(foundry, styleKey); + QtFontStyle *style = bestStyle(foundry, styleKey, styleName); if (!style->smoothScalable && (styleStrategy & QFont::ForceOutline)) { FM_DEBUG(" ForceOutline set, but not smoothly scalable"); @@ -1140,13 +1147,13 @@ static int match(int script, const QFontDef &request, unsigned int newscore = bestFoundry(script, score, request.styleStrategy, test.family, foundry_name, styleKey, request.pixelSize, pitch, - &test, force_encoding_id); + &test, force_encoding_id, request.styleName); if (test.foundry == 0) { // the specific foundry was not found, so look for // any foundry matching our requirements newscore = bestFoundry(script, score, request.styleStrategy, test.family, QString(), styleKey, request.pixelSize, - pitch, &test, force_encoding_id); + pitch, &test, force_encoding_id, request.styleName); } if (newscore < score) { diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp index 5dc81d241d..e1d58a0d05 100644 --- a/src/gui/text/qplatformfontdatabase.cpp +++ b/src/gui/text/qplatformfontdatabase.cpp @@ -550,60 +550,58 @@ QSupportedWritingSystems QPlatformFontDatabase::writingSystemsFromTrueTypeBits(q } } } - if (!hasScript) { - if (codePageRange[0] & ((1 << Latin1CsbBit) | (1 << CentralEuropeCsbBit) | (1 << TurkishCsbBit) | (1 << BalticCsbBit))) { - writingSystems.setSupported(QFontDatabase::Latin); - hasScript = true; - //qDebug("font %s supports Latin", familyName.latin1()); - } - if (codePageRange[0] & (1 << CyrillicCsbBit)) { - writingSystems.setSupported(QFontDatabase::Cyrillic); - hasScript = true; - //qDebug("font %s supports Cyrillic", familyName.latin1()); - } - if (codePageRange[0] & (1 << GreekCsbBit)) { - writingSystems.setSupported(QFontDatabase::Greek); - hasScript = true; - //qDebug("font %s supports Greek", familyName.latin1()); - } - if (codePageRange[0] & (1 << HebrewCsbBit)) { - writingSystems.setSupported(QFontDatabase::Hebrew); - hasScript = true; - //qDebug("font %s supports Hebrew", familyName.latin1()); - } - if (codePageRange[0] & (1 << ArabicCsbBit)) { - writingSystems.setSupported(QFontDatabase::Arabic); - hasScript = true; - //qDebug("font %s supports Arabic", familyName.latin1()); - } - if (codePageRange[0] & (1 << VietnameseCsbBit)) { - writingSystems.setSupported(QFontDatabase::Vietnamese); - hasScript = true; - //qDebug("font %s supports Vietnamese", familyName.latin1()); - } - if (codePageRange[0] & (1 << SimplifiedChineseCsbBit)) { - writingSystems.setSupported(QFontDatabase::SimplifiedChinese); - hasScript = true; - //qDebug("font %s supports Simplified Chinese", familyName.latin1()); - } - if (codePageRange[0] & (1 << TraditionalChineseCsbBit)) { - writingSystems.setSupported(QFontDatabase::TraditionalChinese); - hasScript = true; - //qDebug("font %s supports Traditional Chinese", familyName.latin1()); - } - if (codePageRange[0] & (1 << JapaneseCsbBit)) { - writingSystems.setSupported(QFontDatabase::Japanese); - hasScript = true; - //qDebug("font %s supports Japanese", familyName.latin1()); - } - if (codePageRange[0] & ((1 << KoreanCsbBit) | (1 << KoreanJohabCsbBit))) { - writingSystems.setSupported(QFontDatabase::Korean); - hasScript = true; - //qDebug("font %s supports Korean", familyName.latin1()); - } - if (!hasScript) - writingSystems.setSupported(QFontDatabase::Symbol); + if (codePageRange[0] & ((1 << Latin1CsbBit) | (1 << CentralEuropeCsbBit) | (1 << TurkishCsbBit) | (1 << BalticCsbBit))) { + writingSystems.setSupported(QFontDatabase::Latin); + hasScript = true; + //qDebug("font %s supports Latin", familyName.latin1()); + } + if (codePageRange[0] & (1 << CyrillicCsbBit)) { + writingSystems.setSupported(QFontDatabase::Cyrillic); + hasScript = true; + //qDebug("font %s supports Cyrillic", familyName.latin1()); + } + if (codePageRange[0] & (1 << GreekCsbBit)) { + writingSystems.setSupported(QFontDatabase::Greek); + hasScript = true; + //qDebug("font %s supports Greek", familyName.latin1()); + } + if (codePageRange[0] & (1 << HebrewCsbBit)) { + writingSystems.setSupported(QFontDatabase::Hebrew); + hasScript = true; + //qDebug("font %s supports Hebrew", familyName.latin1()); + } + if (codePageRange[0] & (1 << ArabicCsbBit)) { + writingSystems.setSupported(QFontDatabase::Arabic); + hasScript = true; + //qDebug("font %s supports Arabic", familyName.latin1()); + } + if (codePageRange[0] & (1 << VietnameseCsbBit)) { + writingSystems.setSupported(QFontDatabase::Vietnamese); + hasScript = true; + //qDebug("font %s supports Vietnamese", familyName.latin1()); + } + if (codePageRange[0] & (1 << SimplifiedChineseCsbBit)) { + writingSystems.setSupported(QFontDatabase::SimplifiedChinese); + hasScript = true; + //qDebug("font %s supports Simplified Chinese", familyName.latin1()); + } + if (codePageRange[0] & (1 << TraditionalChineseCsbBit)) { + writingSystems.setSupported(QFontDatabase::TraditionalChinese); + hasScript = true; + //qDebug("font %s supports Traditional Chinese", familyName.latin1()); + } + if (codePageRange[0] & (1 << JapaneseCsbBit)) { + writingSystems.setSupported(QFontDatabase::Japanese); + hasScript = true; + //qDebug("font %s supports Japanese", familyName.latin1()); + } + if (codePageRange[0] & ((1 << KoreanCsbBit) | (1 << KoreanJohabCsbBit))) { + writingSystems.setSupported(QFontDatabase::Korean); + hasScript = true; + //qDebug("font %s supports Korean", familyName.latin1()); } + if (!hasScript) + writingSystems.setSupported(QFontDatabase::Symbol); return writingSystems; } diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 452b263670..b192460f07 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -118,7 +118,9 @@ private: return; const int end = start + length; for (int i = start + 1; i < end; ++i) { - if (m_analysis[i] == m_analysis[start] + if (m_analysis[i].bidiLevel == m_analysis[start].bidiLevel + && m_analysis[i].flags == m_analysis[start].flags + && (m_analysis[i].script == m_analysis[start].script || m_string[i] == QLatin1Char('.')) && m_analysis[i].flags < QScriptAnalysis::SpaceTabOrObject && i - start < MaxItemLength) continue; diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index ad00396553..5056319b9d 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2501,7 +2501,7 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const } int lineEnd = line.from + line.length + line.trailingSpaces; - int pos = *cursorPos; + int pos = qBound(0, *cursorPos, lineEnd); int itm; const QCharAttributes *attributes = eng->attributes(); if (!attributes) { diff --git a/src/gui/util/qabstractlayoutstyleinfo_p.h b/src/gui/util/qabstractlayoutstyleinfo_p.h index 52f151c5d2..b0f901d0ac 100644 --- a/src/gui/util/qabstractlayoutstyleinfo_p.h +++ b/src/gui/util/qabstractlayoutstyleinfo_p.h @@ -42,6 +42,17 @@ #ifndef QABSTRACTLAYOUTSTYLEINFO_P_H #define QABSTRACTLAYOUTSTYLEINFO_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qnamespace.h> #include "qlayoutpolicy_p.h" diff --git a/src/gui/util/qlayoutpolicy_p.h b/src/gui/util/qlayoutpolicy_p.h index 664afef1a4..2d98bcd84c 100644 --- a/src/gui/util/qlayoutpolicy_p.h +++ b/src/gui/util/qlayoutpolicy_p.h @@ -42,6 +42,17 @@ #ifndef QLAYOUTPOLICY_H #define QLAYOUTPOLICY_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qobject.h> #include <QtCore/qnamespace.h> |