From f3cc24f2983189cd66b34529cf9fa721f9bf3607 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 29 Jun 2011 13:05:11 +0200 Subject: Remove openvglite plugin This code does not compile, and it has not been maintained for almost two years. Reviewed-by: jlind --- src/plugins/platforms/openvglite/main.cpp | 71 -------- src/plugins/platforms/openvglite/openvglite.pro | 12 -- .../openvglite/qgraphicssystem_vglite.cpp | 193 --------------------- .../platforms/openvglite/qgraphicssystem_vglite.h | 93 ---------- .../platforms/openvglite/qwindowsurface_vglite.cpp | 131 -------------- .../platforms/openvglite/qwindowsurface_vglite.h | 91 ---------- 6 files changed, 591 deletions(-) delete mode 100644 src/plugins/platforms/openvglite/main.cpp delete mode 100644 src/plugins/platforms/openvglite/openvglite.pro delete mode 100644 src/plugins/platforms/openvglite/qgraphicssystem_vglite.cpp delete mode 100644 src/plugins/platforms/openvglite/qgraphicssystem_vglite.h delete mode 100644 src/plugins/platforms/openvglite/qwindowsurface_vglite.cpp delete mode 100644 src/plugins/platforms/openvglite/qwindowsurface_vglite.h diff --git a/src/plugins/platforms/openvglite/main.cpp b/src/plugins/platforms/openvglite/main.cpp deleted file mode 100644 index 19220a6..0000000 --- a/src/plugins/platforms/openvglite/main.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "qgraphicssystem_vglite.h" - -QT_BEGIN_NAMESPACE - -class QVGGraphicsSystemPlugin : public QGraphicsSystemPlugin -{ -public: - QStringList keys() const; - QGraphicsSystem *create(const QString&); -}; - -QStringList QVGGraphicsSystemPlugin::keys() const -{ - QStringList list; - list << "OpenVG"; - return list; -} - -QGraphicsSystem* QVGGraphicsSystemPlugin::create(const QString& system) -{ - if (system.toLower() == "openvg") - return new QVGLiteGraphicsSystem; - - return 0; -} - -Q_EXPORT_PLUGIN2(openvg, QVGGraphicsSystemPlugin) - -QT_END_NAMESPACE diff --git a/src/plugins/platforms/openvglite/openvglite.pro b/src/plugins/platforms/openvglite/openvglite.pro deleted file mode 100644 index 9d7860a..0000000 --- a/src/plugins/platforms/openvglite/openvglite.pro +++ /dev/null @@ -1,12 +0,0 @@ -TARGET = qvglitegraphicssystem -include(../../qpluginbase.pri) - -QT += openvg - -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/graphicssystems - -SOURCES = main.cpp qgraphicssystem_vglite.cpp qwindowsurface_vglite.cpp -HEADERS = qgraphicssystem_vglite.h qwindowsurface_vglite.h - -target.path += $$[QT_INSTALL_PLUGINS]/graphicssystems -INSTALLS += target diff --git a/src/plugins/platforms/openvglite/qgraphicssystem_vglite.cpp b/src/plugins/platforms/openvglite/qgraphicssystem_vglite.cpp deleted file mode 100644 index 203896f..0000000 --- a/src/plugins/platforms/openvglite/qgraphicssystem_vglite.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qgraphicssystem_vglite.h" -#include "qwindowsurface_vglite.h" -#include -#include -#include -#ifdef OPENVG_USBHP_INIT -extern "C" { -#include -}; -#endif - -QT_BEGIN_NAMESPACE - -QVGLiteGraphicsSystem::QVGLiteGraphicsSystem() - : w(0), h(0), d(0), dw(0), dh(0), physWidth(0), physHeight(0), - surface(0), context(0), rootWindow(0), - screenFormat(QImage::Format_RGB16), preservedSwap(false) -{ -#ifdef OPENVG_USBHP_INIT - initLibrary(); -#endif - - // The graphics system is also the screen definition. - mScreens.append(this); - - QString displaySpec = QString::fromLatin1(qgetenv("QWS_DISPLAY")); - QStringList displayArgs = displaySpec.split(QLatin1Char(':')); - - // Initialize EGL and create the global EGL context. - context = qt_vg_create_context(0); - if (!context) { - qFatal("QVGLiteGraphicsSystem: could not initialize EGL"); - return; - } - - // Get the root window handle to use. Default to zero. - QRegExp winidRx(QLatin1String("winid=?(\\d+)")); - int winidIdx = displayArgs.indexOf(winidRx); - int handle = 0; - if (winidIdx >= 0) { - winidRx.exactMatch(displayArgs.at(winidIdx)); - handle = winidRx.cap(1).toInt(); - } - - // Create a full-screen window based on the native handle. - // If the context is premultiplied, the window should be too. - QEglProperties props; -#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT - EGLint surfaceType = 0; - if (context->configAttrib(EGL_SURFACE_TYPE, &surfaceType) && - (surfaceType & EGL_VG_ALPHA_FORMAT_PRE_BIT) != 0) - props.setValue(EGL_VG_ALPHA_FORMAT, EGL_VG_ALPHA_FORMAT_PRE); -#endif - rootWindow = eglCreateWindowSurface - (context->display(), context->config(), - (EGLNativeWindowType)handle, props.properties()); - if (rootWindow == EGL_NO_SURFACE) { - delete context; - context = 0; - qFatal("QVGLiteGraphicsSystem: could not create full-screen window"); - return; - } - - // Try to turn on preserved swap behaviour on the root window. - // This will allow us to optimize compositing to focus on just - // the screen region that has changed. Otherwise we must - // re-composite the entire screen every frame. -#if !defined(QVG_NO_PRESERVED_SWAP) - eglGetError(); // Clear error state first. - eglSurfaceAttrib(context->display(), rootWindow, - EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); - preservedSwap = (eglGetError() == EGL_SUCCESS); -#else - preservedSwap = false; -#endif - - // Fetch the root window properties. - eglQuerySurface(context->display(), rootWindow, EGL_WIDTH, &w); - eglQuerySurface(context->display(), rootWindow, EGL_HEIGHT, &h); - screenFormat = qt_vg_config_to_image_format(context); - switch (screenFormat) { - case QImage::Format_ARGB32_Premultiplied: - case QImage::Format_ARGB32: - case QImage::Format_RGB32: - default: - d = 32; - break; - case QImage::Format_RGB16: - case QImage::Format_ARGB4444_Premultiplied: - d = 16; - break; - } - dw = w; - dh = h; - qDebug("screen size: %dx%dx%d", w, h, d); - - // Handle display physical size spec. From qscreenlinuxfb_qws.cpp. - QRegExp mmWidthRx(QLatin1String("mmWidth=?(\\d+)")); - int dimIdxW = displayArgs.indexOf(mmWidthRx); - QRegExp mmHeightRx(QLatin1String("mmHeight=?(\\d+)")); - int dimIdxH = displayArgs.indexOf(mmHeightRx); - if (dimIdxW >= 0) { - mmWidthRx.exactMatch(displayArgs.at(dimIdxW)); - physWidth = mmWidthRx.cap(1).toInt(); - if (dimIdxH < 0) - physHeight = dh*physWidth/dw; - } - if (dimIdxH >= 0) { - mmHeightRx.exactMatch(displayArgs.at(dimIdxH)); - physHeight = mmHeightRx.cap(1).toInt(); - if (dimIdxW < 0) - physWidth = dw*physHeight/dh; - } - if (dimIdxW < 0 && dimIdxH < 0) { - const int dpi = 72; - physWidth = qRound(dw * 25.4 / dpi); - physHeight = qRound(dh * 25.4 / dpi); - } -} - -QVGLiteGraphicsSystem::~QVGLiteGraphicsSystem() -{ -} - -QPixmapData *QVGLiteGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const -{ -#if !defined(QVGLite_NO_SINGLE_CONTEXT) && !defined(QVGLite_NO_PIXMAP_DATA) - // Pixmaps can use QVGLitePixmapData; bitmaps must use raster. - if (type == QPixmapData::PixmapType) - return new QVGPixmapData(type); - else - return new QRasterPixmapData(type); -#else - return new QRasterPixmapData(type); -#endif -} - -QWindowSurface *QVGLiteGraphicsSystem::createWindowSurface(QWidget *widget) const -{ - if (widget->windowType() == Qt::Desktop) - return 0; // Don't create an explicit window surface for the destkop. - if (surface) { - qWarning() << "QVGLiteGraphicsSystem: only one window surface " - "is supported at a time"; - return 0; - } - surface = new QVGLiteWindowSurface - (const_cast(this), widget); - return surface; -} - -QT_END_NAMESPACE diff --git a/src/plugins/platforms/openvglite/qgraphicssystem_vglite.h b/src/plugins/platforms/openvglite/qgraphicssystem_vglite.h deleted file mode 100644 index 41b1d28..0000000 --- a/src/plugins/platforms/openvglite/qgraphicssystem_vglite.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QGRAPHICSSYSTEM_VGLITE_H -#define QGRAPHICSSYSTEM_VGLITE_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QVGLiteWindowSurface; - -class QVGLiteGraphicsSystem : public QGraphicsSystem, - public QGraphicsSystemScreen -{ -public: - QVGLiteGraphicsSystem(); - ~QVGLiteGraphicsSystem(); - - QPixmapData *createPixmapData(QPixmapData::PixelType type) const; - QWindowSurface *createWindowSurface(QWidget *widget) const; - QList screens() const { return mScreens; } - - QRect geometry() const { return QRect(0, 0, w, h); } - int depth() const { return d; } - QImage::Format format() const { return screenFormat; } - QSize physicalSize() const { return QSize(physWidth, physHeight); } - -private: - friend class QVGLiteWindowSurface; - - int w; - int h; - int d; - - int dw; - int dh; - - int physWidth; - int physHeight; - - mutable QVGLiteWindowSurface *surface; - QEglContext *context; - EGLSurface rootWindow; - QImage::Format screenFormat; - bool preservedSwap; - - QList mScreens; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/platforms/openvglite/qwindowsurface_vglite.cpp b/src/plugins/platforms/openvglite/qwindowsurface_vglite.cpp deleted file mode 100644 index dad23c1..0000000 --- a/src/plugins/platforms/openvglite/qwindowsurface_vglite.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwindowsurface_vglite.h" -#include "qgraphicssystem_vglite.h" -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QVGLiteWindowSurface::QVGLiteWindowSurface - (QVGLiteGraphicsSystem *gs, QWidget *window) - : QWindowSurface(window), graphicsSystem(gs), - isPaintingActive(false), engine(0) -{ -} - -QVGLiteWindowSurface::~QVGLiteWindowSurface() -{ - graphicsSystem->surface = 0; - if (engine) - qt_vg_destroy_paint_engine(engine); -} - -QPaintDevice *QVGLiteWindowSurface::paintDevice() -{ - qt_vg_make_current(graphicsSystem->context, graphicsSystem->rootWindow); - isPaintingActive = true; - // TODO: clear the parts of the back buffer that are not - // covered by the window surface to black. - return this; -} - -void QVGLiteWindowSurface::flush(QWidget *widget, const QRegion ®ion, const QPoint &offset) -{ - Q_UNUSED(widget); - Q_UNUSED(region); - Q_UNUSED(offset); - QEglContext *context = graphicsSystem->context; - if (context) { - if (!isPaintingActive) - qt_vg_make_current(context, graphicsSystem->rootWindow); - context->swapBuffers(); - qt_vg_done_current(context); - context->setSurface(EGL_NO_SURFACE); - isPaintingActive = false; - } -} - -void QVGLiteWindowSurface::setGeometry(const QRect &rect) -{ - QWindowSurface::setGeometry(rect); -} - -bool QVGLiteWindowSurface::scroll(const QRegion &area, int dx, int dy) -{ - return QWindowSurface::scroll(area, dx, dy); -} - -void QVGLiteWindowSurface::beginPaint(const QRegion ®ion) -{ - Q_UNUSED(region); -} - -void QVGLiteWindowSurface::endPaint(const QRegion ®ion) -{ - Q_UNUSED(region); -} - -QPaintEngine *QVGLiteWindowSurface::paintEngine() const -{ - if (!engine) - engine = qt_vg_create_paint_engine(); - return engine; -} - -// We need to get access to QWidget::metric() from QVGLiteWindowSurface::metric, -// but it is not a friend of QWidget. To get around this, we create a -// fake QX11PaintEngine class, which is a friend. -class QX11PaintEngine -{ -public: - static int metric(const QWidget *widget, QPaintDevice::PaintDeviceMetric met) - { - return widget->metric(met); - } -}; - -int QVGLiteWindowSurface::metric(PaintDeviceMetric met) const -{ - return QX11PaintEngine::metric(window(), met); -} diff --git a/src/plugins/platforms/openvglite/qwindowsurface_vglite.h b/src/plugins/platforms/openvglite/qwindowsurface_vglite.h deleted file mode 100644 index b6e22d8..0000000 --- a/src/plugins/platforms/openvglite/qwindowsurface_vglite.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWINDOWSURFACE_VGLITE_H -#define QWINDOWSURFACE_VGLITE_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 -#include - -QT_BEGIN_NAMESPACE - -class QVGLiteGraphicsSystem; -class QVGPaintEngine; - -class Q_OPENVG_EXPORT QVGLiteWindowSurface : public QWindowSurface, public QPaintDevice -{ -public: - QVGLiteWindowSurface(QVGLiteGraphicsSystem *gs, QWidget *window); - ~QVGLiteWindowSurface(); - - QPaintDevice *paintDevice(); - void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset); - void setGeometry(const QRect &rect); - bool scroll(const QRegion &area, int dx, int dy); - - void beginPaint(const QRegion ®ion); - void endPaint(const QRegion ®ion); - - QPaintEngine *paintEngine() const; - -protected: - int metric(PaintDeviceMetric metric) const; - -private: - QVGLiteGraphicsSystem *graphicsSystem; - bool isPaintingActive; - mutable QVGPaintEngine *engine; -}; - -QT_END_NAMESPACE - -#endif // QWINDOWSURFACE_VGLITE_H -- cgit v0.12 From f54c5d9133d7aa7636988db36fa6cc51d26434b6 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 30 Jun 2011 11:57:09 +0200 Subject: Fix transformations on DirectWrite rasterized text There were a few bugs in the DirectWrite font engine that caused transformed text to break. First of all, alphaMapForGlyph() ignored the transform, so no gray antialiased text would be transformed. Second of all, the imageForGlyph() function would use the wrong bounding box for the rasterized glyph, causing its positioning to become a little bit off when rotating. The fix is to get the bounding box from the system and add a margin to this instead of trying to predict how it will appear after the vertical hinting etc. has been applied. So that the positioning metrics are in sync with the actual metrics used by the alphaMap* functions, we also need to implement the alphaMapBoundingBox() function. Task-number: QTBUG-19829 Reviewed-by: Jiang Jiang --- src/gui/text/qfontenginedirectwrite.cpp | 145 ++++++++++++++++++++++---------- src/gui/text/qfontenginedirectwrite_p.h | 6 +- 2 files changed, 104 insertions(+), 47 deletions(-) diff --git a/src/gui/text/qfontenginedirectwrite.cpp b/src/gui/text/qfontenginedirectwrite.cpp index 890cad9..b6a172e 100644 --- a/src/gui/text/qfontenginedirectwrite.cpp +++ b/src/gui/text/qfontenginedirectwrite.cpp @@ -390,6 +390,60 @@ glyph_metrics_t QFontEngineDirectWrite::boundingBox(const QGlyphLayout &glyphs) return glyph_metrics_t(0, -m_ascent, w - lastRightBearing(glyphs), m_ascent + m_descent, w, 0); } +glyph_metrics_t QFontEngineDirectWrite::alphaMapBoundingBox(glyph_t glyph, QFixed subPixelPosition, + const QTransform &matrix, + GlyphFormat /*format*/) +{ + glyph_metrics_t bbox = QFontEngine::boundingBox(glyph, matrix); // To get transformed advance + + UINT16 glyphIndex = glyph; + FLOAT glyphAdvance = 0; + + DWRITE_GLYPH_OFFSET glyphOffset; + glyphOffset.advanceOffset = 0; + glyphOffset.ascenderOffset = 0; + + DWRITE_GLYPH_RUN glyphRun; + glyphRun.fontFace = m_directWriteFontFace; + glyphRun.fontEmSize = fontDef.pixelSize; + glyphRun.glyphCount = 1; + glyphRun.glyphIndices = &glyphIndex; + glyphRun.glyphAdvances = &glyphAdvance; + glyphRun.isSideways = false; + glyphRun.bidiLevel = 0; + glyphRun.glyphOffsets = &glyphOffset; + + DWRITE_MATRIX transform; + transform.dx = subPixelPosition.toReal(); + transform.dy = 0; + transform.m11 = matrix.m11(); + transform.m12 = matrix.m12(); + transform.m21 = matrix.m21(); + transform.m22 = matrix.m22(); + + IDWriteGlyphRunAnalysis *glyphAnalysis = NULL; + HRESULT hr = m_directWriteFactory->CreateGlyphRunAnalysis( + &glyphRun, + 1.0f, + &transform, + DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC, + DWRITE_MEASURING_MODE_NATURAL, + 0.0, 0.0, + &glyphAnalysis + ); + + if (SUCCEEDED(hr)) { + RECT rect; + glyphAnalysis->GetAlphaTextureBounds(DWRITE_TEXTURE_CLEARTYPE_3x1, &rect); + glyphAnalysis->Release(); + + return glyph_metrics_t(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, + bbox.xoff, bbox.yoff); + } else { + return glyph_metrics_t(); + } +} + glyph_metrics_t QFontEngineDirectWrite::boundingBox(glyph_t g) { if (m_directWriteFontFace == 0) @@ -459,9 +513,10 @@ qreal QFontEngineDirectWrite::maxCharWidth() const extern uint qt_pow_gamma[256]; -QImage QFontEngineDirectWrite::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition) +QImage QFontEngineDirectWrite::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, + const QTransform &xform) { - QImage im = imageForGlyph(glyph, subPixelPosition, 0, QTransform()); + QImage im = imageForGlyph(glyph, subPixelPosition, 0, xform); QImage indexed(im.width(), im.height(), QImage::Format_Indexed8); QVector colors(256); @@ -492,12 +547,8 @@ QImage QFontEngineDirectWrite::imageForGlyph(glyph_t t, int margin, const QTransform &xform) { - glyph_metrics_t metrics = QFontEngine::boundingBox(t, xform); - int width = (metrics.width + margin * 2 + 4).ceil().toInt() ; - int height = (metrics.height + margin * 2 + 4).ceil().toInt(); - UINT16 glyphIndex = t; - FLOAT glyphAdvance = metrics.xoff.toReal(); + FLOAT glyphAdvance = 0; DWRITE_GLYPH_OFFSET glyphOffset; glyphOffset.advanceOffset = 0; @@ -513,12 +564,9 @@ QImage QFontEngineDirectWrite::imageForGlyph(glyph_t t, glyphRun.bidiLevel = 0; glyphRun.glyphOffsets = &glyphOffset; - QFixed x = margin - metrics.x.round() + subPixelPosition; - QFixed y = margin - metrics.y.floor(); - DWRITE_MATRIX transform; - transform.dx = x.toReal(); - transform.dy = y.toReal(); + transform.dx = subPixelPosition.toReal(); + transform.dy = 0; transform.m11 = xform.m11(); transform.m12 = xform.m12(); transform.m21 = xform.m21(); @@ -537,48 +585,53 @@ QImage QFontEngineDirectWrite::imageForGlyph(glyph_t t, if (SUCCEEDED(hr)) { RECT rect; - rect.left = 0; - rect.top = 0; - rect.right = width; - rect.bottom = height; - - int size = width * height * 3; - BYTE *alphaValues = new BYTE[size]; - qMemSet(alphaValues, size, 0); - - hr = glyphAnalysis->CreateAlphaTexture(DWRITE_TEXTURE_CLEARTYPE_3x1, - &rect, - alphaValues, - size); - - if (SUCCEEDED(hr)) { - QImage img(width, height, QImage::Format_RGB32); - img.fill(0xffffffff); + glyphAnalysis->GetAlphaTextureBounds(DWRITE_TEXTURE_CLEARTYPE_3x1, &rect); - for (int y=0; y(img.scanLine(y)); - BYTE *src = alphaValues + width * 3 * y; + rect.left -= margin; + rect.top -= margin; + rect.right += margin; + rect.bottom += margin; - for (int x=0; x 0) { + BYTE *alphaValues = new BYTE[size]; + qMemSet(alphaValues, size, 0); + + hr = glyphAnalysis->CreateAlphaTexture(DWRITE_TEXTURE_CLEARTYPE_3x1, + &rect, + alphaValues, + size); + + if (SUCCEEDED(hr)) { + QImage img(width, height, QImage::Format_RGB32); + img.fill(0xffffffff); + + for (int y=0; y(img.scanLine(y)); + BYTE *src = alphaValues + width * 3 * y; + + for (int x=0; xRelease(); + delete[] alphaValues; + return img; + } else { + delete[] alphaValues; - return img; - } else { - delete[] alphaValues; - glyphAnalysis->Release(); - - qErrnoWarning("QFontEngineDirectWrite::imageForGlyph: CreateAlphaTexture failed"); + qErrnoWarning("QFontEngineDirectWrite::imageForGlyph: CreateAlphaTexture failed"); + } } + glyphAnalysis->Release(); } else { qErrnoWarning("QFontEngineDirectWrite::imageForGlyph: CreateGlyphRunAnalysis failed"); } diff --git a/src/gui/text/qfontenginedirectwrite_p.h b/src/gui/text/qfontenginedirectwrite_p.h index d0086fc..edf1e6a 100644 --- a/src/gui/text/qfontenginedirectwrite_p.h +++ b/src/gui/text/qfontenginedirectwrite_p.h @@ -86,6 +86,10 @@ public: glyph_metrics_t boundingBox(const QGlyphLayout &glyphs); glyph_metrics_t boundingBox(glyph_t g); + glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, + QFixed subPixelPosition, + const QTransform &matrix, + GlyphFormat format); QFixed ascent() const; QFixed descent() const; @@ -97,7 +101,7 @@ public: bool supportsSubPixelPositions() const; - QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition); + QImage alphaMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t); QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, int margin, const QTransform &xform); -- cgit v0.12 From d58eec3c932d1cdbcf3b42534e8fe870ec109487 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 30 Jun 2011 12:54:46 +0200 Subject: Fix resource leak in QFontEngineDirectWrite Bug introduced by f54c5d9133d7aa7636988db36fa6cc51d26434b6. The release statement has to come before the return statement :) Reviewed-by: Jiang Jiang --- src/gui/text/qfontenginedirectwrite.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qfontenginedirectwrite.cpp b/src/gui/text/qfontenginedirectwrite.cpp index b6a172e..d693273 100644 --- a/src/gui/text/qfontenginedirectwrite.cpp +++ b/src/gui/text/qfontenginedirectwrite.cpp @@ -623,15 +623,16 @@ QImage QFontEngineDirectWrite::imageForGlyph(glyph_t t, } delete[] alphaValues; + glyphAnalysis->Release(); + return img; } else { delete[] alphaValues; + glyphAnalysis->Release(); qErrnoWarning("QFontEngineDirectWrite::imageForGlyph: CreateAlphaTexture failed"); } } - - glyphAnalysis->Release(); } else { qErrnoWarning("QFontEngineDirectWrite::imageForGlyph: CreateGlyphRunAnalysis failed"); } -- cgit v0.12 From f8b3ea2988bb57e67d38cfc00d2fbfb950564421 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 30 Jun 2011 20:24:38 +0200 Subject: Doc: Updated documentation with \since 4.8 declarations. --- src/corelib/io/qfile.cpp | 2 ++ src/corelib/tools/qlocale.qdoc | 1 + src/corelib/tools/qpoint.cpp | 9 +++++++++ src/corelib/tools/qset.qdoc | 1 + src/corelib/tools/qstring.cpp | 3 +++ src/corelib/xml/qxmlstream.cpp | 5 ++++- src/gui/graphicsview/qgraphicsgridlayout.cpp | 2 ++ src/gui/itemviews/qabstractproxymodel.cpp | 9 +++++++++ src/gui/kernel/qgenericplugin_qpa.cpp | 1 + src/gui/kernel/qgenericpluginfactory_qpa.cpp | 1 + src/gui/kernel/qplatformcursor_qpa.cpp | 2 ++ src/gui/kernel/qplatformwindowformat_qpa.cpp | 8 ++++++-- src/gui/kernel/qsizepolicy.qdoc | 2 ++ src/gui/kernel/qwidget_qpa.cpp | 6 ++++++ src/gui/painting/qprinterinfo.cpp | 4 ++++ src/gui/text/qfontmetrics.cpp | 3 +++ src/gui/text/qplatformfontdatabase_qpa.cpp | 2 ++ src/gui/text/qtextcursor.cpp | 1 + src/gui/text/qtextlayout.cpp | 16 ++++++++++++---- src/gui/widgets/qcheckbox.cpp | 1 + src/gui/widgets/qlineedit.cpp | 4 ++++ src/gui/widgets/qradiobutton.cpp | 1 + src/gui/widgets/qtabwidget.cpp | 1 + src/network/bearer/qnetworkconfigmanager.cpp | 1 + src/network/kernel/qnetworkproxy.cpp | 8 ++++++++ src/opengl/qgl_qpa.cpp | 6 ++++++ tools/assistant/lib/qhelpsearchquerywidget.cpp | 6 ++++++ 27 files changed, 99 insertions(+), 7 deletions(-) diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 66edf58..929b2f9 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -358,6 +358,7 @@ QFilePrivate::setError(QFile::FileError err, int errNum) /*! \enum QFile::FileHandleFlag + \since 4.8 This enum is used when opening a file to specify additional options which only apply to files and not to a generic @@ -1657,6 +1658,7 @@ bool QFile::atEnd() const /*! \fn bool QFile::seek(qint64 pos) + \since 4.8 For random-access devices, this function sets the current position to \a pos, returning true on success, or false if an error occurred. diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc index fd139c3..5d4f305 100644 --- a/src/corelib/tools/qlocale.qdoc +++ b/src/corelib/tools/qlocale.qdoc @@ -608,6 +608,7 @@ /*! \enum QLocale::Script + \since 4.8 This enumerated type is used to specify a script. diff --git a/src/corelib/tools/qpoint.cpp b/src/corelib/tools/qpoint.cpp index bd32fe7..ae6ed71 100644 --- a/src/corelib/tools/qpoint.cpp +++ b/src/corelib/tools/qpoint.cpp @@ -188,6 +188,7 @@ QT_BEGIN_NAMESPACE /*! \fn QPoint &QPoint::operator*=(float factor) + \since 4.8 Multiplies this point's coordinates by the given \a factor, and returns a reference to this point. @@ -200,6 +201,7 @@ QT_BEGIN_NAMESPACE /*! \fn QPoint &QPoint::operator*=(double factor) + \since 4.8 Multiplies this point's coordinates by the given \a factor, and returns a reference to this point. For example: @@ -214,6 +216,7 @@ QT_BEGIN_NAMESPACE /*! \fn QPoint &QPoint::operator*=(int factor) + \since 4.8 Multiplies this point's coordinates by the given \a factor, and returns a reference to this point. @@ -259,6 +262,7 @@ QT_BEGIN_NAMESPACE /*! \fn const QPoint operator*(const QPoint &point, float factor) \relates QPoint + \since 4.8 Returns a copy of the given \a point multiplied by the given \a factor. @@ -271,6 +275,7 @@ QT_BEGIN_NAMESPACE /*! \fn const QPoint operator*(const QPoint &point, double factor) \relates QPoint + \since 4.8 Returns a copy of the given \a point multiplied by the given \a factor. @@ -283,6 +288,7 @@ QT_BEGIN_NAMESPACE /*! \fn const QPoint operator*(const QPoint &point, int factor) \relates QPoint + \since 4.8 Returns a copy of the given \a point multiplied by the given \a factor. @@ -293,6 +299,7 @@ QT_BEGIN_NAMESPACE \fn const QPoint operator*(float factor, const QPoint &point) \overload \relates QPoint + \since 4.8 Returns a copy of the given \a point multiplied by the given \a factor. */ @@ -301,6 +308,7 @@ QT_BEGIN_NAMESPACE \fn const QPoint operator*(double factor, const QPoint &point) \overload \relates QPoint + \since 4.8 Returns a copy of the given \a point multiplied by the given \a factor. */ @@ -309,6 +317,7 @@ QT_BEGIN_NAMESPACE \fn const QPoint operator*(int factor, const QPoint &point) \overload \relates QPoint + \since 4.8 Returns a copy of the given \a point multiplied by the given \a factor. */ diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc index f562c68..31129e0 100644 --- a/src/corelib/tools/qset.qdoc +++ b/src/corelib/tools/qset.qdoc @@ -124,6 +124,7 @@ /*! \fn void QSet::swap(QSet &other) + \since 4.8 Swaps set \a other with this set. This operation is very fast and never fails. diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index ee45cfd..791bfff 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -839,18 +839,21 @@ int QString::grow(int size) /*! \typedef QString::const_reference + \since 4.8 The QString::const_reference typedef provides an STL-style const reference for QString. */ /*! \typedef QString::reference + \since 4.8 The QString::const_reference typedef provides an STL-style reference for QString. */ /*! \typedef QString::value_type + \since 4.8 The QString::const_reference typedef provides an STL-style value type for QString. diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index caaffd3..9682688 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -3381,7 +3381,10 @@ int QXmlStreamWriter::autoFormattingIndent() const } /*! - Returns \c true if the stream failed to write to the underlying device. + \since 4.8 + + Returns true if the stream failed to write to the underlying device; + otherwise returns false. The error status is never reset. Writes happening after the error occurred are ignored, even if the error condition is cleared. diff --git a/src/gui/graphicsview/qgraphicsgridlayout.cpp b/src/gui/graphicsview/qgraphicsgridlayout.cpp index 2fbfc5d..fb4bd32 100644 --- a/src/gui/graphicsview/qgraphicsgridlayout.cpp +++ b/src/gui/graphicsview/qgraphicsgridlayout.cpp @@ -600,6 +600,8 @@ void QGraphicsGridLayout::removeAt(int index) } /*! + \since 4.8 + Removes the layout item \a item without destroying it. Ownership of the item is transferred to the caller. diff --git a/src/gui/itemviews/qabstractproxymodel.cpp b/src/gui/itemviews/qabstractproxymodel.cpp index 48c84ac..f00b7ee 100644 --- a/src/gui/itemviews/qabstractproxymodel.cpp +++ b/src/gui/itemviews/qabstractproxymodel.cpp @@ -298,6 +298,7 @@ bool QAbstractProxyModel::setHeaderData(int section, Qt::Orientation orientation /*! \reimp + \since 4.8 */ QModelIndex QAbstractProxyModel::buddy(const QModelIndex &index) const { @@ -307,6 +308,7 @@ QModelIndex QAbstractProxyModel::buddy(const QModelIndex &index) const /*! \reimp + \since 4.8 */ bool QAbstractProxyModel::canFetchMore(const QModelIndex &parent) const { @@ -316,6 +318,7 @@ bool QAbstractProxyModel::canFetchMore(const QModelIndex &parent) const /*! \reimp + \since 4.8 */ void QAbstractProxyModel::fetchMore(const QModelIndex &parent) { @@ -325,6 +328,7 @@ void QAbstractProxyModel::fetchMore(const QModelIndex &parent) /*! \reimp + \since 4.8 */ void QAbstractProxyModel::sort(int column, Qt::SortOrder order) { @@ -334,6 +338,7 @@ void QAbstractProxyModel::sort(int column, Qt::SortOrder order) /*! \reimp + \since 4.8 */ QSize QAbstractProxyModel::span(const QModelIndex &index) const { @@ -343,6 +348,7 @@ QSize QAbstractProxyModel::span(const QModelIndex &index) const /*! \reimp + \since 4.8 */ bool QAbstractProxyModel::hasChildren(const QModelIndex &parent) const { @@ -352,6 +358,7 @@ bool QAbstractProxyModel::hasChildren(const QModelIndex &parent) const /*! \reimp + \since 4.8 */ QMimeData* QAbstractProxyModel::mimeData(const QModelIndexList &indexes) const { @@ -364,6 +371,7 @@ QMimeData* QAbstractProxyModel::mimeData(const QModelIndexList &indexes) const /*! \reimp + \since 4.8 */ QStringList QAbstractProxyModel::mimeTypes() const { @@ -373,6 +381,7 @@ QStringList QAbstractProxyModel::mimeTypes() const /*! \reimp + \since 4.8 */ Qt::DropActions QAbstractProxyModel::supportedDropActions() const { diff --git a/src/gui/kernel/qgenericplugin_qpa.cpp b/src/gui/kernel/qgenericplugin_qpa.cpp index e7b65b7..dae512d 100644 --- a/src/gui/kernel/qgenericplugin_qpa.cpp +++ b/src/gui/kernel/qgenericplugin_qpa.cpp @@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE \class QGenericPlugin \ingroup plugins \ingroup qpa + \since 4.8 \brief The QGenericPlugin class is an abstract base class for window-system related plugins in Qt QPA. diff --git a/src/gui/kernel/qgenericpluginfactory_qpa.cpp b/src/gui/kernel/qgenericpluginfactory_qpa.cpp index fb6a0d8..86e146a 100644 --- a/src/gui/kernel/qgenericpluginfactory_qpa.cpp +++ b/src/gui/kernel/qgenericpluginfactory_qpa.cpp @@ -61,6 +61,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, /*! \class QGenericPluginFactory \ingroup qpa + \since 4.8 \brief The QGenericPluginFactory class creates window-system related plugin drivers in Qt QPA. diff --git a/src/gui/kernel/qplatformcursor_qpa.cpp b/src/gui/kernel/qplatformcursor_qpa.cpp index 0695486..0426226 100644 --- a/src/gui/kernel/qplatformcursor_qpa.cpp +++ b/src/gui/kernel/qplatformcursor_qpa.cpp @@ -53,6 +53,7 @@ QList > QPlatformCursorPrivate::instances; /*! \class QPlatformCursor + \since 4.8 \brief The QPlatformCursor class provides information about pointer device events (movement, buttons), and requests to change @@ -105,6 +106,7 @@ QPlatformCursor::QPlatformCursor(QPlatformScreen *scr ) /*! \class QPlatformCursorImage + \since 4.8 \brief The QPlatformCursorImage class provides a set of graphics intended to be used as cursors. diff --git a/src/gui/kernel/qplatformwindowformat_qpa.cpp b/src/gui/kernel/qplatformwindowformat_qpa.cpp index 482ae68..4ab8dfd 100644 --- a/src/gui/kernel/qplatformwindowformat_qpa.cpp +++ b/src/gui/kernel/qplatformwindowformat_qpa.cpp @@ -101,11 +101,11 @@ public: /*! \class QPlatformWindowFormat + \ingroup painting + \since 4.8 \brief The QPlatformWindowFormat class specifies the display format of an OpenGL rendering context and if possible attributes of the corresponding QPlatformWindow. - \ingroup painting - QWidget has a setter and getter function for QPlatformWindowFormat. These functions can be used by the application programmer to signal what kind of format he wants to the window and glcontext should have. However, it is not always possible to fulfill these requirements. The application @@ -937,6 +937,8 @@ void QPlatformWindowFormat::setDefaultFormat(const QPlatformWindowFormat &f) /*! + \since 4.8 + Returns true if all the options of the two QPlatformWindowFormat objects \a a and \a b are equal; otherwise returns false. @@ -960,6 +962,8 @@ bool operator==(const QPlatformWindowFormat& a, const QPlatformWindowFormat& b) /*! + \since 4.8 + Returns false if all the options of the two QPlatformWindowFormat objects \a a and \a b are equal; otherwise returns true. diff --git a/src/gui/kernel/qsizepolicy.qdoc b/src/gui/kernel/qsizepolicy.qdoc index 593560e..7002ed3 100644 --- a/src/gui/kernel/qsizepolicy.qdoc +++ b/src/gui/kernel/qsizepolicy.qdoc @@ -263,6 +263,7 @@ /*! \fn void QSizePolicy::setWidthForHeight(bool dependent) + \since 4.8 Sets the flag determining whether the widget's width depends on its height, to \a dependent. @@ -276,6 +277,7 @@ /*! \fn bool QSizePolicy::hasWidthForHeight() const + \since 4.8 Returns true if the widget's width depends on its height; otherwise returns false. diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp index 56c3010..224f574 100644 --- a/src/gui/kernel/qwidget_qpa.cpp +++ b/src/gui/kernel/qwidget_qpa.cpp @@ -690,6 +690,7 @@ int QWidget::metric(PaintDeviceMetric m) const /*! \preliminary + \since 4.8 Sets the window to be the platform \a window specified. @@ -710,6 +711,7 @@ void QWidget::setPlatformWindow(QPlatformWindow *window) /*! \preliminary + \since 4.8 Returns the QPlatformWindow this widget will be drawn into. */ @@ -724,6 +726,8 @@ QPlatformWindow *QWidget::platformWindow() const } /*! + \since 4.8 + Sets the platform window format for the widget to the \a format specified. */ void QWidget::setPlatformWindowFormat(const QPlatformWindowFormat &format) @@ -743,6 +747,8 @@ void QWidget::setPlatformWindowFormat(const QPlatformWindowFormat &format) } /*! + \since 4.8 + Returns the platform window format for the widget. */ QPlatformWindowFormat QWidget::platformWindowFormat() const diff --git a/src/gui/painting/qprinterinfo.cpp b/src/gui/painting/qprinterinfo.cpp index a7ddc85..c00a1cc 100644 --- a/src/gui/painting/qprinterinfo.cpp +++ b/src/gui/painting/qprinterinfo.cpp @@ -79,6 +79,8 @@ QPrinterInfo::QPrinterInfo() } /*! + \since 4.8 + Constructs a copy of \a other. */ QPrinterInfo::QPrinterInfo(const QPrinterInfo &other) @@ -117,6 +119,8 @@ QPrinterInfo::~QPrinterInfo() } /*! + \since 4.8 + Sets the QPrinterInfo object to be equal to \a other. */ QPrinterInfo &QPrinterInfo::operator=(const QPrinterInfo &other) diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index 9e1646f..f3d4107 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -442,6 +442,8 @@ bool QFontMetrics::inFont(QChar ch) const } /*! + \since 4.8 + Returns true if the character encoded in UCS-4/UTF-32 is a valid character in the font; otherwise returns false. */ @@ -1330,6 +1332,7 @@ bool QFontMetricsF::inFont(QChar ch) const /*! \fn bool QFontMetricsF::inFontUcs4(uint ch) const + \since 4.8 Returns true if the character given by \a ch, encoded in UCS-4/UTF-32, is a valid character in the font; otherwise returns false. diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp index 7e829db..d1d1f94 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.cpp +++ b/src/gui/text/qplatformfontdatabase_qpa.cpp @@ -203,6 +203,7 @@ bool QSupportedWritingSystems::supported(QFontDatabase::WritingSystem writingSys \brief The QSupportedWritingSystems class is used when registering fonts with the internal Qt fontdatabase \ingroup painting + \since 4.8 Its to provide an easy to use interface for indicating what writing systems a specific font supports. @@ -322,6 +323,7 @@ QString QPlatformFontDatabase::fontDir() const \class QPlatformFontDatabase \brief The QPlatformFontDatabase class makes it possible to customize how fonts are discovered and how they are rendered + \since 4.8 \ingroup painting diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp index 8bbe86c..7e7ca6c 100644 --- a/src/gui/text/qtextcursor.cpp +++ b/src/gui/text/qtextcursor.cpp @@ -2569,6 +2569,7 @@ QTextDocument *QTextCursor::document() const /*! \enum Qt::CursorMoveStyle + \since 4.8 This enum describes the movement style available to text cursors. The options are: diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index c1bc846..7990667 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -579,6 +579,8 @@ bool QTextLayout::cacheEnabled() const } /*! + \since 4.8 + Set the cursor movement style. If the QTextLayout is backed by a document, you can ignore this and use the option in QTextDocument, this option is for widgets like QLineEdit or custom widgets without @@ -592,6 +594,8 @@ void QTextLayout::setCursorMoveStyle(Qt::CursorMoveStyle style) } /*! + \since 4.8 + The cursor movement style of this QTextLayout. The default is Qt::LogicalMoveStyle. @@ -725,9 +729,11 @@ int QTextLayout::previousCursorPosition(int oldPos, CursorMode mode) const } /*! + \since 4.8 + Returns the cursor position to the right of \a oldPos, next to it. - It's dependent on the visual position of characters, after bi-directional - reordering. + The position is dependent on the visual position of characters, after + bi-directional reordering. \sa leftCursorPosition(), nextCursorPosition() */ @@ -739,9 +745,11 @@ int QTextLayout::rightCursorPosition(int oldPos) const } /*! + \since 4.8 + Returns the cursor position to the left of \a oldPos, next to it. - It's dependent on the visual position of characters, after bi-directional - reordering. + The position is dependent on the visual position of characters, after + bi-directional reordering. \sa rightCursorPosition(), previousCursorPosition() */ diff --git a/src/gui/widgets/qcheckbox.cpp b/src/gui/widgets/qcheckbox.cpp index 9904a15..2210488 100644 --- a/src/gui/widgets/qcheckbox.cpp +++ b/src/gui/widgets/qcheckbox.cpp @@ -303,6 +303,7 @@ QSize QCheckBox::sizeHint() const /*! \reimp + \since 4.8 */ QSize QCheckBox::minimumSizeHint() const { diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 2d63f63..7d35766 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -1128,6 +1128,8 @@ void QLineEdit::setDragEnabled(bool b) */ /*! + \since 4.8 + Returns the movement style for the cursor in the line edit. */ Qt::CursorMoveStyle QLineEdit::cursorMoveStyle() const @@ -1137,6 +1139,8 @@ Qt::CursorMoveStyle QLineEdit::cursorMoveStyle() const } /*! + \since 4.8 + Sets the movement style for the cursor in the line edit to the given \a style. */ diff --git a/src/gui/widgets/qradiobutton.cpp b/src/gui/widgets/qradiobutton.cpp index eeef40e..9ce4eba 100644 --- a/src/gui/widgets/qradiobutton.cpp +++ b/src/gui/widgets/qradiobutton.cpp @@ -206,6 +206,7 @@ QSize QRadioButton::sizeHint() const /*! \reimp + \since 4.8 */ QSize QRadioButton::minimumSizeHint() const { diff --git a/src/gui/widgets/qtabwidget.cpp b/src/gui/widgets/qtabwidget.cpp index c6551e5..78dda23 100644 --- a/src/gui/widgets/qtabwidget.cpp +++ b/src/gui/widgets/qtabwidget.cpp @@ -885,6 +885,7 @@ QSize QTabWidget::minimumSizeHint() const /*! \reimp + \since 4.8 */ int QTabWidget::heightForWidth(int width) const { diff --git a/src/network/bearer/qnetworkconfigmanager.cpp b/src/network/bearer/qnetworkconfigmanager.cpp index fdb36e8..8065025 100644 --- a/src/network/bearer/qnetworkconfigmanager.cpp +++ b/src/network/bearer/qnetworkconfigmanager.cpp @@ -126,6 +126,7 @@ QNetworkConfigurationManagerPrivate *qNetworkConfigurationManagerPrivate() /*! \fn void QNetworkConfigurationManager::configurationRemoved(const QNetworkConfiguration &config) + \since 4.8 This signal is emitted when a configuration is about to be removed from the system. The removed configuration, specified by \a config, is invalid but retains name and identifier. diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp index 4f9836e..6d4df44 100644 --- a/src/network/kernel/qnetworkproxy.cpp +++ b/src/network/kernel/qnetworkproxy.cpp @@ -916,6 +916,8 @@ QNetworkProxyQuery::QNetworkProxyQuery(quint16 bindPort, const QString &protocol #ifndef QT_NO_BEARERMANAGEMENT /*! + \since 4.8 + Constructs a QNetworkProxyQuery with the URL \a requestUrl and sets the query type to \a queryType. The specified \a networkConfiguration is used to resolve the proxy settings. @@ -931,6 +933,8 @@ QNetworkProxyQuery::QNetworkProxyQuery(const QNetworkConfiguration &networkConfi } /*! + \since 4.8 + Constructs a QNetworkProxyQuery of type \a queryType and sets the protocol tag to be \a protocolTag. This constructor is suitable for QNetworkProxyQuery::TcpSocket queries, because it sets the @@ -953,6 +957,8 @@ QNetworkProxyQuery::QNetworkProxyQuery(const QNetworkConfiguration &networkConfi } /*! + \since 4.8 + Constructs a QNetworkProxyQuery of type \a queryType and sets the protocol tag to be \a protocolTag. This constructor is suitable for QNetworkProxyQuery::TcpSocket queries because it sets the @@ -1197,6 +1203,8 @@ QNetworkConfiguration QNetworkProxyQuery::networkConfiguration() const } /*! + \since 4.8 + Sets the network configuration component of this QNetworkProxyQuery object to be \a networkConfiguration. The network configuration can be used to return different proxy settings based on the network in diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp index 9ba8b75..518c860 100644 --- a/src/opengl/qgl_qpa.cpp +++ b/src/opengl/qgl_qpa.cpp @@ -53,6 +53,8 @@ QT_BEGIN_NAMESPACE /*! + \since 4.8 + Returns an OpenGL format for the platform window format specified by \a format. */ QGLFormat QGLFormat::fromPlatformWindowFormat(const QPlatformWindowFormat &format) @@ -87,6 +89,8 @@ QGLFormat QGLFormat::fromPlatformWindowFormat(const QPlatformWindowFormat &forma } /*! + \since 4.8 + Returns a platform window format for the OpenGL format specified by \a format. */ QPlatformWindowFormat QGLFormat::toPlatformWindowFormat(const QGLFormat &format) @@ -387,6 +391,8 @@ QGLContext::QGLContext(QPlatformGLContext *platformContext) } /*! + \since 4.8 + Returns a OpenGL context for the platform-specific OpenGL context given by \a platformContext. */ diff --git a/tools/assistant/lib/qhelpsearchquerywidget.cpp b/tools/assistant/lib/qhelpsearchquerywidget.cpp index faa80c0..9307638 100644 --- a/tools/assistant/lib/qhelpsearchquerywidget.cpp +++ b/tools/assistant/lib/qhelpsearchquerywidget.cpp @@ -511,6 +511,8 @@ QHelpSearchQueryWidget::~QHelpSearchQueryWidget() } /*! + \since 4.8 + Expands the search query widget so that the extended search fields are shown. */ void QHelpSearchQueryWidget::expandExtendedSearch() @@ -520,6 +522,8 @@ void QHelpSearchQueryWidget::expandExtendedSearch() } /*! + \since 4.8 + Collapses the search query widget so that only the default search field is shown. */ @@ -542,6 +546,8 @@ QList QHelpSearchQueryWidget::query() const } /*! + \since 4.8 + Sets the QHelpSearchQueryWidget input fields to the values specified by \a queryList search field name. Please note that one has to call the search engine's search(QList &queryList) function to perform the -- cgit v0.12 From 14486b5047d185a36efe09abe25a01742c02d4cf Mon Sep 17 00:00:00 2001 From: aavit Date: Fri, 1 Jul 2011 12:51:09 +0200 Subject: update 4.8.0 changes file --- dist/changes-4.8.0 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.8.0 b/dist/changes-4.8.0 index be67901..7dffa68 100644 --- a/dist/changes-4.8.0 +++ b/dist/changes-4.8.0 @@ -27,7 +27,9 @@ General Improvements Third party components ---------------------- - - Updated libpng to version x.y.z + - Updated libpng to version 1.5.1 + - Updated libjpeg to version 8c + - Updated zlib to version 1.2.5 **************************************************************************** @@ -65,6 +67,7 @@ QtGui - Deprecate qGenericMatrixFromMatrix4x4 and qGenericMatrixToMatrix4x4 - QListView diverses optimisations [QTBUG-11438] - QTreeWidget/QListWidget: use localeAwareCompare for string comparisons [QTBUG-10839] + - PNG image I/O: Much improved support for text annotations, including iTXt fields. QtNetwork --------- -- cgit v0.12 From 3ac6c3847a2abab63f8c45d856b19d3b38e2c78a Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 16 Jun 2011 16:10:38 +0200 Subject: Doc: Removed non-ASCII characters from the documentation. (cherry picked from commit 1bd6f1bd280ee6e1ecd4de2291c8ccfb4d06b7a4) --- doc/src/platforms/supported-platforms.qdoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc index 9d47695..ba59c37 100644 --- a/doc/src/platforms/supported-platforms.qdoc +++ b/doc/src/platforms/supported-platforms.qdoc @@ -334,8 +334,8 @@ \section2 Advanced Text Layout Engine - Qt for Windows CE supports TrueType® and raster fonts. Qt also has - extended Unicode support and right-to-left languages. Qt’s rich text + Qt for Windows CE supports TrueType and raster fonts. Qt also has + extended Unicode support and right-to-left languages. Qt's rich text engine adds capabilities for complex text layouts including tables, path tracing and text which flows around shapes. @@ -373,7 +373,7 @@ by embedded Linux. You can use Qt to create highly memory efficient devices and applications that have completely unique user experiences. - Qt runs anywhere Linux runs. Qt’s intuitive API means fewer lines of + Qt runs anywhere Linux runs. Qt's intuitive API means fewer lines of code and higher level functionality in less time. Use the code from one single code-base and rebuild for all \l{Supported Platforms} {supported platforms}. @@ -410,7 +410,7 @@ frame buffer} that will match the physical device display, pixel for pixel. This gives the developer a realistic testing infrastructure testing on the desktop where the frame buffer simulates the physical - device display’s width, height and color depth. + device display's width, height and color depth. \section2 Inter-Process Communication (IPC) @@ -421,7 +421,7 @@ \section2 Extended Font Format Qt supports a wide range of font formats on embedded Linux including: - TrueType®, Postscript® Type1 and Qt pre-rendered fonts. Qt has + TrueType, Postscript Type1 and Qt pre-rendered fonts. Qt has extended Unicode support including automatic data extraction at build time and automatic update at runtime. @@ -681,7 +681,7 @@ \group platform-details Qt is a cross-platform application and UI framework. Using Qt, - you can write web-enabled applications once and deploy them + you can write GUI applications once and deploy them across desktop, mobile and embedded operating systems without rewriting the source code. -- cgit v0.12 From 8304ca4edd7bd71dd0398451e62a281eac54d0a6 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 16 Jun 2011 20:20:50 +0200 Subject: Doc: Added more appropriate links to help reduce confusion. Task-number: QTBUG-19919 (cherry picked from commit 26c29a2dd7efa4c66063d1255e1f694462cbae85) --- src/gui/widgets/qtextedit.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp index 2670089..61d4fed 100644 --- a/src/gui/widgets/qtextedit.cpp +++ b/src/gui/widgets/qtextedit.cpp @@ -2472,6 +2472,8 @@ bool QTextEdit::find(const QString &exp, QTextDocument::FindFlags options) and the text edit will try to guess the right format. Use setHtml() or setPlainText() directly to avoid text edit's guessing. + + \sa toPlainText(), toHtml() */ void QTextEdit::setText(const QString &text) { -- cgit v0.12 From e32db846484eb3f9e2cc109d1c9250d326ee97d0 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 16 Jun 2011 20:24:11 +0200 Subject: Doc: Added a simple introduction to Qt and fixed links. (cherry picked from commit 9ed61311bce15b8f1bb4b30ee9133f1a2355f41d) --- doc/src/declarative/declarativeui.qdoc | 2 +- doc/src/declarative/qtquick-intro.qdoc | 2 +- doc/src/index.qdoc | 4 +- doc/src/qt-features.qdoc | 204 +++++++++++++++++++++++++++++++++ doc/src/qt4-intro.qdoc | 2 +- 5 files changed, 209 insertions(+), 5 deletions(-) create mode 100644 doc/src/qt-features.qdoc diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc index d89ca53..cecccf6 100644 --- a/doc/src/declarative/declarativeui.qdoc +++ b/doc/src/declarative/declarativeui.qdoc @@ -46,7 +46,7 @@ Qt applications. \section1 Getting Started \list -\o \l{Intro to Qt Quick}{Introduction to Qt Quick} +\o \l{Introduction to Qt Quick} \o \l{QML for Qt Programmers}{QML Programming for Qt Programmers} \o \l{Getting Started Programming with QML} diff --git a/doc/src/declarative/qtquick-intro.qdoc b/doc/src/declarative/qtquick-intro.qdoc index bdad2c3..4cd5db3 100644 --- a/doc/src/declarative/qtquick-intro.qdoc +++ b/doc/src/declarative/qtquick-intro.qdoc @@ -27,7 +27,7 @@ /*! \page qml-intro.html -\title Intro to Qt Quick +\title Introduction to Qt Quick Qt Quick is a collection of technologies that are designed to help developers create the kind of intuitive, modern, and fluid user interfaces that are diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 979c654..2ce6781 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -36,8 +36,8 @@ What is Qt \enddiv \list - \o \l{Qt Whitepaper}{Qt C++ Framework} - \o \l{Intro to Qt Quick}{Qt Quick} + \o \l{Qt Features Overview} + \o \l{Introduction to Qt Quick}{Qt Quick} \o \l{external: Qt Mobility Manual}{Qt Mobility} \o \l{Qt WebKit} \endlist diff --git a/doc/src/qt-features.qdoc b/doc/src/qt-features.qdoc new file mode 100644 index 0000000..0ae00b0 --- /dev/null +++ b/doc/src/qt-features.qdoc @@ -0,0 +1,204 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms +** and conditions contained in a signed written agreement between you +** and Nokia. +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page qt-overview.html + \title Qt Features Overview + + This document provides a summary of the most important features of Qt, + providing links to other pages in the documentation that cover these + features in more detail. It is not intended to be a comprehensive + guide to Qt's features. + + \section1 Fundamental Technologies in Qt + + Qt is built upon a set of core technologies, provided by the \l QtCore + and \l QtGui modules. These include the following: + + \list + \o \l{The Tulip Container Classes}, a set of template container classes. + \o \l{The Arthur Paint System}, the Qt 4 painting framework. + \o \l{The Interview Framework}, a model/view architecture for item views + and the \l{QtSQL Module}, which also uses this architecture. + \o \l{The Scribe Classes}, a framework for creating text documents, + performing low-level text layout and writing OpenDocument files. + \o A collection of \l{Qt Widget Gallery}{common desktop widgets}, styled + to fit in on each supported platform. + \o \l{The Qt 4 Main Window Classes}, a main window, toolbar, menu, and + docking architecture. + \o The \l{Graphics View} framework provides a canvas for producing + interactive graphics. + \o The \l{QtNetwork Module} provides support for TCP, UDP and local + sockets that are integrated with Qt's event model, including support + for Secure Socket Layer (SSL) communications, + \l{QNetworkProxy}{network proxy} servers and + \l{Bearer Management}{network bearer management}. + \o Enhanced \l{qt4-threads.html}{thread support} allows + \l{Signals & Slots}{signal-slot} connections across threads and + per-thread event loops. + Additionally, \l{Thread Support in Qt}{a framework for concurrent programming} + using Qt paradigms makes common threading tasks easier. + \o A \l{resource system} for embedding images and other resource files + into executable files makes it easier to deploy applications. + \o A \l{QTestLib Manual}{unit testing framework} for Qt applications and + libraries. + \endlist + + The mature classes provided by these technologies have been used to build + robust, cross-platform desktop applications. They are augmented by a number + of additional technologies and improvements that have appeared over the + lifetime of Qt 4. + + \section1 Graphical User Interfaces + + \div{class="float-right"} + \inlineimage gtk-tabwidget.png + \enddiv + \div{class="float-right"} + \inlineimage gtk-progressbar.png + \br + \inlineimage gtk-checkbox.png + \br + \inlineimage plastique-combobox.png + \br + \inlineimage plastique-radiobutton.png + \enddiv + + Alongside the support for traditional desktop user interfaces, Qt includes + support for declarative UI development with \l{Qt Quick}, a set of + technologies for creating fluid, dynamic user interfaces. A starting point + for exploring this approach can be found in the \l{Introduction to Qt Quick} + guide. + + Qt provides a range of standard user interface elements, called widgets, + for each supported platform. Widgets can be used as containers for other + widgets, as windows, and as regular controls that the user interacts with. + Where the platform supports it, widgets can be made to appear partially + transparent, and may be styled with \l{Qt Style Sheets}. + + Support for \l{QTouchEvent}{touch input} and \l{Gestures Programming}{gestures} + enable widgets to be used to create intuitive user interfaces for + touch-enabled devices. + + User interfaces can also be created dynamically at run-time with the + features provided by the \l{QtUiTools} module. + + A selection of available widgets are shown in the \l{Qt Widget Gallery}. + An introduction to the concepts behind widgets can be found in the + \l{Widgets Tutorial}. + + \clearfloat + \section1 Painting, Printing and Rendering + + \div{class="float-left"} + \inlineimage qpainter-affinetransformations.png + \enddiv + + Widgets are just one of many kinds of paint device that Qt can render onto. + This support for unified painting makes it possible for applications to use + the same painting code for different tasks, as well as allowing Qt to be + extended to support additional file formats. + + Qt provides support for common bitmap image formats, + \l{QtSvg Module}{Scalable Vector Graphics} (SVG) drawings and animations, + Postscript and Portable Document Format (PDF) files. Postscript and PDF are + integrated with \l{Printing with Qt}{Qt's printing system}, which also + allows printed output to be previewed. + + Interactive graphics can be created with the + \l{The Animation Framework}{animation framework}, allowing animations to be + used with both widgets and graphics items. Animations can be used with the + \l{The State Machine Framework}{state machine framework}, which provides a + way to express application logic and integrate it with the user interface. + Animations can be enhanced with a collection of + \l{QGraphicsEffect}{graphics effects} that operate on graphics items and + can be applied individually or combined to create more complex effects. + + Qt supports integration with \l{QtOpenGL}{OpenGL} on a number of levels, + providing convenience functions for handling textures and colors, as well + as providing support for pixel and sample buffers. Future support for + higher level 3D integration is provided by Qt3D enablers which include + \l{QMatrix4x4}{matrix multiplication}, \l{QQuaternion}{quaternions}, and an + API for \l{QGLShader}{vertex and fragment shaders}. + + Two APIs are provided for multimedia. The + \l{Phonon Overview}{Phonon Multimedia Framework} has traditionally been + used on desktop platforms. A set of + \l{QtMultimedia Module}{multimedia services} provides low-level access to + the system's audio system and is often used on mobile devices. + + \clearfloat + \section1 Infrastructure + + \div{class="float-right"} + \inlineimage qtscript-context2d.png + \enddiv + + Facilities for Inter-Process Communication (IPC) and Remote Procedure + Calling (RPC) mechanisms are available on platforms that support the + \l{intro-to-dbus.html}{D-Bus} message bus system. + + An \l{Undo Framework}{Undo framework} based on the + \l{Books about GUI Design#Design Patterns}{Command pattern} is designed to + enable a consistent approach to handling data in editing applications. + + The \l{QtScript} and \l{QtScriptTools} modules provide support for + application scripting and debugging using the ECMAScript language. + + The \l{QtHelp Module} provides the foundations of an interactive help + system that can be used in conjunction with Qt Creator or integrated into + applications directly. + + XML handling is supported in a number of places in Qt. The \l QtCore module + provides classes for reading and writing XML streams. The \l QtXmlPatterns + module includes XQuery, XPath and XSLT support, providing facilities for + XML processing beyond that supported by the QtXml module, which contains + SAX and DOM parsers. XML schema validation in the QtXmlPatterns module + covers large parts of version 1.0 of the specification. + + \clearfloat + \section1 Web Client Integration + + Integration between \l{Webkit in Qt}{Qt and WebKit} makes it possible for + developers to use a fully-featured Web browser engine to display documents + and access online services. Developers can access the browser's environment + to create documents and run scripts within one or more browser widgets. + + A \l{QWebElement}{DOM access API} for QtWebKit provides a cleaner and safer + way to access elements and structures of Web pages without the use of + JavaScript. + + \section1 Further Reading + + Many of the technologies mentioned here, as well as other, more specific + features, are listed in the \l{What's New in Qt 4} document. A complete + list of Qt's modules can be found on the \l{All Modules} page, which + also includes more domain-specific technologies. + + The tools that are supplied with Qt are covered by the listing in the + \l{Qt's Tools} document. +*/ diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index 41d8b2e..d75bdca 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -132,7 +132,7 @@ In Qt 4.4: \list - \o \l{Webkit in QT}{Qt WebKit integration}, making it possible for developers + \o \l{WebKit in Qt}{Qt WebKit integration}, making it possible for developers to use a fully-featured Web browser to display documents and access online services. \o A multimedia API provided by the \l{Phonon Overview}{Phonon Multimedia Framework}. -- cgit v0.12 From a8f466030b5774adb558ca88552a473f28aa2c89 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 30 Jun 2011 19:08:43 +0200 Subject: Modified \since command behavior slightly to handle project and version. (The since argument can contain a project name and version, defaulting to the qdoc project if only a version number is specified.) Refactored common code into the Generator class. Fixed \sincelist HTML generation for tables containing only one item. (cherry picked from commit 6a2f18140bbc41207eb2f5e2323b699600d89606) --- tools/qdoc3/ditaxmlgenerator.cpp | 83 ----------------------- tools/qdoc3/ditaxmlgenerator.h | 11 --- tools/qdoc3/doc.cpp | 2 +- tools/qdoc3/generator.cpp | 142 +++++++++++++++++++++++++++++++++++++-- tools/qdoc3/generator.h | 12 ++++ tools/qdoc3/htmlgenerator.cpp | 103 +++++----------------------- tools/qdoc3/htmlgenerator.h | 11 --- tools/qdoc3/node.cpp | 10 +++ tools/qdoc3/node.h | 2 +- 9 files changed, 174 insertions(+), 202 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index b801e1e..ae7385e 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -62,25 +62,6 @@ QT_BEGIN_NAMESPACE #define COMMAND_VERSION Doc::alias("version") int DitaXmlGenerator::id = 0; -QString DitaXmlGenerator::sinceTitles[] = - { - " New Namespaces", - " New Classes", - " New Member Functions", - " New Functions in Namespaces", - " New Global Functions", - " New Macros", - " New Enum Types", - " New Typedefs", - " New Properties", - " New Variables", - " New QML Elements", - " New Qml Properties", - " New Qml Signals", - " New Qml Methods", - "" - }; - /* The strings in this array must appear in the same order as the values in enum DitaXmlGenerator::DitaTag. @@ -3952,70 +3933,6 @@ void DitaXmlGenerator::findAllClasses(const InnerNode* node) } } -/*! - For generating the "New Classes... in 4.x" section on the - What's New in 4.x" page. - */ -void DitaXmlGenerator::findAllSince(const InnerNode* node) -{ - NodeList::const_iterator child = node->childNodes().constBegin(); - while (child != node->childNodes().constEnd()) { - QString sinceVersion = (*child)->since(); - if (((*child)->access() != Node::Private) && !sinceVersion.isEmpty()) { - NewSinceMaps::iterator nsmap = newSinceMaps.find(sinceVersion); - if (nsmap == newSinceMaps.end()) - nsmap = newSinceMaps.insert(sinceVersion,NodeMultiMap()); - NewClassMaps::iterator ncmap = newClassMaps.find(sinceVersion); - if (ncmap == newClassMaps.end()) - ncmap = newClassMaps.insert(sinceVersion,NodeMap()); - NewClassMaps::iterator nqcmap = newQmlClassMaps.find(sinceVersion); - if (nqcmap == newQmlClassMaps.end()) - nqcmap = newQmlClassMaps.insert(sinceVersion,NodeMap()); - - if ((*child)->type() == Node::Function) { - FunctionNode *func = static_cast(*child); - if ((func->status() > Node::Obsolete) && - (func->metaness() != FunctionNode::Ctor) && - (func->metaness() != FunctionNode::Dtor)) { - nsmap.value().insert(func->name(),(*child)); - } - } - else if ((*child)->url().isEmpty()) { - if ((*child)->type() == Node::Class && !(*child)->doc().isEmpty()) { - QString className = (*child)->name(); - if ((*child)->parent() && - (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) - className = (*child)->parent()->name()+"::"+className; - nsmap.value().insert(className,(*child)); - ncmap.value().insert(className,(*child)); - } - else if ((*child)->subType() == Node::QmlClass) { - QString className = (*child)->name(); - if ((*child)->parent() && - (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) - className = (*child)->parent()->name()+"::"+className; - nsmap.value().insert(className,(*child)); - nqcmap.value().insert(className,(*child)); - } - } - else { - QString name = (*child)->name(); - if ((*child)->parent() && - (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) - name = (*child)->parent()->name()+"::"+name; - nsmap.value().insert(name,(*child)); - } - if ((*child)->isInnerNode()) { - findAllSince(static_cast(*child)); - } - } - ++child; - } -} - void DitaXmlGenerator::findAllFunctions(const InnerNode* node) { NodeList::ConstIterator c = node->childNodes().begin(); diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 408f46c..d8d3563 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -51,12 +51,6 @@ QT_BEGIN_NAMESPACE -typedef QMultiMap NodeMultiMap; -typedef QMap NewSinceMaps; -typedef QMap ParentMaps; -typedef QMap NodeMap; -typedef QMap NewClassMaps; - typedef QMap GuidMap; typedef QMap GuidMaps; @@ -418,7 +412,6 @@ class DitaXmlGenerator : public PageGenerator void findAllFunctions(const InnerNode *node); void findAllLegaleseTexts(const InnerNode *node); void findAllNamespaces(const InnerNode *node); - void findAllSince(const InnerNode *node); static int hOffset(const Node *node); static bool isThreeColumnEnumValueTable(const Atom *atom); virtual QString getLink(const Atom *atom, @@ -515,10 +508,6 @@ class DitaXmlGenerator : public PageGenerator #endif QMap funcIndex; QMap legaleseTexts; - NewSinceMaps newSinceMaps; - static QString sinceTitles[]; - NewClassMaps newClassMaps; - NewClassMaps newQmlClassMaps; static int id; static QString ditaTags[]; QStack xmlWriterStack; diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index 479931d..37f68f8 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -828,7 +828,7 @@ void DocParser::parse(const QString& source, append(Atom::AnnotatedList, getArgument()); break; case CMD_SINCELIST: - append(Atom::SinceList, getArgument()); + append(Atom::SinceList, getRestOfLine().simplified()); break; case CMD_GENERATELIST: append(Atom::GeneratedList, getArgument()); diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index 3367301..c20d2b4 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -77,6 +77,25 @@ QString Generator::outDir; QString Generator::project; QHash Generator::outputPrefixes; +QString Generator::sinceTitles[] = + { + " New Namespaces", + " New Classes", + " New Member Functions", + " New Functions in Namespaces", + " New Global Functions", + " New Macros", + " New Enum Types", + " New Typedefs", + " New Properties", + " New Variables", + " New QML Elements", + " New QML Properties", + " New QML Signals", + " New QML Methods", + "" + }; + static void singularPlural(Text& text, const NodeList& nodes) { if (nodes.count() == 1) @@ -760,8 +779,18 @@ QString Generator::typeString(const Node *node) case Node::Class: return "class"; case Node::Fake: - default: - return "documentation"; + { + switch (node->subType()) { + case Node::QmlClass: + return "element"; + case Node::QmlPropertyGroup: + return "property group"; + case Node::QmlBasicType: + return "type"; + default: + return "documentation"; + } + } case Node::Enum: return "enum"; case Node::Typedef: @@ -770,6 +799,8 @@ QString Generator::typeString(const Node *node) return "function"; case Node::Property: return "property"; + default: + return "documentation"; } } @@ -1091,11 +1122,21 @@ void Generator::generateSince(const Node *node, CodeMarker *marker) text << " was introduced or modified in "; else text << " was introduced in "; - if (project.isEmpty()) - text << "version"; - else - text << project; - text << " " << node->since() << "." << Atom::ParaRight; + + QStringList since = node->since().split(" "); + if (since.count() == 1) { + // Handle legacy use of \since . + if (project.isEmpty()) + text << "version"; + else + text << project; + text << " " << since[0]; + } else { + // Reconstruct the string. + text << " " << since.join(" "); + } + + text << "." << Atom::ParaRight; generateText(text, node, marker); } } @@ -1346,4 +1387,91 @@ QStringList Generator::getMetadataElements(const InnerNode* inner, const QString return s; } +/*! + For generating the "New Classes... in 4.6" section on the + What's New in 4.6" page. + */ +void Generator::findAllSince(const InnerNode *node) +{ + NodeList::const_iterator child = node->childNodes().constBegin(); + + // Traverse the tree, starting at the node supplied. + + while (child != node->childNodes().constEnd()) { + + QString sinceString = (*child)->since(); + + if (((*child)->access() != Node::Private) && !sinceString.isEmpty()) { + + // Insert a new entry into each map for each new since string found. + NewSinceMaps::iterator nsmap = newSinceMaps.find(sinceString); + if (nsmap == newSinceMaps.end()) + nsmap = newSinceMaps.insert(sinceString,NodeMultiMap()); + + NewClassMaps::iterator ncmap = newClassMaps.find(sinceString); + if (ncmap == newClassMaps.end()) + ncmap = newClassMaps.insert(sinceString,NodeMap()); + + NewClassMaps::iterator nqcmap = newQmlClassMaps.find(sinceString); + if (nqcmap == newQmlClassMaps.end()) + nqcmap = newQmlClassMaps.insert(sinceString,NodeMap()); + + if ((*child)->type() == Node::Function) { + // Insert functions into the general since map. + FunctionNode *func = static_cast(*child); + if ((func->status() > Node::Obsolete) && + (func->metaness() != FunctionNode::Ctor) && + (func->metaness() != FunctionNode::Dtor)) { + nsmap.value().insert(func->name(),(*child)); + } + } + else if ((*child)->url().isEmpty()) { + if ((*child)->type() == Node::Class && !(*child)->doc().isEmpty()) { + // Insert classes into the since and class maps. + QString className = (*child)->name(); + if ((*child)->parent() && + (*child)->parent()->type() == Node::Namespace && + !(*child)->parent()->name().isEmpty()) + className = (*child)->parent()->name()+"::"+className; + + nsmap.value().insert(className,(*child)); + ncmap.value().insert(className,(*child)); + } + else if ((*child)->subType() == Node::QmlClass) { + // Insert QML elements into the since and element maps. + QString className = (*child)->name(); + if ((*child)->parent() && + (*child)->parent()->type() == Node::Namespace && + !(*child)->parent()->name().isEmpty()) + className = (*child)->parent()->name()+"::"+className; + + nsmap.value().insert(className,(*child)); + nqcmap.value().insert(className,(*child)); + } + else if ((*child)->type() == Node::QmlProperty) { + // Insert QML properties into the since map. + QString propertyName = (*child)->name(); + nsmap.value().insert(propertyName,(*child)); + } + } + else { + // Insert external documents into the general since map. + QString name = (*child)->name(); + if ((*child)->parent() && + (*child)->parent()->type() == Node::Namespace && + !(*child)->parent()->name().isEmpty()) + name = (*child)->parent()->name()+"::"+name; + + nsmap.value().insert(name,(*child)); + } + + // Find child nodes with since commands. + if ((*child)->isInnerNode()) { + findAllSince(static_cast(*child)); + } + } + ++child; + } +} + QT_END_NAMESPACE diff --git a/tools/qdoc3/generator.h b/tools/qdoc3/generator.h index e5e9747..e66915b 100644 --- a/tools/qdoc3/generator.h +++ b/tools/qdoc3/generator.h @@ -57,6 +57,12 @@ QT_BEGIN_NAMESPACE +typedef QMap NodeMap; +typedef QMultiMap NodeMultiMap; +typedef QMap NewSinceMaps; +typedef QMap ParentMaps; +typedef QMap NewClassMaps; + class ClassNode; class Config; class CodeMarker; @@ -152,6 +158,7 @@ class Generator QString getMetadataElement(const InnerNode* inner, const QString& t); QStringList getMetadataElements(const InnerNode* inner, const QString& t); + void findAllSince(const InnerNode *node); private: void generateReimplementedFrom(const FunctionNode *func, @@ -180,6 +187,11 @@ class Generator const NodeList& subs, CodeMarker *marker); + static QString sinceTitles[]; + NewSinceMaps newSinceMaps; + NewClassMaps newClassMaps; + NewClassMaps newQmlClassMaps; + private: QString amp; QString lt; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 52da178..655c3b4 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -66,25 +66,6 @@ bool HtmlGenerator::debugging_on = false; QString HtmlGenerator::divNavTop = ""; -QString HtmlGenerator::sinceTitles[] = - { - " New Namespaces", - " New Classes", - " New Member Functions", - " New Functions in Namespaces", - " New Global Functions", - " New Macros", - " New Enum Types", - " New Typedefs", - " New Properties", - " New Variables", - " New QML Elements", - " New QML Properties", - " New QML Signals", - " New QML Methods", - "" - }; - static bool showBrokenLinks = false; static QRegExp linkTag("(<@link node=\"([^\"]+)\">).*()"); @@ -606,14 +587,18 @@ int HtmlGenerator::generateAtom(const Atom *atom, ncmap = newClassMaps.find(atom->string()); NewClassMaps::const_iterator nqcmap; nqcmap = newQmlClassMaps.find(atom->string()); + if ((nsmap != newSinceMaps.constEnd()) && !nsmap.value().isEmpty()) { QList
sections; QList
::ConstIterator s; + for (int i=0; itype()) { case Node::Fake: @@ -1346,6 +1331,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) // Generate brief text and status for modules. generateBrief(fake, marker); generateStatus(fake, marker); + generateSince(fake, marker); if (moduleNamespaceMap.contains(fake->name())) { out() << "" << divNavTop << "\n"; @@ -1362,6 +1348,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) // Generate brief text and status for modules. generateBrief(fake, marker); generateStatus(fake, marker); + generateSince(fake, marker); out() << "
    \n"; @@ -1393,6 +1380,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) generateQmlInherits(qml_cn, marker); generateQmlInheritedBy(qml_cn, marker); generateQmlInstantiates(qml_cn, marker); + generateSince(qml_cn, marker); QString allQmlMembersLink = generateAllQmlMembersFile(qml_cn, marker); if (!allQmlMembersLink.isEmpty()) { @@ -2242,9 +2230,6 @@ void HtmlGenerator::generateCompactList(const Node *relative, for (int i=0; i element to contain all the
    elements. */ out() << "
    \n"; + numTableRows = 0; + + int curParNr = 0; + int curParOffset = 0; - for (int i=0; i\n"; curParOffset++; } - out() << "
    \n"; + if (classMap.count() > 0) + out() << "\n"; + out() << "\n"; } @@ -3357,70 +3348,6 @@ void HtmlGenerator::findAllClasses(const InnerNode *node) } } -/*! - For generating the "New Classes... in 4.6" section on the - What's New in 4.6" page. - */ -void HtmlGenerator::findAllSince(const InnerNode *node) -{ - NodeList::const_iterator child = node->childNodes().constBegin(); - while (child != node->childNodes().constEnd()) { - QString sinceVersion = (*child)->since(); - if (((*child)->access() != Node::Private) && !sinceVersion.isEmpty()) { - NewSinceMaps::iterator nsmap = newSinceMaps.find(sinceVersion); - if (nsmap == newSinceMaps.end()) - nsmap = newSinceMaps.insert(sinceVersion,NodeMultiMap()); - NewClassMaps::iterator ncmap = newClassMaps.find(sinceVersion); - if (ncmap == newClassMaps.end()) - ncmap = newClassMaps.insert(sinceVersion,NodeMap()); - NewClassMaps::iterator nqcmap = newQmlClassMaps.find(sinceVersion); - if (nqcmap == newQmlClassMaps.end()) - nqcmap = newQmlClassMaps.insert(sinceVersion,NodeMap()); - - if ((*child)->type() == Node::Function) { - FunctionNode *func = static_cast(*child); - if ((func->status() > Node::Obsolete) && - (func->metaness() != FunctionNode::Ctor) && - (func->metaness() != FunctionNode::Dtor)) { - nsmap.value().insert(func->name(),(*child)); - } - } - else if ((*child)->url().isEmpty()) { - if ((*child)->type() == Node::Class && !(*child)->doc().isEmpty()) { - QString className = (*child)->name(); - if ((*child)->parent() && - (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) - className = (*child)->parent()->name()+"::"+className; - nsmap.value().insert(className,(*child)); - ncmap.value().insert(className,(*child)); - } - else if ((*child)->subType() == Node::QmlClass) { - QString className = (*child)->name(); - if ((*child)->parent() && - (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) - className = (*child)->parent()->name()+"::"+className; - nsmap.value().insert(className,(*child)); - nqcmap.value().insert(className,(*child)); - } - } - else { - QString name = (*child)->name(); - if ((*child)->parent() && - (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) - name = (*child)->parent()->name()+"::"+name; - nsmap.value().insert(name,(*child)); - } - if ((*child)->isInnerNode()) { - findAllSince(static_cast(*child)); - } - } - ++child; - } -} - void HtmlGenerator::findAllFunctions(const InnerNode *node) { NodeList::ConstIterator c = node->childNodes().begin(); diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 70ec0b7..e36c562 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -56,12 +56,6 @@ QT_BEGIN_NAMESPACE -typedef QMultiMap NodeMultiMap; -typedef QMap NewSinceMaps; -typedef QMap ParentMaps; -typedef QMap NodeMap; -typedef QMap NewClassMaps; - class HelpProjectWriter; class HtmlGenerator : public PageGenerator @@ -224,7 +218,6 @@ class HtmlGenerator : public PageGenerator void findAllFunctions(const InnerNode *node); void findAllLegaleseTexts(const InnerNode *node); void findAllNamespaces(const InnerNode *node); - void findAllSince(const InnerNode *node); static int hOffset(const Node *node); static bool isThreeColumnEnumValueTable(const Atom *atom); virtual QString getLink(const Atom *atom, @@ -292,10 +285,6 @@ class HtmlGenerator : public PageGenerator NodeMap qmlClasses; QMap funcIndex; QMap legaleseTexts; - NewSinceMaps newSinceMaps; - static QString sinceTitles[]; - NewClassMaps newClassMaps; - NewClassMaps newQmlClassMaps; static int id; public: static bool debugging_on; diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 683c210..87bbd93 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -157,6 +157,16 @@ void Node::setLink(LinkType linkType, const QString &link, const QString &desc) } /*! + Sets the information about the project and version a node was introduced + in. The string is simplified, removing excess whitespace before being + stored. +*/ +void Node::setSince(const QString &since) +{ + sinc = since.simplified(); +} + +/*! Returns a string representing the access specifier. */ QString Node::accessString() const diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index e1e9440..cb16bea 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -151,7 +151,7 @@ class Node void setDoc(const Doc& doc, bool replace = false); void setStatus(Status status) { sta = status; } void setThreadSafeness(ThreadSafeness safeness) { saf = safeness; } - void setSince(const QString &since) { sinc = since; } + void setSince(const QString &since); void setRelates(InnerNode* pseudoParent); void setModuleName(const QString &module) { mod = module; } void setLink(LinkType linkType, const QString &link, const QString &desc); -- cgit v0.12 From 0d2cfeb64899e0a482eb29bebb79a74b04c7ef0f Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 30 Jun 2011 19:13:55 +0200 Subject: Doc: Removed whitespace. (cherry picked from commit 01b3f508d1f7e9951baf60f487feadfa98ba4751) --- doc/src/qt4-intro.qdoc | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index d75bdca..1547a7c 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -610,7 +610,6 @@ introduced in Qt 4.7. \sincelist 4.7 - */ /*! -- cgit v0.12 From 0db519c9fc585e509dd8138cefcb4762ed3f8b7c Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 30 Jun 2011 19:14:30 +0200 Subject: Doc: Standardized on QtQuick for \since declarations. (cherry picked from commit 609dc22f719ecb8d48349fd56f84960bbf46d731) --- src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp | 4 ++-- src/declarative/graphicsitems/qdeclarativeborderimage.cpp | 4 ++-- src/declarative/graphicsitems/qdeclarativeflickable.cpp | 4 ++-- src/declarative/graphicsitems/qdeclarativegridview.cpp | 2 +- src/declarative/graphicsitems/qdeclarativeimage.cpp | 4 ++-- src/declarative/graphicsitems/qdeclarativeitem.cpp | 2 +- src/declarative/graphicsitems/qdeclarativelistview.cpp | 2 +- src/declarative/graphicsitems/qdeclarativemousearea.cpp | 2 +- src/declarative/graphicsitems/qdeclarativepositioners.cpp | 6 +++--- src/declarative/graphicsitems/qdeclarativerepeater.cpp | 6 +++--- src/declarative/graphicsitems/qdeclarativetext.cpp | 8 ++++---- src/declarative/graphicsitems/qdeclarativetextedit.cpp | 10 +++++----- src/declarative/graphicsitems/qdeclarativetextinput.cpp | 8 ++++---- 13 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp index 8787a5e..b1ebec8 100644 --- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp @@ -114,7 +114,7 @@ QT_BEGIN_NAMESPACE /*! \qmlproperty bool AnimatedImage::cache - \since Quick 1.1 + \since QtQuick 1.1 Specifies whether the image should be cached. The default value is true. Setting \a cache to false is useful when dealing with large images, @@ -123,7 +123,7 @@ QT_BEGIN_NAMESPACE /*! \qmlproperty bool AnimatedImage::mirror - \since Quick 1.1 + \since QtQuick 1.1 This property holds whether the image should be horizontally inverted (effectively displaying a mirrored image). diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp index 9c274e9..4b4efb6 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -215,7 +215,7 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage() /*! \qmlproperty bool BorderImage::cache - \since Quick 1.1 + \since QtQuick 1.1 Specifies whether the image should be cached. The default value is true. Setting \a cache to false is useful when dealing with large images, @@ -224,7 +224,7 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage() /*! \qmlproperty bool BorderImage::mirror - \since Quick 1.1 + \since QtQuick 1.1 This property holds whether the image should be horizontally inverted (effectively displaying a mirrored image). diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 13bb8ef..dbab8cc 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -1393,7 +1393,7 @@ void QDeclarativeFlickable::setContentHeight(qreal h) /*! \qmlmethod Flickable::resizeContent(real width, real height, QPointF center) \preliminary - \since Quick 1.1 + \since QtQuick 1.1 Resizes the content to \a width x \a height about \a center. @@ -1433,7 +1433,7 @@ void QDeclarativeFlickable::resizeContent(qreal w, qreal h, QPointF center) /*! \qmlmethod Flickable::returnToBounds() \preliminary - \since Quick 1.1 + \since QtQuick 1.1 Ensures the content is within legal bounds. diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index a0264f7..7972b6f 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -2587,7 +2587,7 @@ void QDeclarativeGridView::positionViewAtIndex(int index, int mode) /*! \qmlmethod GridView::positionViewAtBeginning() \qmlmethod GridView::positionViewAtEnd() - \since Quick 1.1 + \since QtQuick 1.1 Positions the view at the beginning or end, taking into account any header or footer. diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp index e6bb798..9b9d680 100644 --- a/src/declarative/graphicsitems/qdeclarativeimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp @@ -473,7 +473,7 @@ QRectF QDeclarativeImage::boundingRect() const /*! \qmlproperty bool Image::cache - \since Quick 1.1 + \since QtQuick 1.1 Specifies whether the image should be cached. The default value is true. Setting \a cache to false is useful when dealing with large images, @@ -482,7 +482,7 @@ QRectF QDeclarativeImage::boundingRect() const /*! \qmlproperty bool Image::mirror - \since Quick 1.1 + \since QtQuick 1.1 This property holds whether the image should be horizontally inverted (effectively displaying a mirrored image). diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 805ca4d..d36d163 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -3480,7 +3480,7 @@ qreal QDeclarativeItem::implicitHeight() const /*! \qmlproperty real Item::implicitWidth \qmlproperty real Item::implicitHeight - \since Quick 1.1 + \since QtQuick 1.1 Defines the natural width or height of the Item if no \l width or \l height is specified. diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 7a5e433..d714404 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -3009,7 +3009,7 @@ void QDeclarativeListView::positionViewAtIndex(int index, int mode) /*! \qmlmethod ListView::positionViewAtBeginning() \qmlmethod ListView::positionViewAtEnd() - \since Quick 1.1 + \since QtQuick 1.1 Positions the view at the beginning or end, taking into account any header or footer. diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index 18f008a..0e06a4c 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -419,7 +419,7 @@ void QDeclarativeMouseArea::setEnabled(bool a) /*! \qmlproperty bool MouseArea::preventStealing - \since Quick 1.1 + \since QtQuick 1.1 This property holds whether the mouse events may be stolen from this MouseArea. diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp index f3d1a68..483cad4 100644 --- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp +++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp @@ -584,7 +584,7 @@ QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent) /*! \qmlproperty enumeration Row::layoutDirection - \since Quick 1.1 + \since QtQuick 1.1 This property holds the layoutDirection of the row. @@ -878,7 +878,7 @@ void QDeclarativeGrid::setFlow(Flow flow) /*! \qmlproperty enumeration Grid::layoutDirection - \since Quick 1.1 + \since QtQuick 1.1 This property holds the layout direction of the layout. @@ -1236,7 +1236,7 @@ void QDeclarativeFlow::setFlow(Flow flow) /*! \qmlproperty enumeration Flow::layoutDirection - \since Quick 1.1 + \since QtQuick 1.1 This property holds the layout direction of the layout. diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp index 813c255..e881b96 100644 --- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp +++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp @@ -128,7 +128,7 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate() /*! \qmlsignal Repeater::onItemAdded(int index, Item item) - \since Quick 1.1 + \since QtQuick 1.1 This handler is called when an item is added to the repeater. The \a index parameter holds the index at which the item has been inserted within the @@ -137,7 +137,7 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate() /*! \qmlsignal Repeater::onItemRemoved(int index, Item item) - \since Quick 1.1 + \since QtQuick 1.1 This handler is called when an item is removed from the repeater. The \a index parameter holds the index at which the item was removed from the repeater, @@ -306,7 +306,7 @@ int QDeclarativeRepeater::count() const /*! \qmlmethod Item Repeater::itemAt(index) - \since Quick 1.1 + \since QtQuick 1.1 Returns the \l Item that has been created at the given \a index, or \c null if no item exists at \a index. diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 54ff406..20e4eef 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -1190,7 +1190,7 @@ void QDeclarativeText::setWrapMode(WrapMode mode) /*! \qmlproperty int Text::lineCount - \since Quick 1.1 + \since QtQuick 1.1 Returns the number of lines visible in the text item. @@ -1206,7 +1206,7 @@ int QDeclarativeText::lineCount() const /*! \qmlproperty bool Text::truncated - \since Quick 1.1 + \since QtQuick 1.1 Returns true if the text has been truncated due to \l maximumLineCount or \l elide. @@ -1223,7 +1223,7 @@ bool QDeclarativeText::truncated() const /*! \qmlproperty int Text::maximumLineCount - \since Quick 1.1 + \since QtQuick 1.1 Set this property to limit the number of lines that the text item will show. If elide is set to Text.ElideRight, the text will be elided appropriately. @@ -1457,7 +1457,7 @@ qreal QDeclarativeText::paintedHeight() const /*! \qmlproperty real Text::lineHeight - \since Quick 1.1 + \since QtQuick 1.1 Sets the line height for the text. The value can be in pixels or a multiplier depending on lineHeightMode. diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 20b2e76..ca7e948 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -107,7 +107,7 @@ TextEdit { /*! \qmlsignal TextEdit::onLinkActivated(string link) - \since Quick 1.1 + \since QtQuick 1.1 This handler is called when the user clicks on a link embedded in the text. The link must be in rich text or HTML format and the @@ -615,7 +615,7 @@ void QDeclarativeTextEdit::setWrapMode(WrapMode mode) /*! \qmlproperty int TextEdit::lineCount - \since Quick 1.1 + \since QtQuick 1.1 Returns the total number of lines in the textEdit item. */ @@ -709,7 +709,7 @@ void QDeclarativeTextEdit::moveCursorSelection(int pos) /*! \qmlmethod void TextEdit::moveCursorSelection(int position, SelectionMode mode = TextEdit.SelectCharacters) - \since Quick 1.1 + \since QtQuick 1.1 Moves the cursor to \a position and updates the selection according to the optional \a mode parameter. (To only move the cursor, set the \l cursorPosition property.) @@ -1074,7 +1074,7 @@ void QDeclarativeTextEdit::setSelectByMouse(bool on) /*! \qmlproperty enum TextEdit::mouseSelectionMode - \since Quick 1.1 + \since QtQuick 1.1 Specifies how text should be selected using a mouse. @@ -1220,7 +1220,7 @@ void QDeclarativeTextEditPrivate::focusChanged(bool hasFocus) /*! \qmlmethod void TextEdit::deselect() - \since Quick 1.1 + \since QtQuick 1.1 Removes active text selection. */ diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index d2897eb..7014571 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -1014,7 +1014,7 @@ int QDeclarativeTextInput::positionAt(int x) const /*! \qmlmethod int TextInput::positionAt(int x, CursorPosition position = CursorBetweenCharacters) - \since Quick 1.1 + \since QtQuick 1.1 This function returns the character position at x pixels from the left of the textInput. Position 0 is before the @@ -1402,7 +1402,7 @@ QVariant QDeclarativeTextInput::inputMethodQuery(Qt::InputMethodQuery property) /*! \qmlmethod void TextInput::deselect() - \since Quick 1.1 + \since QtQuick 1.1 Removes active text selection. */ @@ -1574,7 +1574,7 @@ void QDeclarativeTextInput::setSelectByMouse(bool on) /*! \qmlproperty enum TextInput::mouseSelectionMode - \since Quick 1.1 + \since QtQuick 1.1 Specifies how text should be selected using a mouse. @@ -1622,7 +1622,7 @@ void QDeclarativeTextInput::moveCursorSelection(int position) /*! \qmlmethod void TextInput::moveCursorSelection(int position, SelectionMode mode = TextInput.SelectCharacters) - \since Quick 1.1 + \since QtQuick 1.1 Moves the cursor to \a position and updates the selection according to the optional \a mode parameter. (To only move the cursor, set the \l cursorPosition property.) -- cgit v0.12 From 16355187f69d4431b79b05201b36729c8e5102fe Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 30 Jun 2011 19:16:21 +0200 Subject: Doc: Fixed \since declarations. (cherry picked from commit 358e018dbb4b4dbdbfc702a6d462f113a1357e1e) --- src/gui/kernel/qkeysequence.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 117b72f..5fc72d4 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -933,7 +933,7 @@ QKeySequence::QKeySequence(const QString &key) } /*! - \since 4.x + \since 4.7 Creates a key sequence from the \a key string based on \a format. */ QKeySequence::QKeySequence(const QString &key, QKeySequence::SequenceFormat format) @@ -1130,7 +1130,7 @@ int QKeySequence::assign(const QString &ks) /*! \fn int QKeySequence::assign(const QString &keys, QKeySequence::SequenceFormat format) - \since 4.x + \since 4.7 Adds the given \a keys to the key sequence (based on \a format). \a keys may contain up to four key codes, provided they are -- cgit v0.12 From 8a6dc154ef1fa71e85f02d011d6cbeb63e2ca3bb Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 30 Jun 2011 20:48:32 +0200 Subject: Doc: Clarified the range of return values from QLineF::angle(). Task-number: QTBUG-20197 (cherry picked from commit 86608d537eabc3cf7e1d1ddd1d0a2f90ccc2de2a) --- src/corelib/tools/qline.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qline.cpp b/src/corelib/tools/qline.cpp index af3b7d5..0f67652 100644 --- a/src/corelib/tools/qline.cpp +++ b/src/corelib/tools/qline.cpp @@ -564,8 +564,9 @@ qreal QLineF::length() const Returns the angle of the line in degrees. - Positive values for the angles mean counter-clockwise while negative values - mean the clockwise direction. Zero degrees is at the 3 o'clock position. + The return value will be in the range of values from 0.0 up to but not + including 360.0. The angles are measured counter-clockwise from a point + on the x-axis to the right of the origin (x > 0). \sa setAngle() */ -- cgit v0.12 From c99457e1ecfa2099f71e78fe4fe1afc89d64e0c1 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Thu, 9 Jun 2011 15:58:09 +0200 Subject: Store styleName in font database So that queries like QFontDatabase::styles() can return exactly the same styles as the system does. Then application can use QFont::setStyleName() to select those styles later. With a lot of fonts not providing correct numeric weight/width values and even if they did, values are usually not directly mapped to QFont enums, styleName is probably the only reliable way to select any possible font in the system. Task-number: QTBUG-13518 Change-Id: Id8a9469b804f1b5bb81d8c7378e7e8778f9a4fff Reviewed-on: http://codereview.qt.nokia.com/739 Reviewed-by: Qt Sanity Bot Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontdatabase.cpp | 42 ++++++++++++++++++++++++++++---------- src/gui/text/qfontdatabase_mac.cpp | 2 ++ src/gui/text/qfontdatabase_x11.cpp | 6 +++++- 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 98186df..8b5e443 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -218,16 +218,17 @@ struct QtFontStyle Key(const QString &styleString); Key() : style(QFont::StyleNormal), weight(QFont::Normal), stretch(0) { } - Key(const Key &o) : style(o.style), + Key(const Key &o) : styleName(o.styleName), style(o.style), weight(o.weight), stretch(o.stretch) { } + QString styleName; uint style : 2; signed int weight : 8; signed int stretch : 12; bool operator==(const Key & other) { - return (style == other.style && + return styleName == other.styleName && style == other.style && weight == other.weight && - (stretch == 0 || other.stretch == 0 || stretch == other.stretch)); + (stretch == 0 || other.stretch == 0 || stretch == other.stretch); } bool operator!=(const Key &other) { return !operator==(other); @@ -292,7 +293,7 @@ struct QtFontStyle }; QtFontStyle::Key::Key(const QString &styleString) - : style(QFont::StyleNormal), weight(QFont::Normal), stretch(0) + : styleName(styleString), style(QFont::StyleNormal), weight(QFont::Normal), stretch(0) { weight = getFontWeight(styleString); @@ -1139,6 +1140,12 @@ static QtFontStyle *bestStyle(QtFontFoundry *foundry, const QtFontStyle::Key &st for ( int i = 0; i < foundry->count; i++ ) { QtFontStyle *style = foundry->styles[i]; + if (!styleKey.styleName.isEmpty() && styleKey.styleName == style->key.styleName) { + dist = 0; + best = i; + break; + } + int d = qAbs( styleKey.weight - style->key.weight ); if ( styleKey.stretch != 0 && style->key.stretch != 0 ) { @@ -1532,7 +1539,8 @@ static QString styleStringHelper(int weight, QFont::Style style) */ QString QFontDatabase::styleString(const QFont &font) { - return styleStringHelper(font.weight(), font.style()); + return font.styleName().isEmpty() ? styleStringHelper(font.weight(), font.style()) + : font.styleName(); } /*! @@ -1542,7 +1550,8 @@ QString QFontDatabase::styleString(const QFont &font) */ QString QFontDatabase::styleString(const QFontInfo &fontInfo) { - return styleStringHelper(fontInfo.weight(), fontInfo.style()); + return fontInfo.styleName().isEmpty() ? styleStringHelper(fontInfo.weight(), fontInfo.style()) + : fontInfo.styleName(); } @@ -1793,8 +1802,12 @@ QStringList QFontDatabase::styles(const QString &family) const } } - for (int i = 0; i < allStyles.count; i++) - l.append(styleStringHelper(allStyles.styles[i]->key.weight, (QFont::Style)allStyles.styles[i]->key.style)); + for (int i = 0; i < allStyles.count; i++) { + l.append(allStyles.styles[i]->key.styleName.isEmpty() ? + styleStringHelper(allStyles.styles[i]->key.weight, + (QFont::Style)allStyles.styles[i]->key.style) : + allStyles.styles[i]->key.styleName); + } return l; } @@ -2017,9 +2030,16 @@ QFont QFontDatabase::font(const QString &family, const QString &style, if (!s) // no styles found? return QApplication::font(); - QFont fnt(family, pointSize, s->key.weight); - fnt.setStyle((QFont::Style)s->key.style); - return fnt; + if (s->key.styleName.isEmpty()) { + QFont fnt(family, pointSize, s->key.weight); + fnt.setStyle((QFont::Style)s->key.style); + return fnt; + } else { + // found a perfect match + QFont fnt(family, pointSize); + fnt.setStyleName(s->key.styleName); + return fnt; + } } diff --git a/src/gui/text/qfontdatabase_mac.cpp b/src/gui/text/qfontdatabase_mac.cpp index 60cf586..0f6d6bf 100644 --- a/src/gui/text/qfontdatabase_mac.cpp +++ b/src/gui/text/qfontdatabase_mac.cpp @@ -106,12 +106,14 @@ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) { CTFontDescriptorRef font = (CTFontDescriptorRef)CFArrayGetValueAtIndex(fonts, i); QCFString family_name = (CFStringRef)CTFontDescriptorCopyAttribute(font, kCTFontFamilyNameAttribute); + QCFString style_name = (CFStringRef)CTFontDescriptorCopyAttribute(font, kCTFontStyleNameAttribute); QtFontFamily *family = db->family(family_name, true); for(int ws = 1; ws < QFontDatabase::WritingSystemsCount; ++ws) family->writingSystems[ws] = QtFontFamily::Supported; QtFontFoundry *foundry = family->foundry(foundry_name, true); QtFontStyle::Key styleKey; + styleKey.styleName = style_name; if(QCFType styles = (CFDictionaryRef)CTFontDescriptorCopyAttribute(font, kCTFontTraitsAttribute)) { if(CFNumberRef weight = (CFNumberRef)CFDictionaryGetValue(styles, kCTFontWeightTrait)) { Q_ASSERT(CFNumberIsFloatType(weight)); diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp index 958daa2..ed94fa6 100644 --- a/src/gui/text/qfontdatabase_x11.cpp +++ b/src/gui/text/qfontdatabase_x11.cpp @@ -1034,13 +1034,14 @@ static void loadFontConfig() FcChar8 *file_value; int index_value; FcChar8 *foundry_value; + FcChar8 *style_value; FcBool scalable; { FcObjectSet *os = FcObjectSetCreate(); FcPattern *pattern = FcPatternCreate(); const char *properties [] = { - FC_FAMILY, FC_WEIGHT, FC_SLANT, + FC_FAMILY, FC_STYLE, FC_WEIGHT, FC_SLANT, FC_SPACING, FC_FILE, FC_INDEX, FC_LANG, FC_CHARSET, FC_FOUNDRY, FC_SCALABLE, FC_PIXEL_SIZE, FC_WEIGHT, FC_WIDTH, @@ -1085,6 +1086,8 @@ static void loadFontConfig() scalable = FcTrue; if (FcPatternGetString(fonts->fonts[i], FC_FOUNDRY, 0, &foundry_value) != FcResultMatch) foundry_value = 0; + if (FcPatternGetString(fonts->fonts[i], FC_STYLE, 0, &style_value) != FcResultMatch) + style_value = 0; QtFontFamily *family = db->family(familyName, true); FcLangSet *langset = 0; @@ -1142,6 +1145,7 @@ static void loadFontConfig() family->fontFileIndex = index_value; QtFontStyle::Key styleKey; + styleKey.styleName = style_value ? QString::fromUtf8((const char *) style_value) : QString(); styleKey.style = (slant_value == FC_SLANT_ITALIC) ? QFont::StyleItalic : ((slant_value == FC_SLANT_OBLIQUE) -- cgit v0.12 From b777c29cc7ecafbb4c4a3fcb68219003dd880eea Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Wed, 22 Jun 2011 14:46:08 +0200 Subject: Preparing documentation package for 4.8-beta -removed link to "What's New in Qt 4.7" -replaced online HTTP links with qhelp links -wrote material for "What's New in Qt 4.8" Reviewed by: David Boddie --- doc/src/external-resources.qdoc | 5 ++ doc/src/index.qdoc | 2 +- doc/src/qt-webpages.qdoc | 59 ++++++++++++++--------- doc/src/qt4-intro.qdoc | 101 +++++++++++++++++++++++++++++++++++++++- 4 files changed, 142 insertions(+), 25 deletions(-) diff --git a/doc/src/external-resources.qdoc b/doc/src/external-resources.qdoc index 5431ec8..8b5d039 100644 --- a/doc/src/external-resources.qdoc +++ b/doc/src/external-resources.qdoc @@ -493,3 +493,8 @@ \externalpage http://msdn.microsoft.com/en-us/library/dd318066.aspx \title Microsoft Active Accessibility Event Constants */ + +/*! + \externalpage http://www.rfc-editor.org/rfc/bcp/bcp47.txt + \title RFC 5646 - BCP47 +*/ diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 2ce6781..bd21a12 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -49,8 +49,8 @@ \o \l{external: Qt Simulator Manual}{Qt Simulator} \endlist \list + \o \l{What's New in Qt 4.8} - latest release \o \l{Supported Platforms}{Platform Support} - \o \l{What's New in Qt 4.7} - latest release \endlist \enddiv \div {class="sectionlist normallist"} diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc index 7f456b9..208814b 100644 --- a/doc/src/qt-webpages.qdoc +++ b/doc/src/qt-webpages.qdoc @@ -209,7 +209,7 @@ \title Qt Docs Web Start Page */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/creator-qml-application.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-qml-application.html \title external: Developing Qt Quick Applications with Creator */ /*! @@ -233,35 +233,35 @@ \title Qt Whitepaper */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/creator-visual-editor.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-visual-editor.html \title external: Developing Qt Quick Applications */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/creator-publish-ovi.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-publish-ovi.html \title external: Publishing Applications to Ovi Store */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/index.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/index.html \title external: Qt Creator Manual */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/creator-developing-symbian.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-developing-symbian.html \title external: Setting Up Development Environment for Symbian */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/creator-developing-maemo.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-developing-maemo.html \title external: Setting Up Development Environment for Maemo */ /*! - \externalpage http://doc.qt.nokia.com/qtmobility/index.html + \externalpage qthelp://com.nokia.qtmobility.111/mobility/index.html \title external: Qt Mobility Manual */ /*! - \externalpage http://doc.qt.nokia.com/qtmobility/qml-plugins.html + \externalpage qthelp://com.nokia.qtmobility.111/mobility/qml-plugins.html \title external: Qt Mobility QML Plugins */ /*! - \externalpage http://doc.qt.nokia.com/qtsimulator/index.html + \externalpage qthelp://com.nokia.qt.simulator.110/doc/index.html \title external: Qt Simulator Manual */ /*! @@ -269,51 +269,51 @@ \title Qt SDK Product Page */ /*! - \externalpage http://doc.qt.nokia.com/nokia-qtsdk-latest/index.html + \externalpage qthelp://com.nokia.qt.sdk.11/doc/index.html \title external: Qt SDK Manual */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/creator-project-managing.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-project-managing.html \title external: Creating Qt Projects in Creator */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/creator-building-running.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-building-running.html \title external: Building and Running Applications in Creator */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/creator-running-targets.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-running-targets.html \title external: Set Compiler Targets in Creator */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/creator-build-settings.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-build-settings.html \title external: Build Settings in Creator */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/creator-run-settings.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-run-settings.html \title external: Run Settings in Creator */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/creator-using-qt-designer.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-using-qt-designer.html \title external: Designer in Creator */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/creator-debugging.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-debugging.html \title external: Debugging Applications in Creator */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/creator-deployment-symbian.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-deployment-symbian.html \title external: Symbian Deployment in Creator */ /*! - \externalpage http://doc.qt.nokia.com/qtcreator/creator-deployment-maemo.html + \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-deployment-maemo.html \title external: Maemo Deployment in Creator */ /*! - \externalpage http://doc.qt.nokia.com/qtmobility/multimedia.html + \externalpage qthelp://com.nokia.qtmobility.111/mobility/multimedia.html \title external: Mobility Multimedia */ /*! - \externalpage http://doc.qt.nokia.com/qtmobility/location-overview.html + \externalpage qthelp://com.nokia.qtmobility.111/mobility/location-overview.html \title external: Mobility Location */ /*! @@ -329,7 +329,7 @@ \title Training Day at Qt Developer Days 2009 */ /*! - \externalpage http://doc.qt.nokia.com/qtmobility/all-examples.html + \externalpage qthelp://com.nokia.qtmobility.111/mobility/all-examples.html \title external: Qt Mobility Examples */ /*! @@ -539,3 +539,18 @@ \externalpage http://qt.nokia.com/partners/qt-in-education/qt-in-education-course-material/ \title Qt in Education Course Material */ + +/*! + \externalpage http://developer.qt.nokia.com/ + \title Qt Developer Network +*/ + +/*! + \externalpage http://developer.qt.nokia.com/wiki/Qt_Modules_Maturity_Level + \title Qt Modules' Maturity Levels - Modules List +*/ + +/*! + \externalpage http://labs.qt.nokia.com/2011/05/03/qt-modules-maturity-level/ + \title Qt Modules' Maturity Level - Description +*/ diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index 1547a7c..01103a8 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -62,6 +62,12 @@ The following features have been added to Qt since the first release of Qt 4. + In Qt 4.8: + \list + \o \l{Qt Quick} 1.1 offers changes to the \l{QML Elements} and performance + upgrades + \ + \endlist In Qt 4.7: \list \o Declarative UI Development with \l{Qt Quick}, technologies for creating @@ -118,7 +124,7 @@ 64-bit Macintosh hardware. \o The QtXmlPatterns module has been extended to cover XSLT, a transformation language for XML documents. - \o Qt Script introduced its debugger, + \o Qt Script introduced its debugger, providing error reporting for scripts, and to let users track down bugs in their own scripts. \o Qt 4.5 includes support for writing rich text documents as @@ -489,6 +495,97 @@ */ /*! + \page qt4-8-intro.html + \title What's New in Qt 4.8 + + Qt 4.8 provides many improvements and enhancements over the previous + releases in the Qt 4 series. This document covers the most important + features in this release, separated by category. + + A list of other Qt 4 features can be found on the \bold{\l{What's + New in Qt 4}} page. + + \section1 Qt Quick 1.1 + Qt Quick 1.1 introduces \l{What's New in Qt Quick}{new changes} such as + new properties and better performance. + + \list + \o \l {QML Right-to-left User Interfaces}{Right-To-Left} text support + \o Improved image caching + \o Text input improvements - Support for split-screen virtual keyboard + \o \l PinchArea Element - enables simple pinch gesture handling + \o New properties for \l{QML Elements}. + \endlist + + + \section1 Qt Platform Abstraction -- \e Lighthouse + + \e QPA allows porting Qt to different windowing systems and devices + easier. It provides a clean abstraction layer for porting QtGui to new + window systems. + + \section1 Qt WebKit 2.2 + + The new Qt WebKit release introduces bug fixes, performance improvements, + and greater compiler compatibility. + + \section1 Threaded OpenGL + + Many Qt OpenGL functions are now thread-safe. Threads that cater to + different situations are now available. + + \list + \o Buffer swapping thread + \o Texture uploading thread + \o \l QPainter thread + \endlist + + \section1 Deprecated Items in Qt 4.8 + + As part of Open Governance, modules in Qt 4.8 will receive maintainers and + receive different support levels. + + Currently, a module has an activity classification, the \e{Module Maturity Level}. + As well, a list of modules and their maturity level is in the \l{Qt Developer Network}. + + \list + \o \l{Qt Modules' Maturity Level - Description} - description of the + different \e{maturity levels} + \o \l{Qt Modules' Maturity Levels - Modules List} - list of the Qt + modules and their maturity level + \endlist + \section1 Additions to the Qt API + + Qt 4.8 introduces changes to the Qt API. + \list + \o Localization API + Changes to the Localization APIs include improvements to \l QLocale and more + support for different language code formats. + + \list + \o \l {QLocale::quoteString()} - for localized quotes + \o \l {QLocale::createSeparatedList()} - for localized list separation (e.g. "1, 2 and 3") + \o \l {QLocale::bcp47Name()} - for locale names in the canonical form + according to \l {RFC 5646 - BCP47} + \o \l {QLocale::matchingLocales()} - to get a list of locales that match a + criteria - e.g. a list of locales that use French language. + \o \l {QLocale::firstDayOfWeek()} + \o \l {QLocale::weekdays()} + \o \l{QLocale::currencySymbol()} + \o \l{QLocale::toCurrencyString()} - number formatting for currencies + \o \l{QLocale::uiLanguages()} + \o \l{QLocale::nativeLanguageName()} + \o \l{QLocale::nativeCountryName()} + \endlist + \o IP Multicast API + \o Multithreaded HTTP + \endlist + + \section1 New Classes, Functions, Macros, etc. + \sincelist 4.8 +*/ + +/*! \page qt4-7-intro.html \title What's New in Qt 4.7 @@ -685,7 +782,7 @@ \list \o Simplify complex application semantics. \o Use of states to reduce code bloat. - \o Use states to improve maintainability. + \o Use states to improve maintainability. \o Makes event-driven programming robust and more reusable. \endlist -- cgit v0.12 From 19e9fd70bb39c10b69eb6220c2d5b772e126324c Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 4 Jul 2011 16:16:32 +0200 Subject: Committing the qt-webpages.qdoc file with the online links Reviewed-by: David Boddie --- doc/src/qt-webpages.qdoc | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc index 208814b..c993575 100644 --- a/doc/src/qt-webpages.qdoc +++ b/doc/src/qt-webpages.qdoc @@ -209,7 +209,7 @@ \title Qt Docs Web Start Page */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-qml-application.html + \externalpage http://doc.qt.nokia.com/qtcreator/creator-qml-application.html \title external: Developing Qt Quick Applications with Creator */ /*! @@ -233,35 +233,35 @@ \title Qt Whitepaper */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-visual-editor.html + \externalpage http://doc.qt.nokia.com/qtcreator/creator-visual-editor.html \title external: Developing Qt Quick Applications */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-publish-ovi.html + \externalpage http://doc.qt.nokia.com/qtcreator/creator-publish-ovi.html \title external: Publishing Applications to Ovi Store */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/index.html + \externalpage http://doc.qt.nokia.com/qtcreator/index.html \title external: Qt Creator Manual */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-developing-symbian.html + \externalpage http://doc.qt.nokia.com/qtcreator/creator-developing-symbian.html \title external: Setting Up Development Environment for Symbian */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-developing-maemo.html + \externalpage http://doc.qt.nokia.com/qtcreator/creator-developing-maemo.html \title external: Setting Up Development Environment for Maemo */ /*! - \externalpage qthelp://com.nokia.qtmobility.111/mobility/index.html + \externalpage http://doc.qt.nokia.com/qtmobility/index.html \title external: Qt Mobility Manual */ /*! - \externalpage qthelp://com.nokia.qtmobility.111/mobility/qml-plugins.html + \externalpage http://doc.qt.nokia.com/qtmobility/qml-plugins.html \title external: Qt Mobility QML Plugins */ /*! - \externalpage qthelp://com.nokia.qt.simulator.110/doc/index.html + \externalpage http://doc.qt.nokia.com/qtsimulator/index.html \title external: Qt Simulator Manual */ /*! @@ -269,51 +269,51 @@ \title Qt SDK Product Page */ /*! - \externalpage qthelp://com.nokia.qt.sdk.11/doc/index.html + \externalpage http://doc.qt.nokia.com/nokia-qtsdk-latest/index.html \title external: Qt SDK Manual */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-project-managing.html + \externalpage http://doc.qt.nokia.com/qtcreator/creator-project-managing.html \title external: Creating Qt Projects in Creator */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-building-running.html + \externalpage http://doc.qt.nokia.com/qtcreator/creator-building-running.html \title external: Building and Running Applications in Creator */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-running-targets.html + \externalpage http://doc.qt.nokia.com/qtcreator/creator-running-targets.html \title external: Set Compiler Targets in Creator */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-build-settings.html + \externalpage http://doc.qt.nokia.com/qtcreator/creator-build-settings.html \title external: Build Settings in Creator */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-run-settings.html + \externalpage http://doc.qt.nokia.com/qtcreator/creator-run-settings.html \title external: Run Settings in Creator */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-using-qt-designer.html + \externalpage http://doc.qt.nokia.com/qtcreator/creator-using-qt-designer.html \title external: Designer in Creator */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-debugging.html + \externalpage http://doc.qt.nokia.com/qtcreator/creator-debugging.html \title external: Debugging Applications in Creator */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-deployment-symbian.html + \externalpage http://doc.qt.nokia.com/qtcreator/creator-deployment-symbian.html \title external: Symbian Deployment in Creator */ /*! - \externalpage qthelp://com.nokia.qtcreator.221/doc/creator-deployment-maemo.html + \externalpage http://doc.qt.nokia.com/qtcreator/creator-deployment-maemo.html \title external: Maemo Deployment in Creator */ /*! - \externalpage qthelp://com.nokia.qtmobility.111/mobility/multimedia.html + \externalpage http://doc.qt.nokia.com/qtmobility/multimedia.html \title external: Mobility Multimedia */ /*! - \externalpage qthelp://com.nokia.qtmobility.111/mobility/location-overview.html + \externalpage http://doc.qt.nokia.com/qtmobility/location-overview.html \title external: Mobility Location */ /*! @@ -329,7 +329,7 @@ \title Training Day at Qt Developer Days 2009 */ /*! - \externalpage qthelp://com.nokia.qtmobility.111/mobility/all-examples.html + \externalpage http://doc.qt.nokia.com/qtmobility/all-examples.html \title external: Qt Mobility Examples */ /*! -- cgit v0.12 From 0e9e4422205da5c27ab2c758d730b958df7ac872 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Mon, 4 Jul 2011 15:27:13 +0200 Subject: Add font related changes in 4.8 into changes Reviewed-by: Eskil --- dist/changes-4.8.0 | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/dist/changes-4.8.0 b/dist/changes-4.8.0 index 7dffa68..f59e09a 100644 --- a/dist/changes-4.8.0 +++ b/dist/changes-4.8.0 @@ -68,6 +68,14 @@ QtGui - QListView diverses optimisations [QTBUG-11438] - QTreeWidget/QListWidget: use localeAwareCompare for string comparisons [QTBUG-10839] - PNG image I/O: Much improved support for text annotations, including iTXt fields. + - QRawFont and QGlyphRun are introduced for low-level text rendering. [QTBUG-18252] + - QFont: hintingPreference() is introduced to control hinting in font rendering and + subpixel positioning of glyphs for Windows, Mac OS X and X11/raster. [QTBUG-10615] + - Subpixel positioned text layout is supported in raster and OpenGL paint engines. + - QFont: styleName() is added to allow selecting fonts with irregular style names + like UltraLight. [QTBUG-19366] + - Visual text cursor movement behavior is added to QTextEdit and QLineEdit controls, + which can be used as an optional mode for bi-directional text editing. [QTBUG-13859] QtNetwork --------- @@ -108,15 +116,22 @@ QtScript Qt for Linux/X11 ---------------- - + - Now takes font hinting settings from GConf by default if running in + GNOME desktop. + - Various fixes to FontConfig font matching code to make it consistent + with other X11 programs. [QTBUG-2148, QTBUG-19947, QTBUG-14269] Qt for Windows -------------- - + - DirectWrite experimental text shaping engine is added with subpixel + positioning support. [QTBUG-12678] Qt for Mac OS X --------------- - + - raster graphics system is now made as the default paint engine for + Mac OS X. [QTBUG-12615] + - HarfBuzz can now be used as an optional text layout engine on Mac OS X. + [QTBUG-17728] Qt for Embedded Linux --------------------- -- cgit v0.12 From 25bbcf9605f65548d7f581304b7d8ad300aa9937 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 4 Jul 2011 16:44:29 +0200 Subject: Applied fix (dea9ca8b7a4166e1c3d3fc374621ad02c1220d3a)from qt5/qtbase. --- examples/opengl/cube/geometryengine.cpp | 2 ++ examples/opengl/cube/mainwidget.cpp | 2 ++ examples/opengl/cube/mainwidget.h | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/opengl/cube/geometryengine.cpp b/examples/opengl/cube/geometryengine.cpp index 3001ed5..c05dde5 100644 --- a/examples/opengl/cube/geometryengine.cpp +++ b/examples/opengl/cube/geometryengine.cpp @@ -61,6 +61,8 @@ GeometryEngine::~GeometryEngine() void GeometryEngine::init() { + initializeGLFunctions(); + //! [0] // Generate 2 VBOs glGenBuffers(2, vboIds); diff --git a/examples/opengl/cube/mainwidget.cpp b/examples/opengl/cube/mainwidget.cpp index 2a2cd63..1116526 100644 --- a/examples/opengl/cube/mainwidget.cpp +++ b/examples/opengl/cube/mainwidget.cpp @@ -118,6 +118,8 @@ void MainWidget::timerEvent(QTimerEvent *e) void MainWidget::initializeGL() { + initializeGLFunctions(); + qglClearColor(Qt::black); qDebug() << "Initializing shaders..."; diff --git a/examples/opengl/cube/mainwidget.h b/examples/opengl/cube/mainwidget.h index 33ab0d8..c6da29f 100644 --- a/examples/opengl/cube/mainwidget.h +++ b/examples/opengl/cube/mainwidget.h @@ -42,6 +42,7 @@ #define MAINWIDGET_H #include +#include #include #include @@ -52,7 +53,7 @@ class QGLShaderProgram; class GeometryEngine; -class MainWidget : public QGLWidget +class MainWidget : public QGLWidget, protected QGLFunctions { Q_OBJECT public: -- cgit v0.12 From df48d66d6e0af1281e1909b47054d45c729b675e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 4 Jul 2011 15:41:16 +0200 Subject: Fixed missing painting with X11 paint engine. Re-introduce some "lost" code from 4.7. Task-number: QTBUG-19639 Reviewed-by: Olivier Goffart --- src/gui/painting/qpaintengine_x11.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index 994986b..147d2ec 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -1611,6 +1611,8 @@ void QX11PaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, int p && (fill.style() != Qt::NoBrush) && ((has_fill_texture && fill.texture().hasAlpha()) || antialias || !solid_fill || has_alpha_pen != has_alpha_brush)) { + tessellator->tessellate((QPointF *)clippedPoints, clippedCount, + mode == QPaintEngine::WindingMode); if (tessellator->size > 0) { XRenderPictureAttributes attrs; attrs.poly_edge = antialias ? PolyEdgeSmooth : PolyEdgeSharp; -- cgit v0.12 From f51b5fe09c63e4b3c2ab5a4d06e162c43d38207d Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 5 Jul 2011 10:33:59 +0200 Subject: Don't issue GL calls when the geometry is empty This works as a band-aid and optimization for QT-5104, because in the text in the example, which contains latin text and has a latin default font set, will think of all spaces between the cyrillic characters as latin characters, hence it will make separate text items for them and issue separate glDrawElements() calls. By cutting off if there are no glyphs to draw, we can avoid hitting the actual bug for this and several other use cases, making it less likely to happen. Task-number: QT-5104 Reviewed-by: Samuel --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 52450b6..5d2221f 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1696,6 +1696,8 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp } int numGlyphs = vertexCoordinates->vertexCount() / 4; + if (numGlyphs == 0) + return; if (elementIndices.size() < numGlyphs*6) { Q_ASSERT(elementIndices.size() % 6 == 0); -- cgit v0.12 From 83e93784a2da9e1898790e4455225da220f44d81 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Tue, 5 Jul 2011 13:40:57 +0200 Subject: Fix regressions in previous QFontDatabase patch 1. QtFontStyle::Key comparison should either use styleName or style, etc., but not both. 2. When initializing a QFont from QFontDatabase::font(), style and weight parameters should always be set even when we found a match styleName, in case these parameters will be used for comparison later. Reviewed-by: Eskil --- src/gui/text/qfontdatabase.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 8b5e443..5f50c40 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -226,9 +226,9 @@ struct QtFontStyle signed int stretch : 12; bool operator==(const Key & other) { - return styleName == other.styleName && style == other.style && - weight == other.weight && - (stretch == 0 || other.stretch == 0 || stretch == other.stretch); + return (!styleName.isEmpty() && !other.styleName.isEmpty() && styleName == other.styleName) || + (style == other.style && weight == other.weight && + (stretch == 0 || other.stretch == 0 || stretch == other.stretch)); } bool operator!=(const Key &other) { return !operator==(other); @@ -2030,16 +2030,12 @@ QFont QFontDatabase::font(const QString &family, const QString &style, if (!s) // no styles found? return QApplication::font(); - if (s->key.styleName.isEmpty()) { - QFont fnt(family, pointSize, s->key.weight); - fnt.setStyle((QFont::Style)s->key.style); - return fnt; - } else { - // found a perfect match - QFont fnt(family, pointSize); + + QFont fnt(family, pointSize, s->key.weight); + fnt.setStyle((QFont::Style)s->key.style); + if (!s->key.styleName.isEmpty()) fnt.setStyleName(s->key.styleName); - return fnt; - } + return fnt; } -- cgit v0.12 From e5e1ff0d6f4e6a8457da61b5b215730de6f960bd Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 6 Jul 2011 11:44:57 +0200 Subject: Fix bidi reordering when part of text is rendered by fallback font If the fallback font is used for part of a RTL text, we need to position the different text items accordingly, subtracting the advance instead of adding it. Task-number: QTBUG-17117 Done-with: Lars --- src/gui/painting/qpainter.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index a4ab00a..604c1ab 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -6512,6 +6512,10 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti) qreal x = p.x(); qreal y = p.y(); + bool rtl = ti.flags & QTextItem::RightToLeft; + if (rtl) + x += ti.width.toReal(); + int start = 0; int end, i; for (end = 0; end < ti.glyphs.numGlyphs; ++end) { @@ -6528,14 +6532,19 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti) ti2.width += ti.glyphs.effectiveAdvance(i); } + if (rtl) + x -= ti2.width.toReal(); + d->engine->drawTextItem(QPointF(x, y), ti2); + if (!rtl) + x += ti2.width.toReal(); + // reset the high byte for all glyphs and advance to the next sub-string const int hi = which << 24; for (i = start; i < end; ++i) { glyphs.glyphs[i] = hi | glyphs.glyphs[i]; } - x += ti2.width.toReal(); // change engine start = end; @@ -6550,6 +6559,9 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti) ti2.width += ti.glyphs.effectiveAdvance(i); } + if (rtl) + x -= ti2.width.toReal(); + if (d->extended) d->extended->drawTextItem(QPointF(x, y), ti2); else -- cgit v0.12 From dd0205e0fbacf340508686cc136d70eda7bf664d Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 6 Jul 2011 11:50:58 +0200 Subject: Move styleName out of QtFontStyle::Key Makes the code clearer and more explicit. Reviewed-by: Eskil --- src/gui/text/qfontdatabase.cpp | 77 ++++++++++++++++++++++---------------- src/gui/text/qfontdatabase_mac.cpp | 6 +-- src/gui/text/qfontdatabase_qpa.cpp | 2 +- src/gui/text/qfontdatabase_win.cpp | 8 ++-- src/gui/text/qfontdatabase_x11.cpp | 10 ++--- 5 files changed, 57 insertions(+), 46 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 5f50c40..dc8fd45 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -218,16 +218,13 @@ struct QtFontStyle Key(const QString &styleString); Key() : style(QFont::StyleNormal), weight(QFont::Normal), stretch(0) { } - Key(const Key &o) : styleName(o.styleName), style(o.style), - weight(o.weight), stretch(o.stretch) { } - QString styleName; + Key(const Key &o) : style(o.style), weight(o.weight), stretch(o.stretch) { } uint style : 2; signed int weight : 8; signed int stretch : 12; bool operator==(const Key & other) { - return (!styleName.isEmpty() && !other.styleName.isEmpty() && styleName == other.styleName) || - (style == other.style && weight == other.weight && + return (style == other.style && weight == other.weight && (stretch == 0 || other.stretch == 0 || stretch == other.stretch)); } bool operator!=(const Key &other) { @@ -280,6 +277,7 @@ struct QtFontStyle bool smoothScalable : 1; signed int count : 30; QtFontSize *pixelSizes; + QString styleName; #ifdef Q_WS_X11 const char *weightName; @@ -293,7 +291,7 @@ struct QtFontStyle }; QtFontStyle::Key::Key(const QString &styleString) - : styleName(styleString), style(QFont::StyleNormal), weight(QFont::Normal), stretch(0) + : style(QFont::StyleNormal), weight(QFont::Normal), stretch(0) { weight = getFontWeight(styleString); @@ -354,13 +352,20 @@ struct QtFontFoundry int count; QtFontStyle **styles; - QtFontStyle *style(const QtFontStyle::Key &, bool = false); + QtFontStyle *style(const QtFontStyle::Key &, const QString & = QString(), bool = false); }; -QtFontStyle *QtFontFoundry::style(const QtFontStyle::Key &key, bool create) +QtFontStyle *QtFontFoundry::style(const QtFontStyle::Key &key, const QString &styleName, bool create) { int pos = 0; if (count) { + // if styleName for searching first if possible + if (!styleName.isEmpty()) { + for (; pos < count; pos++) { + if (styles[pos]->styleName == styleName) + return styles[pos]; + } + } int low = 0; int high = count; pos = count / 2; @@ -387,6 +392,7 @@ QtFontStyle *QtFontFoundry::style(const QtFontStyle::Key &key, bool create) } QtFontStyle *style = new QtFontStyle(key); + style->styleName = styleName; memmove(styles + pos + 1, styles + pos, (count-pos)*sizeof(QtFontStyle *)); styles[pos] = style; count++; @@ -815,7 +821,7 @@ void QFontDatabasePrivate::addFont(const QString &familyname, const char *foundr } QtFontFoundry *foundry = f->foundry(QString::fromLatin1(foundryname), true); - QtFontStyle *style = foundry->style(styleKey, true); + QtFontStyle *style = foundry->style(styleKey, QString(), true); style->smoothScalable = (pixelSize == 0); style->antialiased = antialiased; QtFontSize *size = style->pixelSize(pixelSize?pixelSize:SMOOTH_SCALABLE, true); @@ -1132,7 +1138,8 @@ QString QFontDatabase::resolveFontFamilyAlias(const QString &family) #endif QT_END_INCLUDE_NAMESPACE -static QtFontStyle *bestStyle(QtFontFoundry *foundry, const QtFontStyle::Key &styleKey) +static QtFontStyle *bestStyle(QtFontFoundry *foundry, const QtFontStyle::Key &styleKey, + const QString &styleName = QString()) { int best = 0; int dist = 0xffff; @@ -1140,7 +1147,7 @@ static QtFontStyle *bestStyle(QtFontFoundry *foundry, const QtFontStyle::Key &st for ( int i = 0; i < foundry->count; i++ ) { QtFontStyle *style = foundry->styles[i]; - if (!styleKey.styleName.isEmpty() && styleKey.styleName == style->key.styleName) { + if (!styleName.isEmpty() && styleName == style->styleName) { dist = 0; best = i; break; @@ -1797,16 +1804,16 @@ QStringList QFontDatabase::styles(const QString &family) const for (int k = 0; k < foundry->count; k++) { QtFontStyle::Key ke(foundry->styles[k]->key); ke.stretch = 0; - allStyles.style(ke, true); + allStyles.style(ke, foundry->styles[k]->styleName, true); } } } for (int i = 0; i < allStyles.count; i++) { - l.append(allStyles.styles[i]->key.styleName.isEmpty() ? + l.append(allStyles.styles[i]->styleName.isEmpty() ? styleStringHelper(allStyles.styles[i]->key.weight, (QFont::Style)allStyles.styles[i]->key.style) : - allStyles.styles[i]->key.styleName); + allStyles.styles[i]->styleName); } return l; } @@ -1865,7 +1872,9 @@ bool QFontDatabase::isBitmapScalable(const QString &family, QtFontFoundry *foundry = f->foundries[j]; if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) { for (int k = 0; k < foundry->count; k++) - if ((style.isEmpty() || foundry->styles[k]->key == styleKey) + if ((style.isEmpty() || + foundry->styles[k]->styleName == style || + foundry->styles[k]->key == styleKey) && foundry->styles[k]->bitmapScalable && !foundry->styles[k]->smoothScalable) { bitmapScalable = true; goto end; @@ -1904,7 +1913,9 @@ bool QFontDatabase::isSmoothlyScalable(const QString &family, const QString &sty QtFontFoundry *foundry = f->foundries[j]; if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) { for (int k = 0; k < foundry->count; k++) - if ((style.isEmpty() || foundry->styles[k]->key == styleKey) && foundry->styles[k]->smoothScalable) { + if ((style.isEmpty() || + foundry->styles[k]->styleName == style || + foundry->styles[k]->key == styleKey) && foundry->styles[k]->smoothScalable) { smoothScalable = true; goto end; } @@ -1937,7 +1948,7 @@ bool QFontDatabase::isScalable(const QString &family, \sa smoothSizes(), standardSizes() */ QList QFontDatabase::pointSizes(const QString &family, - const QString &style) + const QString &styleName) { #if defined(Q_WS_WIN) // windows and macosx are always smoothly scalable @@ -1953,7 +1964,7 @@ QList QFontDatabase::pointSizes(const QString &family, QT_PREPEND_NAMESPACE(load)(familyName); - QtFontStyle::Key styleKey(style); + QtFontStyle::Key styleKey(styleName); QList sizes; @@ -1970,7 +1981,7 @@ QList QFontDatabase::pointSizes(const QString &family, for (int j = 0; j < fam->count; j++) { QtFontFoundry *foundry = fam->foundries[j]; if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) { - QtFontStyle *style = foundry->style(styleKey); + QtFontStyle *style = foundry->style(styleKey, styleName); if (!style) continue; if (style->smoothScalable) { @@ -2021,20 +2032,20 @@ QFont QFontDatabase::font(const QString &family, const QString &style, QtFontFoundry *foundry = f->foundries[j]; if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) { for (int k = 0; k < foundry->count; k++) - allStyles.style(foundry->styles[k]->key, true); + allStyles.style(foundry->styles[k]->key, foundry->styles[k]->styleName, true); } } QtFontStyle::Key styleKey(style); - QtFontStyle *s = bestStyle(&allStyles, styleKey); + QtFontStyle *s = bestStyle(&allStyles, styleKey, style); if (!s) // no styles found? return QApplication::font(); QFont fnt(family, pointSize, s->key.weight); fnt.setStyle((QFont::Style)s->key.style); - if (!s->key.styleName.isEmpty()) - fnt.setStyleName(s->key.styleName); + if (!s->styleName.isEmpty()) + fnt.setStyleName(s->styleName); return fnt; } @@ -2048,11 +2059,11 @@ QFont QFontDatabase::font(const QString &family, const QString &style, \sa pointSizes(), standardSizes() */ QList QFontDatabase::smoothSizes(const QString &family, - const QString &style) + const QString &styleName) { #ifdef Q_WS_WIN Q_UNUSED(family); - Q_UNUSED(style); + Q_UNUSED(styleName); return QFontDatabase::standardSizes(); #else bool smoothScalable = false; @@ -2063,7 +2074,7 @@ QList QFontDatabase::smoothSizes(const QString &family, QT_PREPEND_NAMESPACE(load)(familyName); - QtFontStyle::Key styleKey(style); + QtFontStyle::Key styleKey(styleName); QList sizes; @@ -2080,7 +2091,7 @@ QList QFontDatabase::smoothSizes(const QString &family, for (int j = 0; j < fam->count; j++) { QtFontFoundry *foundry = fam->foundries[j]; if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) { - QtFontStyle *style = foundry->style(styleKey); + QtFontStyle *style = foundry->style(styleKey, styleName); if (!style) continue; if (style->smoothScalable) { @@ -2147,12 +2158,12 @@ bool QFontDatabase::italic(const QString &family, const QString &style) const QtFontFoundry *foundry = f->foundries[j]; if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) { for (int k = 0; k < foundry->count; k++) - allStyles.style(foundry->styles[k]->key, true); + allStyles.style(foundry->styles[k]->key, foundry->styles[k]->styleName, true); } } QtFontStyle::Key styleKey(style); - QtFontStyle *s = allStyles.style(styleKey); + QtFontStyle *s = allStyles.style(styleKey, style); return s && s->key.style == QFont::StyleItalic; } @@ -2182,12 +2193,12 @@ bool QFontDatabase::bold(const QString &family, if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) { for (int k = 0; k < foundry->count; k++) - allStyles.style(foundry->styles[k]->key, true); + allStyles.style(foundry->styles[k]->key, foundry->styles[k]->styleName, true); } } QtFontStyle::Key styleKey(style); - QtFontStyle *s = allStyles.style(styleKey); + QtFontStyle *s = allStyles.style(styleKey, style); return s && s->key.weight >= QFont::Bold; } @@ -2218,12 +2229,12 @@ int QFontDatabase::weight(const QString &family, if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) { for (int k = 0; k < foundry->count; k++) - allStyles.style(foundry->styles[k]->key, true); + allStyles.style(foundry->styles[k]->key, foundry->styles[k]->styleName, true); } } QtFontStyle::Key styleKey(style); - QtFontStyle *s = allStyles.style(styleKey); + QtFontStyle *s = allStyles.style(styleKey, style); return s ? s->key.weight : -1; } diff --git a/src/gui/text/qfontdatabase_mac.cpp b/src/gui/text/qfontdatabase_mac.cpp index 0f6d6bf..fc8247d 100644 --- a/src/gui/text/qfontdatabase_mac.cpp +++ b/src/gui/text/qfontdatabase_mac.cpp @@ -113,7 +113,7 @@ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) { QtFontFoundry *foundry = family->foundry(foundry_name, true); QtFontStyle::Key styleKey; - styleKey.styleName = style_name; + QString styleName = style_name; if(QCFType styles = (CFDictionaryRef)CTFontDescriptorCopyAttribute(font, kCTFontTraitsAttribute)) { if(CFNumberRef weight = (CFNumberRef)CFDictionaryGetValue(styles, kCTFontWeightTrait)) { Q_ASSERT(CFNumberIsFloatType(weight)); @@ -134,7 +134,7 @@ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) { } } - QtFontStyle *style = foundry->style(styleKey, true); + QtFontStyle *style = foundry->style(styleKey, styleName, true); style->smoothScalable = true; if(QCFType size = (CFNumberRef)CTFontDescriptorCopyAttribute(font, kCTFontSizeAttribute)) { //qDebug() << "WHEE"; @@ -207,7 +207,7 @@ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) { QtFontFamily *family = db->family(familyName, true); QtFontFoundry *foundry = family->foundry(QString(), true); - QtFontStyle *style = foundry->style(styleKey, true); + QtFontStyle *style = foundry->style(styleKey, QString(), true); style->pixelSize(0, true); style->smoothScalable = true; diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index fd5c6b4..6b6f4f1 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -73,7 +73,7 @@ Q_GUI_EXPORT void qt_registerFont(const QString &familyName, const QString &fou } QtFontFoundry *foundry = f->foundry(foundryname, true); - QtFontStyle *fontStyle = foundry->style(styleKey, true); + QtFontStyle *fontStyle = foundry->style(styleKey, QString(), true); fontStyle->smoothScalable = scalable; fontStyle->antialiased = antialiased; QtFontSize *size = fontStyle->pixelSize(pixelSize?pixelSize:SMOOTH_SCALABLE, true); diff --git a/src/gui/text/qfontdatabase_win.cpp b/src/gui/text/qfontdatabase_win.cpp index 20f945a..788eb30 100644 --- a/src/gui/text/qfontdatabase_win.cpp +++ b/src/gui/text/qfontdatabase_win.cpp @@ -284,7 +284,7 @@ void addFontToDatabase(QString familyName, const QString &scriptName, family->english_name = getEnglishName(familyName); QtFontFoundry *foundry = family->foundry(foundryName, true); - QtFontStyle *style = foundry->style(styleKey, true); + QtFontStyle *style = foundry->style(styleKey, QString(), true); style->smoothScalable = scalable; style->pixelSize( size, TRUE); @@ -292,14 +292,14 @@ void addFontToDatabase(QString familyName, const QString &scriptName, if (styleKey.weight <= QFont::DemiBold) { QtFontStyle::Key key(styleKey); key.weight = QFont::Bold; - QtFontStyle *style = foundry->style(key, true); + QtFontStyle *style = foundry->style(key, QString(), true); style->smoothScalable = scalable; style->pixelSize( size, TRUE); } if (styleKey.style != QFont::StyleItalic) { QtFontStyle::Key key(styleKey); key.style = QFont::StyleItalic; - QtFontStyle *style = foundry->style(key, true); + QtFontStyle *style = foundry->style(key, QString(), true); style->smoothScalable = scalable; style->pixelSize( size, TRUE); } @@ -307,7 +307,7 @@ void addFontToDatabase(QString familyName, const QString &scriptName, QtFontStyle::Key key(styleKey); key.weight = QFont::Bold; key.style = QFont::StyleItalic; - QtFontStyle *style = foundry->style(key, true); + QtFontStyle *style = foundry->style(key, QString(), true); style->smoothScalable = scalable; style->pixelSize( size, TRUE); } diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp index ed94fa6..922a97f 100644 --- a/src/gui/text/qfontdatabase_x11.cpp +++ b/src/gui/text/qfontdatabase_x11.cpp @@ -680,7 +680,7 @@ static void loadXlfds(const char *reqFamily, int encoding_id) family->fontFileIndex = -1; family->symbol_checked = true; QtFontFoundry *foundry = family->foundry(QLatin1String(foundryName), true); - QtFontStyle *style = foundry->style(styleKey, true); + QtFontStyle *style = foundry->style(styleKey, QString(), true); delete [] style->weightName; style->weightName = qstrdup(tokens[Weight]); @@ -1145,7 +1145,7 @@ static void loadFontConfig() family->fontFileIndex = index_value; QtFontStyle::Key styleKey; - styleKey.styleName = style_value ? QString::fromUtf8((const char *) style_value) : QString(); + QString styleName = style_value ? QString::fromUtf8((const char *) style_value) : QString(); styleKey.style = (slant_value == FC_SLANT_ITALIC) ? QFont::StyleItalic : ((slant_value == FC_SLANT_OBLIQUE) @@ -1160,7 +1160,7 @@ static void loadFontConfig() QtFontFoundry *foundry = family->foundry(foundry_value ? QString::fromUtf8((const char *)foundry_value) : QString(), true); - QtFontStyle *style = foundry->style(styleKey, true); + QtFontStyle *style = foundry->style(styleKey, styleName, true); if (spacing_value < FC_MONO) family->fixedPitch = false; @@ -1212,7 +1212,7 @@ static void loadFontConfig() for (int i = 0; i < 4; ++i) { styleKey.style = (i%2) ? QFont::StyleNormal : QFont::StyleItalic; styleKey.weight = (i > 1) ? QFont::Bold : QFont::Normal; - QtFontStyle *style = foundry->style(styleKey, true); + QtFontStyle *style = foundry->style(styleKey, QString(), true); style->smoothScalable = true; QtFontSize *size = style->pixelSize(SMOOTH_SCALABLE, true); QtFontEncoding *enc = size->encodingID(-1, 0, 0, 0, 0, true); @@ -1360,7 +1360,7 @@ static void initializeDb() if (equiv) continue; // let's fake one... - equiv = foundry->style(key, true); + equiv = foundry->style(key, QString(), true); equiv->smoothScalable = true; QtFontSize *equiv_size = equiv->pixelSize(SMOOTH_SCALABLE, true); -- cgit v0.12 From b3e0d76d558d35e40f1c4f1b5b1b14ba79f8eef6 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 6 Jul 2011 14:32:10 +0300 Subject: On symbian QMessageBox does not look like native dialog If API QMessageBox::setInformativeText() is used to set informative text to the messagebox, the text is added to the "icon column", which makes the messagebox look really weird. Use layoutDirection() and add informative text to the same column where other text elements are added. Task-number: QTBUG-9924 Reviewed-by: Tomi Vihria --- src/gui/dialogs/qmessagebox.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp index 6a1c04a..f18fe60 100644 --- a/src/gui/dialogs/qmessagebox.cpp +++ b/src/gui/dialogs/qmessagebox.cpp @@ -2507,7 +2507,12 @@ void QMessageBox::setInformativeText(const QString &text) label->hide(); QTextBrowser *textBrowser = new QTextBrowser(this); textBrowser->setOpenExternalLinks(true); - grid->addWidget(textBrowser, 1, 1, 1, 1); +#if defined(Q_OS_SYMBIAN) + const int preferredTextColumn = (QApplication::layoutDirection() == Qt::LeftToRight) ? 0 : 1; +#else + const int preferredTextColumn = 1; +#endif + grid->addWidget(textBrowser, 1, preferredTextColumn, 1, 1); d->textBrowser = textBrowser; #else grid->addWidget(label, 1, 1, 1, 1); -- cgit v0.12 From f9b521fc492b82ea510b448ffd785273db0b8e74 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 6 Jul 2011 13:35:49 +0200 Subject: Fix Windows compile --- src/gui/text/qfontdatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index dc8fd45..3762f39 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -1953,7 +1953,7 @@ QList QFontDatabase::pointSizes(const QString &family, #if defined(Q_WS_WIN) // windows and macosx are always smoothly scalable Q_UNUSED(family); - Q_UNUSED(style); + Q_UNUSED(styleName); return standardSizes(); #else bool smoothScalable = false; -- cgit v0.12 From d2303b008e86f36a34eed2b6f0ea79ce41b5e1b3 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 6 Jul 2011 13:42:49 +0200 Subject: Fix compilation with c++0x mode Reviewed-by: Olivier --- src/corelib/tools/qstringlist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h index 2159512..f4689b4 100644 --- a/src/corelib/tools/qstringlist.h +++ b/src/corelib/tools/qstringlist.h @@ -71,7 +71,7 @@ public: inline QStringList(const QStringList &l) : QList(l) { } inline QStringList(const QList &l) : QList(l) { } #ifdef Q_COMPILER_INITIALIZER_LISTS - inline QStringList(std::initializer_list args) : QList(args) { } + inline QStringList(std::initializer_list args) : QList(args) { } #endif inline void sort(); -- cgit v0.12 From 8032d6f4ced50837e126f28c1475ad89eaf91ad7 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 6 Jul 2011 14:31:33 +0200 Subject: Remove some metrics parsing code from Core Text The respective value in some of the default fonts like Lucida Grande are simply not reliable. It seems that the only reliable way to get such information is by going through all the glyphs. It seems that these code are not well tested on Mac and should be removed for now since it caused visible regressions in QLineEdit rendering. Reviewed-by: Eskil --- src/gui/text/qfontengine_coretext.mm | 20 +++----------------- src/gui/text/qfontengine_coretext_p.h | 3 --- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm index 64b8682..07711a3 100644 --- a/src/gui/text/qfontengine_coretext.mm +++ b/src/gui/text/qfontengine_coretext.mm @@ -492,17 +492,6 @@ void QCoreTextFontEngine::init() avgCharWidth = QFixed::fromReal(width * fontDef.pixelSize / emSize); } else avgCharWidth = QFontEngine::averageCharWidth(); - - ctMaxCharWidth = ctMinLeftBearing = ctMinRightBearing = 0; - QByteArray hheaTable = getSfntTable(MAKE_TAG('h', 'h', 'e', 'a')); - if (hheaTable.size() >= 16) { - quint16 width = qFromBigEndian(reinterpret_cast(hheaTable.constData() + 10)); - ctMaxCharWidth = width * fontDef.pixelSize / emSize; - qint16 bearing = qFromBigEndian(reinterpret_cast(hheaTable.constData() + 12)); - ctMinLeftBearing = bearing * fontDef.pixelSize / emSize; - bearing = qFromBigEndian(reinterpret_cast(hheaTable.constData() + 14)); - ctMinRightBearing = bearing * fontDef.pixelSize / emSize; - } } bool QCoreTextFontEngine::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, @@ -599,20 +588,17 @@ QFixed QCoreTextFontEngine::averageCharWidth() const qreal QCoreTextFontEngine::maxCharWidth() const { - return (fontDef.styleStrategy & QFont::ForceIntegerMetrics) - ? qRound(ctMaxCharWidth) : ctMaxCharWidth; + return 0; } qreal QCoreTextFontEngine::minLeftBearing() const { - return (fontDef.styleStrategy & QFont::ForceIntegerMetrics) - ? qRound(ctMinLeftBearing) : ctMinLeftBearing; + return 0; } qreal QCoreTextFontEngine::minRightBearing() const { - return (fontDef.styleStrategy & QFont::ForceIntegerMetrics) - ? qRound(ctMinRightBearing) : ctMinLeftBearing; + return 0; } void QCoreTextFontEngine::draw(CGContextRef ctx, qreal x, qreal y, const QTextItemInt &ti, int paintDeviceHeight) diff --git a/src/gui/text/qfontengine_coretext_p.h b/src/gui/text/qfontengine_coretext_p.h index 3ca8a0a..efe8295 100644 --- a/src/gui/text/qfontengine_coretext_p.h +++ b/src/gui/text/qfontengine_coretext_p.h @@ -103,9 +103,6 @@ private: int synthesisFlags; CGAffineTransform transform; QFixed avgCharWidth; - qreal ctMaxCharWidth; - qreal ctMinLeftBearing; - qreal ctMinRightBearing; friend class QCoreTextFontEngineMulti; }; -- cgit v0.12 From 6415e22649dd8620728c8c32b918c7afb8efc4dc Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 6 Jul 2011 15:24:06 +0200 Subject: Fix S60 compile --- src/gui/text/qfontdatabase_s60.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index 980b5de..2f4d055 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -508,7 +508,7 @@ static bool registerScreenDeviceFont(int screenDeviceFontIndex, QtFontFamily *family = privateDb()->family(familyName, true); family->fixedPitch = faceAttrib.IsMonoWidth(); QtFontFoundry *foundry = family->foundry(QString(), true); - QtFontStyle *style = foundry->style(styleKey, true); + QtFontStyle *style = foundry->style(styleKey, QString(), true); style->smoothScalable = typefaceSupport.iIsScalable; style->pixelSize(0, true); -- cgit v0.12 From 52c2bf0e0dc5bcad1b75f9b8d817b39ca7754476 Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Thu, 7 Jul 2011 11:01:28 +0200 Subject: Update the Window title when closing the last tab. Fixes: QTBUG-20243 Reviewed-By: Kevin Wright --- demos/browser/tabwidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/demos/browser/tabwidget.cpp b/demos/browser/tabwidget.cpp index 9ce9fb8..d8b9db1 100644 --- a/demos/browser/tabwidget.cpp +++ b/demos/browser/tabwidget.cpp @@ -438,6 +438,7 @@ WebView *TabWidget::newTab(bool makeCurrent) addTab(emptyWidget, tr("(Untitled)")); connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int))); + currentChanged(currentIndex()); return 0; } -- cgit v0.12