Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.4' into dev
Browse files Browse the repository at this point in the history
Change-Id: Id20053d261b4fbbcc0ac8ba49dd3ef2253fa4b95
  • Loading branch information
gladhorn committed Nov 27, 2014
2 parents 09e6748 + fa9bde7 commit ce6990c
Show file tree
Hide file tree
Showing 66 changed files with 643 additions and 318 deletions.
3 changes: 3 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -4198,6 +4198,9 @@ if [ "$CFG_NEON" = "auto" ]; then
*neon*)
CFG_NEON=yes
;;
*)
CFG_NEON=no
;;
esac
fi

Expand Down
10 changes: 10 additions & 0 deletions src/corelib/json/qjsonarray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,11 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
\internal
*/

/*! \typedef QJsonArray::iterator::pointer
\internal
*/

/*! \fn QJsonArray::iterator::iterator()
Constructs an uninitialized iterator.
Expand Down Expand Up @@ -953,6 +958,11 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
\internal
*/

/*! \typedef QJsonArray::const_iterator::pointer
\internal
*/

/*! \fn QJsonArray::const_iterator::const_iterator(const const_iterator &other)
Constructs a copy of \a other.
Expand Down
2 changes: 2 additions & 0 deletions src/corelib/kernel/qcoreapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2580,13 +2580,15 @@ void QCoreApplication::removeNativeEventFilter(QAbstractNativeEventFilter *filte
\sa QAbstractEventDispatcher::hasPendingEvents()
*/
#if QT_DEPRECATED_SINCE(5, 3)
bool QCoreApplication::hasPendingEvents()
{
QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance();
if (eventDispatcher)
return eventDispatcher->hasPendingEvents();
return false;
}
#endif

/*!
Returns a pointer to the event dispatcher object for the main thread. If no
Expand Down
7 changes: 4 additions & 3 deletions src/corelib/tools/qbytearray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3644,7 +3644,7 @@ QByteArray QByteArray::toBase64(Base64Options options) const
const char padchar = '=';
int padlen = 0;

QByteArray tmp((d->size * 4) / 3 + 3, Qt::Uninitialized);
QByteArray tmp((d->size + 2) / 3 * 4, Qt::Uninitialized);

int i = 0;
char *out = tmp.data();
Expand Down Expand Up @@ -3682,8 +3682,9 @@ QByteArray QByteArray::toBase64(Base64Options options) const
*out++ = alphabet[m];
}
}

tmp.truncate(out - tmp.data());
Q_ASSERT((options & OmitTrailingEquals) || (out == tmp.size() + tmp.data()));
if (options & OmitTrailingEquals)
tmp.truncate(out - tmp.data());
return tmp;
}

Expand Down
4 changes: 2 additions & 2 deletions src/corelib/tools/qstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1723,9 +1723,9 @@ void QString::expand(int i)

/*! \fn void QString::clear()
Clears the contents of the string and makes it empty.
Clears the contents of the string and makes it null.
\sa resize(), isEmpty()
\sa resize(), isNull()
*/

/*! \fn QString &QString::operator=(const QString &other)
Expand Down
4 changes: 4 additions & 0 deletions src/gui/kernel/qevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ QMouseEvent::QMouseEvent(Type type, const QPointF &localPos, Qt::MouseButton but
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
: QInputEvent(type, modifiers), l(localPos), w(localPos), b(button), mouseState(buttons), caps(0)
{
#ifndef QT_NO_CURSOR
s = QCursor::pos();
#endif
}


Expand Down Expand Up @@ -1594,7 +1596,9 @@ QContextMenuEvent::~QContextMenuEvent()
QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos)
: QInputEvent(ContextMenu), p(pos), reas(reason)
{
#ifndef QT_NO_CURSOR
gp = QCursor::pos();
#endif
}

/*!
Expand Down
14 changes: 10 additions & 4 deletions src/gui/kernel/qguiapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ QWindowList QGuiApplication::topLevelWindows()
/*!
Returns the primary (or default) screen of the application.
This will be the screen where QWindows are shown, unless otherwise specified.
This will be the screen where QWindows are initially shown, unless otherwise specified.
*/
QScreen *QGuiApplication::primaryScreen()
{
Expand Down Expand Up @@ -3386,15 +3386,21 @@ void QGuiApplicationPrivate::_q_updateFocusObject(QObject *object)
{
Q_Q(QGuiApplication);

QPlatformInputContext *inputContext = platformIntegration()->inputContext();
bool enabled = false;
if (object) {
QInputMethodQueryEvent query(Qt::ImEnabled);
if (object && inputContext) {
QInputMethodQueryEvent query(Qt::ImEnabled | Qt::ImHints);
QGuiApplication::sendEvent(object, &query);
enabled = query.value(Qt::ImEnabled).toBool();
if (enabled) {
static const bool supportsHiddenText = inputContext->hasCapability(QPlatformInputContext::HiddenTextCapability);
const Qt::InputMethodHints hints = static_cast<Qt::InputMethodHints>(query.value(Qt::ImHints).toInt());
if ((hints & Qt::ImhHiddenText) && !supportsHiddenText)
enabled = false;
}
}

QPlatformInputContextPrivate::setInputMethodAccepted(enabled);
QPlatformInputContext *inputContext = platformIntegration()->inputContext();
if (inputContext)
inputContext->setFocusObject(object);
emit q->focusObjectChanged(object);
Expand Down
11 changes: 11 additions & 0 deletions src/gui/kernel/qplatforminputcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ bool QPlatformInputContext::isValid() const
return false;
}

/*!
Returns whether the implementation supports \a capability.
\internal
\since 5.4
*/
bool QPlatformInputContext::hasCapability(Capability capability) const
{
Q_UNUSED(capability)
return true;
}

/*!
Method to be called when input method needs to be reset. Called by QInputMethod::reset().
No further QInputMethodEvents should be sent as response.
Expand Down
5 changes: 5 additions & 0 deletions src/gui/kernel/qplatforminputcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,15 @@ class Q_GUI_EXPORT QPlatformInputContext : public QObject
Q_DECLARE_PRIVATE(QPlatformInputContext)

public:
enum Capability {
HiddenTextCapability = 0x1
};

QPlatformInputContext();
virtual ~QPlatformInputContext();

virtual bool isValid() const;
virtual bool hasCapability(Capability capability) const;

virtual void reset();
virtual void commit();
Expand Down
2 changes: 2 additions & 0 deletions src/gui/kernel/qplatformwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,14 @@ static inline const QScreen *effectiveScreen(const QWindow *window)
if (!screen)
return QGuiApplication::primaryScreen();
const QList<QScreen *> siblings = screen->virtualSiblings();
#ifndef QT_NO_CURSOR
if (siblings.size() > 1) {
const QPoint referencePoint = window->transientParent() ? window->transientParent()->geometry().center() : QCursor::pos();
foreach (const QScreen *sibling, siblings)
if (sibling->geometry().contains(referencePoint))
return sibling;
}
#endif
return screen;
}

Expand Down
2 changes: 2 additions & 0 deletions src/gui/kernel/qshapedpixmapdndwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,14 @@ void QShapedPixmapWindow::setHotspot(const QPoint &hotspot)

void QShapedPixmapWindow::updateGeometry()
{
#ifndef QT_NO_CURSOR
QRect rect(QCursor::pos() - m_hotSpot, m_pixmap.size());
if (m_pixmap.isNull())
m_backingStore->resize(QSize(1,1));
else if (m_backingStore->size() != m_pixmap.size())
m_backingStore->resize(m_pixmap.size());
setGeometry(rect);
#endif
}

void QShapedPixmapWindow::exposeEvent(QExposeEvent *)
Expand Down
2 changes: 2 additions & 0 deletions src/gui/kernel/qsurfaceformat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ void QSurfaceFormat::setSamples(int numSamples)
}
}

#if QT_DEPRECATED_SINCE(5, 2)
/*!
\obsolete
\overload
Expand Down Expand Up @@ -343,6 +344,7 @@ bool QSurfaceFormat::testOption(QSurfaceFormat::FormatOptions opt) const
{
return d->opts & opt;
}
#endif // QT_DEPRECATED_SINCE(5, 2)

/*!
\since 5.3
Expand Down
2 changes: 2 additions & 0 deletions src/gui/kernel/qsurfaceformat.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ class Q_GUI_EXPORT QSurfaceFormat
bool stereo() const;
void setStereo(bool enable);

#if QT_DEPRECATED_SINCE(5, 2)
QT_DEPRECATED void setOption(QSurfaceFormat::FormatOptions opt);
QT_DEPRECATED bool testOption(QSurfaceFormat::FormatOptions opt) const;
#endif

void setOptions(QSurfaceFormat::FormatOptions options);
void setOption(FormatOption option, bool on = true);
Expand Down
9 changes: 9 additions & 0 deletions src/gui/kernel/qwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,15 @@ void QWindowPrivate::clearFocusObject()
{
}

// Allows for manipulating the suggested geometry before a resize/move
// event in derived classes for platforms that support it, for example to
// implement heightForWidth().
QRectF QWindowPrivate::closestAcceptableGeometry(const QRectF &rect) const
{
Q_UNUSED(rect)
return QRectF();
}

/*!
Sets the \a surfaceType of the window.
Expand Down
1 change: 1 addition & 0 deletions src/gui/kernel/qwindow_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class Q_GUI_EXPORT QWindowPrivate : public QObjectPrivate
void emitScreenChangedRecursion(QScreen *newScreen);

virtual void clearFocusObject();
virtual QRectF closestAcceptableGeometry(const QRectF &rect) const;

bool isPopup() const { return (windowFlags & Qt::WindowType_Mask) == Qt::Popup; }

Expand Down
4 changes: 4 additions & 0 deletions src/gui/opengl/qopengltexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2965,6 +2965,7 @@ void QOpenGLTexture::setData(PixelFormat sourceFormat, PixelType sourceType,
d->setData(0, 0, QOpenGLTexture::CubeMapPositiveX, sourceFormat, sourceType, data, options);
}

#if QT_DEPRECATED_SINCE(5, 3)
/*!
\obsolete
\overload
Expand Down Expand Up @@ -3022,6 +3023,7 @@ void QOpenGLTexture::setData(PixelFormat sourceFormat, PixelType sourceType,
Q_ASSERT(d->textureId);
d->setData(0, 0, QOpenGLTexture::CubeMapPositiveX, sourceFormat, sourceType, data, options);
}
#endif

/*!
This overload of setData() will allocate storage for you.
Expand Down Expand Up @@ -3110,6 +3112,7 @@ void QOpenGLTexture::setCompressedData(int dataSize, const void *data,
d->setCompressedData(0, 0, QOpenGLTexture::CubeMapPositiveX, dataSize, data, options);
}

#if QT_DEPRECATED_SINCE(5, 3)
/*!
\obsolete
\overload
Expand Down Expand Up @@ -3163,6 +3166,7 @@ void QOpenGLTexture::setCompressedData(int dataSize, void *data,
Q_ASSERT(d->textureId);
d->setCompressedData(0, 0, QOpenGLTexture::CubeMapPositiveX, dataSize, data, options);
}
#endif

/*!
Returns \c true if your OpenGL implementation and version supports the texture
Expand Down
4 changes: 4 additions & 0 deletions src/gui/opengl/qopengltexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ class Q_GUI_EXPORT QOpenGLTexture

// Pixel transfer
// ### Qt 6: remove the non-const void * overloads
#if QT_DEPRECATED_SINCE(5, 3)
QT_DEPRECATED void setData(int mipLevel, int layer, CubeMapFace cubeFace,
PixelFormat sourceFormat, PixelType sourceType,
void *data, const QOpenGLPixelTransferOptions * const options = 0);
Expand All @@ -415,6 +416,7 @@ class Q_GUI_EXPORT QOpenGLTexture
void *data, const QOpenGLPixelTransferOptions * const options = 0);
QT_DEPRECATED void setData(PixelFormat sourceFormat, PixelType sourceType,
void *data, const QOpenGLPixelTransferOptions * const options = 0);
#endif // QT_DEPRECATED_SINCE(5, 3)

void setData(int mipLevel, int layer, CubeMapFace cubeFace,
PixelFormat sourceFormat, PixelType sourceType,
Expand All @@ -430,6 +432,7 @@ class Q_GUI_EXPORT QOpenGLTexture

// Compressed data upload
// ### Qt 6: remove the non-const void * overloads
#if QT_DEPRECATED_SINCE(5, 3)
QT_DEPRECATED void setCompressedData(int mipLevel, int layer, CubeMapFace cubeFace,
int dataSize, void *data,
const QOpenGLPixelTransferOptions * const options = 0);
Expand All @@ -440,6 +443,7 @@ class Q_GUI_EXPORT QOpenGLTexture
const QOpenGLPixelTransferOptions * const options = 0);
QT_DEPRECATED void setCompressedData(int dataSize, void *data,
const QOpenGLPixelTransferOptions * const options = 0);
#endif // QT_DEPRECATED_SINCE(5, 3)

void setCompressedData(int mipLevel, int layer, CubeMapFace cubeFace,
int dataSize, const void *data,
Expand Down
9 changes: 1 addition & 8 deletions src/gui/painting/qpaintbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include <private/qimage_p.h>
#include <qstatictext.h>
#include <private/qstatictext_p.h>
#include <private/qrawfont_p.h>

#include <QDebug>

Expand Down Expand Up @@ -1744,14 +1743,8 @@ void QPainterReplayer::process(const QPaintBufferCommand &cmd)

painter->setFont(font);

QRawFont rawFont;
QRawFontPrivate *rawFontD = QRawFontPrivate::get(rawFont);
QFontPrivate *fontD = QFontPrivate::get(font);
rawFontD->fontEngine = fontD->engineForScript(QChar::Script_Common);
rawFontD->fontEngine->ref.ref();

QGlyphRun glyphs;
glyphs.setRawFont(rawFont);
glyphs.setRawFont(QRawFont::fromFont(font, QFontDatabase::Any));
glyphs.setGlyphIndexes(glyphIndexes);
glyphs.setPositions(positions);

Expand Down
7 changes: 5 additions & 2 deletions src/gui/painting/qpainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6358,7 +6358,7 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText
return;

const QPainter::RenderHints oldRenderHints = state->renderHints;
if (!state->renderHints & QPainter::Antialiasing && state->matrix.type() >= QTransform::TxScale) {
if (!(state->renderHints & QPainter::Antialiasing) && state->matrix.type() >= QTransform::TxScale) {
// draw antialias decoration (underline/overline/strikeout) with
// transformed text

Expand Down Expand Up @@ -6428,7 +6428,10 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText
if (rtl)
x -= ti2.width.toReal();

engine->drawTextItem(QPointF(x, y), ti2);
if (extended)
extended->drawTextItem(QPointF(x, y), ti2);
else
engine->drawTextItem(QPointF(x, y), ti2);

if (!rtl)
x += ti2.width.toReal();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/text/qdistancefield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ bool qt_fontHasNarrowOutlines(const QRawFont &f)
return false;

QVector<quint32> glyphIndices = font.glyphIndexesForString(QLatin1String("O"));
if (glyphIndices.size() < 1)
if (glyphIndices.isEmpty() || glyphIndices[0] == 0)
return false;

return imageHasNarrowOutlines(font.alphaMapForGlyph(glyphIndices.at(0),
Expand Down
2 changes: 2 additions & 0 deletions src/gui/text/qfont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1950,6 +1950,7 @@ static void set_extended_font_bits(quint8 bits, QFontPrivate *f)
}
#endif

#if QT_DEPRECATED_SINCE(5, 3)
/*!
\fn QString QFont::rawName() const
\deprecated
Expand Down Expand Up @@ -1986,6 +1987,7 @@ QString QFont::rawName() const
void QFont::setRawName(const QString &)
{
}
#endif

/*!
Returns the font's key, a textual representation of a font. It is
Expand Down
3 changes: 2 additions & 1 deletion src/gui/text/qfontdatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2482,11 +2482,12 @@ bool QFontDatabase::removeAllApplicationFonts()

\sa {Thread-Support in Qt Modules#Painting In Threads}{Painting In Threads}
*/
// QT_DEPRECATED_SINCE(5, 2)
#if QT_DEPRECATED_SINCE(5, 2)
bool QFontDatabase::supportsThreadedFontRendering()
{
return true;
}
#endif

/*!
\internal
Expand Down
Loading

0 comments on commit ce6990c

Please sign in to comment.