Merge remote-tracking branch 'origin/5.6' into 5.7
Also bump minimum required Qt version for Android: Ministro updates. Conflicts: src/android/java/src/org/qtproject/qt5/android/bindings/QtActivityLoader.java src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java src/plugins/platforms/android/androidjnimain.cpp Change-Id: I966f249bebf92da37bfdeb995ad21b027eb03301
This commit is contained in:
commit
6370c3aa71
@ -156,12 +156,14 @@ static inline void positionCluster(HB_ShaperItem *item, int gfrom, int glast)
|
|||||||
// ### wrong in rtl context!
|
// ### wrong in rtl context!
|
||||||
case HB_Combining_BelowLeft:
|
case HB_Combining_BelowLeft:
|
||||||
p.y += offset;
|
p.y += offset;
|
||||||
|
// fall through
|
||||||
case HB_Combining_BelowLeftAttached:
|
case HB_Combining_BelowLeftAttached:
|
||||||
p.x += attachmentRect.x - markMetrics.x;
|
p.x += attachmentRect.x - markMetrics.x;
|
||||||
p.y += (attachmentRect.y + attachmentRect.height) - markMetrics.y;
|
p.y += (attachmentRect.y + attachmentRect.height) - markMetrics.y;
|
||||||
break;
|
break;
|
||||||
case HB_Combining_Below:
|
case HB_Combining_Below:
|
||||||
p.y += offset;
|
p.y += offset;
|
||||||
|
// fall through
|
||||||
case HB_Combining_BelowAttached:
|
case HB_Combining_BelowAttached:
|
||||||
p.x += attachmentRect.x - markMetrics.x;
|
p.x += attachmentRect.x - markMetrics.x;
|
||||||
p.y += (attachmentRect.y + attachmentRect.height) - markMetrics.y;
|
p.y += (attachmentRect.y + attachmentRect.height) - markMetrics.y;
|
||||||
@ -170,28 +172,33 @@ static inline void positionCluster(HB_ShaperItem *item, int gfrom, int glast)
|
|||||||
break;
|
break;
|
||||||
case HB_Combining_BelowRight:
|
case HB_Combining_BelowRight:
|
||||||
p.y += offset;
|
p.y += offset;
|
||||||
|
// fall through
|
||||||
case HB_Combining_BelowRightAttached:
|
case HB_Combining_BelowRightAttached:
|
||||||
p.x += attachmentRect.x + attachmentRect.width - markMetrics.width - markMetrics.x;
|
p.x += attachmentRect.x + attachmentRect.width - markMetrics.width - markMetrics.x;
|
||||||
p.y += attachmentRect.y + attachmentRect.height - markMetrics.y;
|
p.y += attachmentRect.y + attachmentRect.height - markMetrics.y;
|
||||||
break;
|
break;
|
||||||
case HB_Combining_Left:
|
case HB_Combining_Left:
|
||||||
p.x -= offset;
|
p.x -= offset;
|
||||||
|
// fall through
|
||||||
case HB_Combining_LeftAttached:
|
case HB_Combining_LeftAttached:
|
||||||
break;
|
break;
|
||||||
case HB_Combining_Right:
|
case HB_Combining_Right:
|
||||||
p.x += offset;
|
p.x += offset;
|
||||||
|
// fall through
|
||||||
case HB_Combining_RightAttached:
|
case HB_Combining_RightAttached:
|
||||||
break;
|
break;
|
||||||
case HB_Combining_DoubleAbove:
|
case HB_Combining_DoubleAbove:
|
||||||
// ### wrong in RTL context!
|
// ### wrong in RTL context!
|
||||||
case HB_Combining_AboveLeft:
|
case HB_Combining_AboveLeft:
|
||||||
p.y -= offset;
|
p.y -= offset;
|
||||||
|
// fall through
|
||||||
case HB_Combining_AboveLeftAttached:
|
case HB_Combining_AboveLeftAttached:
|
||||||
p.x += attachmentRect.x - markMetrics.x;
|
p.x += attachmentRect.x - markMetrics.x;
|
||||||
p.y += attachmentRect.y - markMetrics.y - markMetrics.height;
|
p.y += attachmentRect.y - markMetrics.y - markMetrics.height;
|
||||||
break;
|
break;
|
||||||
case HB_Combining_Above:
|
case HB_Combining_Above:
|
||||||
p.y -= offset;
|
p.y -= offset;
|
||||||
|
// fall through
|
||||||
case HB_Combining_AboveAttached:
|
case HB_Combining_AboveAttached:
|
||||||
p.x += attachmentRect.x - markMetrics.x;
|
p.x += attachmentRect.x - markMetrics.x;
|
||||||
p.y += attachmentRect.y - markMetrics.y - markMetrics.height;
|
p.y += attachmentRect.y - markMetrics.y - markMetrics.height;
|
||||||
@ -200,6 +207,7 @@ static inline void positionCluster(HB_ShaperItem *item, int gfrom, int glast)
|
|||||||
break;
|
break;
|
||||||
case HB_Combining_AboveRight:
|
case HB_Combining_AboveRight:
|
||||||
p.y -= offset;
|
p.y -= offset;
|
||||||
|
// fall through
|
||||||
case HB_Combining_AboveRightAttached:
|
case HB_Combining_AboveRightAttached:
|
||||||
p.x += attachmentRect.x + attachmentRect.width - markMetrics.x - markMetrics.width;
|
p.x += attachmentRect.x + attachmentRect.width - markMetrics.x - markMetrics.width;
|
||||||
p.y += attachmentRect.y - markMetrics.y - markMetrics.height;
|
p.y += attachmentRect.y - markMetrics.y - markMetrics.height;
|
||||||
|
@ -66,7 +66,7 @@ public class QtActivityLoader extends QtLoader {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialogInterface, int i) {
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
try {
|
try {
|
||||||
Uri uri = Uri.parse("market://search?q=pname:org.kde.necessitas.ministro");
|
Uri uri = Uri.parse("market://details?id=org.kde.necessitas.ministro");
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
||||||
m_activity.startActivityForResult(intent, MINISTRO_INSTALL_REQUEST_CODE);
|
m_activity.startActivityForResult(intent, MINISTRO_INSTALL_REQUEST_CODE);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -73,7 +73,7 @@ public abstract class QtLoader {
|
|||||||
public final static int MINISTRO_INSTALL_REQUEST_CODE = 0xf3ee; // request code used to know when Ministro instalation is finished
|
public final static int MINISTRO_INSTALL_REQUEST_CODE = 0xf3ee; // request code used to know when Ministro instalation is finished
|
||||||
public static final int MINISTRO_API_LEVEL = 5; // Ministro api level (check IMinistro.aidl file)
|
public static final int MINISTRO_API_LEVEL = 5; // Ministro api level (check IMinistro.aidl file)
|
||||||
public static final int NECESSITAS_API_LEVEL = 2; // Necessitas api level used by platform plugin
|
public static final int NECESSITAS_API_LEVEL = 2; // Necessitas api level used by platform plugin
|
||||||
public static final int QT_VERSION = 0x050100; // This app requires at least Qt version 5.1.0
|
public static final int QT_VERSION = 0x050700; // This app requires at least Qt version 5.7.0
|
||||||
|
|
||||||
public static final String ERROR_CODE_KEY = "error.code";
|
public static final String ERROR_CODE_KEY = "error.code";
|
||||||
public static final String ERROR_MESSAGE_KEY = "error.message";
|
public static final String ERROR_MESSAGE_KEY = "error.message";
|
||||||
|
@ -761,18 +761,25 @@ QDBusMessage QDBusAbstractInterface::call(QDBus::CallMode mode, const QString &m
|
|||||||
switch (count) {
|
switch (count) {
|
||||||
case 8:
|
case 8:
|
||||||
argList.prepend(arg8);
|
argList.prepend(arg8);
|
||||||
|
// fall through
|
||||||
case 7:
|
case 7:
|
||||||
argList.prepend(arg7);
|
argList.prepend(arg7);
|
||||||
|
// fall through
|
||||||
case 6:
|
case 6:
|
||||||
argList.prepend(arg6);
|
argList.prepend(arg6);
|
||||||
|
// fall through
|
||||||
case 5:
|
case 5:
|
||||||
argList.prepend(arg5);
|
argList.prepend(arg5);
|
||||||
|
// fall through
|
||||||
case 4:
|
case 4:
|
||||||
argList.prepend(arg4);
|
argList.prepend(arg4);
|
||||||
|
// fall through
|
||||||
case 3:
|
case 3:
|
||||||
argList.prepend(arg3);
|
argList.prepend(arg3);
|
||||||
|
// fall through
|
||||||
case 2:
|
case 2:
|
||||||
argList.prepend(arg2);
|
argList.prepend(arg2);
|
||||||
|
// fall through
|
||||||
case 1:
|
case 1:
|
||||||
argList.prepend(arg1);
|
argList.prepend(arg1);
|
||||||
}
|
}
|
||||||
@ -819,18 +826,25 @@ QDBusPendingCall QDBusAbstractInterface::asyncCall(const QString &method, const
|
|||||||
switch (count) {
|
switch (count) {
|
||||||
case 8:
|
case 8:
|
||||||
argList.prepend(arg8);
|
argList.prepend(arg8);
|
||||||
|
// fall through
|
||||||
case 7:
|
case 7:
|
||||||
argList.prepend(arg7);
|
argList.prepend(arg7);
|
||||||
|
// fall through
|
||||||
case 6:
|
case 6:
|
||||||
argList.prepend(arg6);
|
argList.prepend(arg6);
|
||||||
|
// fall through
|
||||||
case 5:
|
case 5:
|
||||||
argList.prepend(arg5);
|
argList.prepend(arg5);
|
||||||
|
// fall through
|
||||||
case 4:
|
case 4:
|
||||||
argList.prepend(arg4);
|
argList.prepend(arg4);
|
||||||
|
// fall through
|
||||||
case 3:
|
case 3:
|
||||||
argList.prepend(arg3);
|
argList.prepend(arg3);
|
||||||
|
// fall through
|
||||||
case 2:
|
case 2:
|
||||||
argList.prepend(arg2);
|
argList.prepend(arg2);
|
||||||
|
// fall through
|
||||||
case 1:
|
case 1:
|
||||||
argList.prepend(arg1);
|
argList.prepend(arg1);
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,6 @@ public:
|
|||||||
QIcon::State state) = 0;
|
QIcon::State state) = 0;
|
||||||
QString filename;
|
QString filename;
|
||||||
QIconDirInfo dir;
|
QIconDirInfo dir;
|
||||||
static int count;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ScalableEntry : public QIconLoaderEngineEntry
|
struct ScalableEntry : public QIconLoaderEngineEntry
|
||||||
@ -124,18 +123,18 @@ public:
|
|||||||
QIconLoaderEngine(const QString& iconName = QString());
|
QIconLoaderEngine(const QString& iconName = QString());
|
||||||
~QIconLoaderEngine();
|
~QIconLoaderEngine();
|
||||||
|
|
||||||
void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state);
|
void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
|
||||||
QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state);
|
QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
|
||||||
QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state);
|
QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
|
||||||
QIconEngine *clone() const;
|
QIconEngine *clone() const Q_DECL_OVERRIDE;
|
||||||
bool read(QDataStream &in);
|
bool read(QDataStream &in) Q_DECL_OVERRIDE;
|
||||||
bool write(QDataStream &out) const;
|
bool write(QDataStream &out) const Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString key() const;
|
QString key() const Q_DECL_OVERRIDE;
|
||||||
bool hasIcon() const;
|
bool hasIcon() const;
|
||||||
void ensureLoaded();
|
void ensureLoaded();
|
||||||
void virtual_hook(int id, void *data);
|
void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
|
||||||
QIconLoaderEngineEntry *entryForSize(const QSize &size);
|
QIconLoaderEngineEntry *entryForSize(const QSize &size);
|
||||||
QIconLoaderEngine(const QIconLoaderEngine &other);
|
QIconLoaderEngine(const QIconLoaderEngine &other);
|
||||||
QThemeIconInfo m_info;
|
QThemeIconInfo m_info;
|
||||||
|
@ -5026,7 +5026,7 @@ static Q_CONSTEXPR QPixelFormat pixelformats[] = {
|
|||||||
/*ALPHA USAGE*/ QPixelFormat::IgnoresAlpha,
|
/*ALPHA USAGE*/ QPixelFormat::IgnoresAlpha,
|
||||||
/*ALPHA POSITION*/ QPixelFormat::AtBeginning,
|
/*ALPHA POSITION*/ QPixelFormat::AtBeginning,
|
||||||
/*PREMULTIPLIED*/ QPixelFormat::NotPremultiplied,
|
/*PREMULTIPLIED*/ QPixelFormat::NotPremultiplied,
|
||||||
/*INTERPRETATION*/ QPixelFormat::UnsignedInteger,
|
/*INTERPRETATION*/ QPixelFormat::UnsignedByte,
|
||||||
/*BYTE ORDER*/ QPixelFormat::CurrentSystemEndian),
|
/*BYTE ORDER*/ QPixelFormat::CurrentSystemEndian),
|
||||||
//QImage::Format_RGB444:
|
//QImage::Format_RGB444:
|
||||||
QPixelFormat(QPixelFormat::RGB,
|
QPixelFormat(QPixelFormat::RGB,
|
||||||
|
@ -342,6 +342,10 @@ void QPlatformScreen::resizeMaximizedWindows()
|
|||||||
for (int i = 0; i < windows.size(); ++i) {
|
for (int i = 0; i < windows.size(); ++i) {
|
||||||
QWindow *w = windows.at(i);
|
QWindow *w = windows.at(i);
|
||||||
|
|
||||||
|
// Skip non-platform windows, e.g., offscreen windows.
|
||||||
|
if (!w->handle())
|
||||||
|
continue;
|
||||||
|
|
||||||
if (platformScreenForWindow(w) != this)
|
if (platformScreenForWindow(w) != this)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -335,6 +335,8 @@ struct QSpanData
|
|||||||
QGradientData gradient;
|
QGradientData gradient;
|
||||||
QTextureData texture;
|
QTextureData texture;
|
||||||
};
|
};
|
||||||
|
QExplicitlySharedDataPointer<const QSharedData> cachedGradient;
|
||||||
|
|
||||||
|
|
||||||
void init(QRasterBuffer *rb, const QRasterPaintEngine *pe);
|
void init(QRasterBuffer *rb, const QRasterPaintEngine *pe);
|
||||||
void setup(const QBrush &brush, int alpha, QPainter::CompositionMode compositionMode);
|
void setup(const QBrush &brush, int alpha, QPainter::CompositionMode compositionMode);
|
||||||
|
@ -2283,6 +2283,8 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
|
|||||||
= QRectF(sr.x() + clippedTargetRect.x() - r.x(), sr.y() + clippedTargetRect.y() - r.y(),
|
= QRectF(sr.x() + clippedTargetRect.x() - r.x(), sr.y() + clippedTargetRect.y() - r.y(),
|
||||||
clippedTargetRect.width(), clippedTargetRect.height()).toRect();
|
clippedTargetRect.width(), clippedTargetRect.height()).toRect();
|
||||||
|
|
||||||
|
clippedSourceRect = clippedSourceRect.intersected(img.rect());
|
||||||
|
|
||||||
uint dbpl = d->rasterBuffer->bytesPerLine();
|
uint dbpl = d->rasterBuffer->bytesPerLine();
|
||||||
uint sbpl = img.bytesPerLine();
|
uint sbpl = img.bytesPerLine();
|
||||||
|
|
||||||
@ -4147,7 +4149,8 @@ void QRasterBuffer::flushToARGBImage(QImage *target) const
|
|||||||
|
|
||||||
class QGradientCache
|
class QGradientCache
|
||||||
{
|
{
|
||||||
struct CacheInfo
|
public:
|
||||||
|
struct CacheInfo : public QSharedData
|
||||||
{
|
{
|
||||||
inline CacheInfo(QGradientStops s, int op, QGradient::InterpolationMode mode) :
|
inline CacheInfo(QGradientStops s, int op, QGradient::InterpolationMode mode) :
|
||||||
stops(qMove(s)), opacity(op), interpolationMode(mode) {}
|
stops(qMove(s)), opacity(op), interpolationMode(mode) {}
|
||||||
@ -4158,12 +4161,9 @@ class QGradientCache
|
|||||||
QGradient::InterpolationMode interpolationMode;
|
QGradient::InterpolationMode interpolationMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef QMultiHash<quint64, CacheInfo> QGradientColorTableHash;
|
typedef QMultiHash<quint64, QExplicitlySharedDataPointer<const CacheInfo> > QGradientColorTableHash;
|
||||||
|
|
||||||
public:
|
inline QExplicitlySharedDataPointer<const CacheInfo> getBuffer(const QGradient &gradient, int opacity) {
|
||||||
typedef QPair<const QRgb *, const QRgba64 *> ColorBufferPair;
|
|
||||||
|
|
||||||
inline ColorBufferPair getBuffer(const QGradient &gradient, int opacity) {
|
|
||||||
quint64 hash_val = 0;
|
quint64 hash_val = 0;
|
||||||
|
|
||||||
const QGradientStops stops = gradient.stops();
|
const QGradientStops stops = gradient.stops();
|
||||||
@ -4177,10 +4177,9 @@ public:
|
|||||||
return addCacheElement(hash_val, gradient, opacity);
|
return addCacheElement(hash_val, gradient, opacity);
|
||||||
else {
|
else {
|
||||||
do {
|
do {
|
||||||
const CacheInfo &cache_info = it.value();
|
const QExplicitlySharedDataPointer<const CacheInfo> &cache_info = it.value();
|
||||||
if (cache_info.stops == stops && cache_info.opacity == opacity && cache_info.interpolationMode == gradient.interpolationMode())
|
if (cache_info->stops == stops && cache_info->opacity == opacity && cache_info->interpolationMode == gradient.interpolationMode())
|
||||||
return qMakePair(reinterpret_cast<const QRgb *>(cache_info.buffer32),
|
return cache_info;
|
||||||
reinterpret_cast<const QRgba64 *>(cache_info.buffer64));
|
|
||||||
++it;
|
++it;
|
||||||
} while (it != cache.constEnd() && it.key() == hash_val);
|
} while (it != cache.constEnd() && it.key() == hash_val);
|
||||||
// an exact match for these stops and opacity was not found, create new cache
|
// an exact match for these stops and opacity was not found, create new cache
|
||||||
@ -4194,18 +4193,16 @@ protected:
|
|||||||
inline void generateGradientColorTable(const QGradient& g,
|
inline void generateGradientColorTable(const QGradient& g,
|
||||||
QRgba64 *colorTable,
|
QRgba64 *colorTable,
|
||||||
int size, int opacity) const;
|
int size, int opacity) const;
|
||||||
ColorBufferPair addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity) {
|
QExplicitlySharedDataPointer<const CacheInfo> addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity) {
|
||||||
if (cache.size() == maxCacheSize()) {
|
if (cache.size() == maxCacheSize()) {
|
||||||
// may remove more than 1, but OK
|
// may remove more than 1, but OK
|
||||||
cache.erase(cache.begin() + (qrand() % maxCacheSize()));
|
cache.erase(cache.begin() + (qrand() % maxCacheSize()));
|
||||||
}
|
}
|
||||||
CacheInfo cache_entry(gradient.stops(), opacity, gradient.interpolationMode());
|
QExplicitlySharedDataPointer<CacheInfo> cache_entry(new CacheInfo (gradient.stops(), opacity, gradient.interpolationMode()));
|
||||||
generateGradientColorTable(gradient, cache_entry.buffer64, paletteSize(), opacity);
|
generateGradientColorTable(gradient, cache_entry->buffer64, paletteSize(), opacity);
|
||||||
for (int i = 0; i < GRADIENT_STOPTABLE_SIZE; ++i)
|
for (int i = 0; i < GRADIENT_STOPTABLE_SIZE; ++i)
|
||||||
cache_entry.buffer32[i] = cache_entry.buffer64[i].toArgb32();
|
cache_entry->buffer32[i] = cache_entry->buffer64[i].toArgb32();
|
||||||
CacheInfo &cache_value = cache.insert(hash_val, cache_entry).value();
|
return cache.insert(hash_val, cache_entry).value();
|
||||||
return qMakePair(reinterpret_cast<const QRgb *>(cache_value.buffer32),
|
|
||||||
reinterpret_cast<const QRgba64 *>(cache_value.buffer64));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QGradientColorTableHash cache;
|
QGradientColorTableHash cache;
|
||||||
@ -4424,6 +4421,7 @@ Q_GUI_EXPORT extern QImage qt_imageForBrush(int brushStyle, bool invert);
|
|||||||
void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode compositionMode)
|
void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode compositionMode)
|
||||||
{
|
{
|
||||||
Qt::BrushStyle brushStyle = qbrush_style(brush);
|
Qt::BrushStyle brushStyle = qbrush_style(brush);
|
||||||
|
cachedGradient.reset();
|
||||||
switch (brushStyle) {
|
switch (brushStyle) {
|
||||||
case Qt::SolidPattern: {
|
case Qt::SolidPattern: {
|
||||||
type = Solid;
|
type = Solid;
|
||||||
@ -4440,9 +4438,10 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
|
|||||||
const QLinearGradient *g = static_cast<const QLinearGradient *>(brush.gradient());
|
const QLinearGradient *g = static_cast<const QLinearGradient *>(brush.gradient());
|
||||||
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
|
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
|
||||||
|
|
||||||
QGradientCache::ColorBufferPair colorBuffers = qt_gradient_cache()->getBuffer(*g, alpha);
|
QExplicitlySharedDataPointer<const QGradientCache::CacheInfo> cacheInfo = qt_gradient_cache()->getBuffer(*g, alpha);
|
||||||
gradient.colorTable64 = colorBuffers.second;
|
cachedGradient = cacheInfo;
|
||||||
gradient.colorTable32 = colorBuffers.first;
|
gradient.colorTable32 = cacheInfo->buffer32;
|
||||||
|
gradient.colorTable64 = cacheInfo->buffer64;
|
||||||
|
|
||||||
gradient.spread = g->spread();
|
gradient.spread = g->spread();
|
||||||
|
|
||||||
@ -4461,9 +4460,10 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
|
|||||||
const QRadialGradient *g = static_cast<const QRadialGradient *>(brush.gradient());
|
const QRadialGradient *g = static_cast<const QRadialGradient *>(brush.gradient());
|
||||||
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
|
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
|
||||||
|
|
||||||
QGradientCache::ColorBufferPair colorBuffers = qt_gradient_cache()->getBuffer(*g, alpha);
|
QExplicitlySharedDataPointer<const QGradientCache::CacheInfo> cacheInfo = qt_gradient_cache()->getBuffer(*g, alpha);
|
||||||
gradient.colorTable64 = colorBuffers.second;
|
cachedGradient = cacheInfo;
|
||||||
gradient.colorTable32 = colorBuffers.first;
|
gradient.colorTable32 = cacheInfo->buffer32;
|
||||||
|
gradient.colorTable64 = cacheInfo->buffer64;
|
||||||
|
|
||||||
gradient.spread = g->spread();
|
gradient.spread = g->spread();
|
||||||
|
|
||||||
@ -4486,9 +4486,10 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
|
|||||||
const QConicalGradient *g = static_cast<const QConicalGradient *>(brush.gradient());
|
const QConicalGradient *g = static_cast<const QConicalGradient *>(brush.gradient());
|
||||||
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
|
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
|
||||||
|
|
||||||
QGradientCache::ColorBufferPair colorBuffers = qt_gradient_cache()->getBuffer(*g, alpha);
|
QExplicitlySharedDataPointer<const QGradientCache::CacheInfo> cacheInfo = qt_gradient_cache()->getBuffer(*g, alpha);
|
||||||
gradient.colorTable64 = colorBuffers.second;
|
cachedGradient = cacheInfo;
|
||||||
gradient.colorTable32 = colorBuffers.first;
|
gradient.colorTable32 = cacheInfo->buffer32;
|
||||||
|
gradient.colorTable64 = cacheInfo->buffer64;
|
||||||
|
|
||||||
gradient.spread = QGradient::RepeatSpread;
|
gradient.spread = QGradient::RepeatSpread;
|
||||||
|
|
||||||
|
@ -1293,14 +1293,19 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co
|
|||||||
switch (versionString[2].toLatin1()) {
|
switch (versionString[2].toLatin1()) {
|
||||||
case '5':
|
case '5':
|
||||||
versionFlags |= QGLFormat::OpenGL_Version_1_5;
|
versionFlags |= QGLFormat::OpenGL_Version_1_5;
|
||||||
|
// fall through
|
||||||
case '4':
|
case '4':
|
||||||
versionFlags |= QGLFormat::OpenGL_Version_1_4;
|
versionFlags |= QGLFormat::OpenGL_Version_1_4;
|
||||||
|
// fall through
|
||||||
case '3':
|
case '3':
|
||||||
versionFlags |= QGLFormat::OpenGL_Version_1_3;
|
versionFlags |= QGLFormat::OpenGL_Version_1_3;
|
||||||
|
// fall through
|
||||||
case '2':
|
case '2':
|
||||||
versionFlags |= QGLFormat::OpenGL_Version_1_2;
|
versionFlags |= QGLFormat::OpenGL_Version_1_2;
|
||||||
|
// fall through
|
||||||
case '1':
|
case '1':
|
||||||
versionFlags |= QGLFormat::OpenGL_Version_1_1;
|
versionFlags |= QGLFormat::OpenGL_Version_1_1;
|
||||||
|
// fall through
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1325,10 +1330,13 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co
|
|||||||
switch (versionString[2].toLatin1()) {
|
switch (versionString[2].toLatin1()) {
|
||||||
case '3':
|
case '3':
|
||||||
versionFlags |= QGLFormat::OpenGL_Version_3_3;
|
versionFlags |= QGLFormat::OpenGL_Version_3_3;
|
||||||
|
// fall through
|
||||||
case '2':
|
case '2':
|
||||||
versionFlags |= QGLFormat::OpenGL_Version_3_2;
|
versionFlags |= QGLFormat::OpenGL_Version_3_2;
|
||||||
|
// fall through
|
||||||
case '1':
|
case '1':
|
||||||
versionFlags |= QGLFormat::OpenGL_Version_3_1;
|
versionFlags |= QGLFormat::OpenGL_Version_3_1;
|
||||||
|
// fall through
|
||||||
case '0':
|
case '0':
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -1353,10 +1361,13 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co
|
|||||||
switch (versionString[2].toLatin1()) {
|
switch (versionString[2].toLatin1()) {
|
||||||
case '3':
|
case '3':
|
||||||
versionFlags |= QGLFormat::OpenGL_Version_4_3;
|
versionFlags |= QGLFormat::OpenGL_Version_4_3;
|
||||||
|
// fall through
|
||||||
case '2':
|
case '2':
|
||||||
versionFlags |= QGLFormat::OpenGL_Version_4_2;
|
versionFlags |= QGLFormat::OpenGL_Version_4_2;
|
||||||
|
// fall through
|
||||||
case '1':
|
case '1':
|
||||||
versionFlags |= QGLFormat::OpenGL_Version_4_1;
|
versionFlags |= QGLFormat::OpenGL_Version_4_1;
|
||||||
|
// fall through
|
||||||
case '0':
|
case '0':
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -635,6 +635,11 @@ static void updateWindow(JNIEnv */*env*/, jobject /*thiz*/)
|
|||||||
if (QGuiApplication::instance() != nullptr) {
|
if (QGuiApplication::instance() != nullptr) {
|
||||||
const auto tlw = QGuiApplication::topLevelWindows();
|
const auto tlw = QGuiApplication::topLevelWindows();
|
||||||
for (QWindow *w : tlw) {
|
for (QWindow *w : tlw) {
|
||||||
|
|
||||||
|
// Skip non-platform windows, e.g., offscreen windows.
|
||||||
|
if (!w->handle())
|
||||||
|
continue;
|
||||||
|
|
||||||
QRect availableGeometry = w->screen()->availableGeometry();
|
QRect availableGeometry = w->screen()->availableGeometry();
|
||||||
if (w->geometry().width() > 0 && w->geometry().height() > 0 && availableGeometry.width() > 0 && availableGeometry.height() > 0)
|
if (w->geometry().width() > 0 && w->geometry().height() > 0 && availableGeometry.width() > 0 && availableGeometry.height() > 0)
|
||||||
QWindowSystemInterface::handleExposeEvent(w, QRegion(QRect(QPoint(), w->geometry().size())));
|
QWindowSystemInterface::handleExposeEvent(w, QRegion(QRect(QPoint(), w->geometry().size())));
|
||||||
|
@ -168,12 +168,13 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
int id = shmget(IPC_PRIVATE, segmentSize, IPC_CREAT | 0600);
|
int id = shmget(IPC_PRIVATE, segmentSize, IPC_CREAT | 0600);
|
||||||
if (id == -1)
|
if (id == -1) {
|
||||||
qWarning("QXcbShmImage: shmget() failed (%d: %s) for size %d (%dx%d)",
|
qWarning("QXcbShmImage: shmget() failed (%d: %s) for size %d (%dx%d)",
|
||||||
errno, strerror(errno), segmentSize, size.width(), size.height());
|
errno, strerror(errno), segmentSize, size.width(), size.height());
|
||||||
else
|
} else {
|
||||||
m_shm_info.shmid = id;
|
m_shm_info.shmaddr = m_xcb_image->data = (quint8 *)shmat(id, 0, 0);
|
||||||
m_shm_info.shmaddr = m_xcb_image->data = (quint8 *)shmat (m_shm_info.shmid, 0, 0);
|
}
|
||||||
|
m_shm_info.shmid = id;
|
||||||
m_shm_info.shmseg = xcb_generate_id(xcb_connection());
|
m_shm_info.shmseg = xcb_generate_id(xcb_connection());
|
||||||
|
|
||||||
const xcb_query_extension_reply_t *shm_reply = xcb_get_extension_data(xcb_connection(), &xcb_shm_id);
|
const xcb_query_extension_reply_t *shm_reply = xcb_get_extension_data(xcb_connection(), &xcb_shm_id);
|
||||||
@ -184,9 +185,10 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
|
|||||||
if (!shm_present || error || id == -1) {
|
if (!shm_present || error || id == -1) {
|
||||||
free(error);
|
free(error);
|
||||||
|
|
||||||
shmdt(m_shm_info.shmaddr);
|
if (id != -1) {
|
||||||
shmctl(m_shm_info.shmid, IPC_RMID, 0);
|
shmdt(m_shm_info.shmaddr);
|
||||||
|
shmctl(m_shm_info.shmid, IPC_RMID, 0);
|
||||||
|
}
|
||||||
m_shm_info.shmaddr = 0;
|
m_shm_info.shmaddr = 0;
|
||||||
|
|
||||||
m_xcb_image->data = (uint8_t *)malloc(segmentSize);
|
m_xcb_image->data = (uint8_t *)malloc(segmentSize);
|
||||||
|
@ -671,6 +671,7 @@ QString QSqlDriver::formatValue(const QSqlField &field, bool trimStrings) const
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// fall through
|
||||||
default:
|
default:
|
||||||
r = field.value().toString();
|
r = field.value().toString();
|
||||||
break;
|
break;
|
||||||
|
@ -2042,10 +2042,12 @@ QString QFileDialog::labelText(DialogLabel label) const
|
|||||||
button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Save);
|
button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Save);
|
||||||
if (button)
|
if (button)
|
||||||
return button->text();
|
return button->text();
|
||||||
|
break;
|
||||||
case Reject:
|
case Reject:
|
||||||
button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Cancel);
|
button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Cancel);
|
||||||
if (button)
|
if (button)
|
||||||
return button->text();
|
return button->text();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
@ -1080,8 +1080,8 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
|
|||||||
painter->setPen(innerLine);
|
painter->setPen(innerLine);
|
||||||
painter->drawRoundedRect(option->rect.adjusted(1, 1, -2, -2), 1, 1);
|
painter->drawRoundedRect(option->rect.adjusted(1, 1, -2, -2), 1, 1);
|
||||||
painter->restore();
|
painter->restore();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case CE_SizeGrip:
|
case CE_SizeGrip:
|
||||||
painter->save();
|
painter->save();
|
||||||
{
|
{
|
||||||
|
@ -213,10 +213,9 @@ QString QCalendarDayValidator::text(const QDate &date, int repeat) const
|
|||||||
return formatNumber(date.day(), 2);
|
return formatNumber(date.day(), 2);
|
||||||
} else if (repeat == 3) {
|
} else if (repeat == 3) {
|
||||||
return m_locale.dayName(date.dayOfWeek(), QLocale::ShortFormat);
|
return m_locale.dayName(date.dayOfWeek(), QLocale::ShortFormat);
|
||||||
} else if (repeat >= 4) {
|
} else /* repeat >= 4 */ {
|
||||||
return m_locale.dayName(date.dayOfWeek(), QLocale::LongFormat);
|
return m_locale.dayName(date.dayOfWeek(), QLocale::LongFormat);
|
||||||
}
|
}
|
||||||
return QString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////
|
//////////////////////////////////
|
||||||
@ -3030,6 +3029,7 @@ bool QCalendarWidget::event(QEvent *event)
|
|||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
case QEvent::LayoutDirectionChange:
|
case QEvent::LayoutDirectionChange:
|
||||||
d->updateButtonIcons();
|
d->updateButtonIcons();
|
||||||
|
break;
|
||||||
case QEvent::LocaleChange:
|
case QEvent::LocaleChange:
|
||||||
d->m_model->setFirstColumnDay(locale().firstDayOfWeek());
|
d->m_model->setFirstColumnDay(locale().firstDayOfWeek());
|
||||||
d->cachedSizeHint = QSize();
|
d->cachedSizeHint = QSize();
|
||||||
|
@ -3168,6 +3168,7 @@ void QComboBox::keyPressEvent(QKeyEvent *e)
|
|||||||
showPopup();
|
showPopup();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case Qt::Key_Enter:
|
case Qt::Key_Enter:
|
||||||
case Qt::Key_Return:
|
case Qt::Key_Return:
|
||||||
case Qt::Key_Escape:
|
case Qt::Key_Escape:
|
||||||
|
@ -2350,7 +2350,9 @@ void QDateTimeEditPrivate::interpret(EmitPolicy ep)
|
|||||||
const QValidator::State state = q->validate(tmp, pos);
|
const QValidator::State state = q->validate(tmp, pos);
|
||||||
if (state != QValidator::Acceptable
|
if (state != QValidator::Acceptable
|
||||||
&& correctionMode == QAbstractSpinBox::CorrectToPreviousValue
|
&& correctionMode == QAbstractSpinBox::CorrectToPreviousValue
|
||||||
&& (state == QValidator::Invalid || !(fieldInfo(currentSectionIndex) & AllowPartial))) {
|
&& (state == QValidator::Invalid
|
||||||
|
|| currentSectionIndex < 0
|
||||||
|
|| !(fieldInfo(currentSectionIndex) & AllowPartial))) {
|
||||||
setValue(value, ep);
|
setValue(value, ep);
|
||||||
updateTimeSpec();
|
updateTimeSpec();
|
||||||
} else {
|
} else {
|
||||||
|
@ -604,16 +604,21 @@ int QToolBarAreaLayoutInfo::distance(const QPoint &pos) const
|
|||||||
case QInternal::LeftDock:
|
case QInternal::LeftDock:
|
||||||
if (pos.y() < rect.bottom())
|
if (pos.y() < rect.bottom())
|
||||||
return pos.x() - rect.right();
|
return pos.x() - rect.right();
|
||||||
|
break;
|
||||||
case QInternal::RightDock:
|
case QInternal::RightDock:
|
||||||
if (pos.y() < rect.bottom())
|
if (pos.y() < rect.bottom())
|
||||||
return rect.left() - pos.x();
|
return rect.left() - pos.x();
|
||||||
|
break;
|
||||||
case QInternal::TopDock:
|
case QInternal::TopDock:
|
||||||
if (pos.x() < rect.right())
|
if (pos.x() < rect.right())
|
||||||
return pos.y() - rect.bottom();
|
return pos.y() - rect.bottom();
|
||||||
|
break;
|
||||||
case QInternal::BottomDock:
|
case QInternal::BottomDock:
|
||||||
if (pos.x() < rect.right())
|
if (pos.x() < rect.right())
|
||||||
return rect.top() - pos.y();
|
return rect.top() - pos.y();
|
||||||
default:
|
break;
|
||||||
|
|
||||||
|
case QInternal::DockCount:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -297,6 +297,8 @@ private slots:
|
|||||||
|
|
||||||
void QTBUG50153_drawImage_assert();
|
void QTBUG50153_drawImage_assert();
|
||||||
|
|
||||||
|
void QTBUG56252();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void fillData();
|
void fillData();
|
||||||
void setPenColor(QPainter& p);
|
void setPenColor(QPainter& p);
|
||||||
@ -5061,6 +5063,23 @@ void tst_QPainter::QTBUG50153_drawImage_assert()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_QPainter::QTBUG56252()
|
||||||
|
{
|
||||||
|
QImage sourceImage(1770, 1477, QImage::Format_RGB32);
|
||||||
|
QImage rotatedImage(1478, 1771, QImage::Format_RGB32);
|
||||||
|
QTransform transformCenter;
|
||||||
|
transformCenter.translate(739.0, 885.5);
|
||||||
|
transformCenter.rotate(270.0);
|
||||||
|
transformCenter.translate(-885.0, -738.5);
|
||||||
|
QPainter painter;
|
||||||
|
painter.begin(&rotatedImage);
|
||||||
|
painter.setTransform(transformCenter);
|
||||||
|
painter.drawImage(QPoint(0, 0),sourceImage);
|
||||||
|
painter.end();
|
||||||
|
|
||||||
|
// If no crash or illegal memory read, all is fine
|
||||||
|
}
|
||||||
|
|
||||||
QTEST_MAIN(tst_QPainter)
|
QTEST_MAIN(tst_QPainter)
|
||||||
|
|
||||||
#include "tst_qpainter.moc"
|
#include "tst_qpainter.moc"
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
[testDragWindow]
|
[testDragWindow]
|
||||||
osx
|
osx
|
||||||
[testMouseEnter]
|
[testMouseEnter]
|
||||||
osx-10.9
|
osx
|
||||||
osx-10.8
|
|
||||||
[testChildDialogInFrontOfModalParent]
|
[testChildDialogInFrontOfModalParent]
|
||||||
osx
|
osx
|
||||||
[testChildWindowInFrontOfStaysOnTopParentWindow]
|
[testChildWindowInFrontOfStaysOnTopParentWindow]
|
||||||
|
@ -2924,6 +2924,9 @@ void tst_QGraphicsView::scrollBarRanges()
|
|||||||
|
|
||||||
if (useStyledPanel && style == QStringLiteral("Macintosh") && platformName == QStringLiteral("cocoa"))
|
if (useStyledPanel && style == QStringLiteral("Macintosh") && platformName == QStringLiteral("cocoa"))
|
||||||
QSKIP("Insignificant on OSX");
|
QSKIP("Insignificant on OSX");
|
||||||
|
|
||||||
|
QScopedPointer<QStyle> stylePtr;
|
||||||
|
|
||||||
QGraphicsScene scene;
|
QGraphicsScene scene;
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.setRenderHint(QPainter::Antialiasing);
|
view.setRenderHint(QPainter::Antialiasing);
|
||||||
@ -2931,9 +2934,10 @@ void tst_QGraphicsView::scrollBarRanges()
|
|||||||
view.setFrameStyle(useStyledPanel ? QFrame::StyledPanel : QFrame::NoFrame);
|
view.setFrameStyle(useStyledPanel ? QFrame::StyledPanel : QFrame::NoFrame);
|
||||||
|
|
||||||
if (style == QString("motif"))
|
if (style == QString("motif"))
|
||||||
view.setStyle(new FauxMotifStyle);
|
stylePtr.reset(new FauxMotifStyle);
|
||||||
else
|
else
|
||||||
view.setStyle(QStyleFactory::create(style));
|
stylePtr.reset(QStyleFactory::create(style));
|
||||||
|
view.setStyle(stylePtr.data());
|
||||||
view.setStyleSheet(" "); // enables style propagation ;-)
|
view.setStyleSheet(" "); // enables style propagation ;-)
|
||||||
|
|
||||||
int adjust = 0;
|
int adjust = 0;
|
||||||
@ -3500,7 +3504,7 @@ void tst_QGraphicsView::task245469_itemsAtPointWithClip()
|
|||||||
static QGraphicsView *createSimpleViewAndScene()
|
static QGraphicsView *createSimpleViewAndScene()
|
||||||
{
|
{
|
||||||
QGraphicsView *view = new QGraphicsView;
|
QGraphicsView *view = new QGraphicsView;
|
||||||
QGraphicsScene *scene = new QGraphicsScene;
|
QGraphicsScene *scene = new QGraphicsScene(view);
|
||||||
view->setScene(scene);
|
view->setScene(scene);
|
||||||
|
|
||||||
view->setBackgroundBrush(Qt::blue);
|
view->setBackgroundBrush(Qt::blue);
|
||||||
@ -3628,7 +3632,7 @@ void tst_QGraphicsView::moveItemWhileScrolling()
|
|||||||
MoveItemScrollView()
|
MoveItemScrollView()
|
||||||
{
|
{
|
||||||
setWindowFlags(Qt::X11BypassWindowManagerHint);
|
setWindowFlags(Qt::X11BypassWindowManagerHint);
|
||||||
setScene(new QGraphicsScene(0, 0, 1000, 1000));
|
setScene(new QGraphicsScene(0, 0, 1000, 1000, this));
|
||||||
rect = scene()->addRect(0, 0, 10, 10);
|
rect = scene()->addRect(0, 0, 10, 10);
|
||||||
rect->setPos(50, 50);
|
rect->setPos(50, 50);
|
||||||
rect->setPen(QPen(Qt::black, 0));
|
rect->setPen(QPen(Qt::black, 0));
|
||||||
@ -3694,7 +3698,7 @@ void tst_QGraphicsView::centerOnDirtyItem()
|
|||||||
toplevel.setWindowFlags(view.windowFlags() | Qt::WindowStaysOnTopHint);
|
toplevel.setWindowFlags(view.windowFlags() | Qt::WindowStaysOnTopHint);
|
||||||
view.resize(200, 200);
|
view.resize(200, 200);
|
||||||
|
|
||||||
QGraphicsScene *scene = new QGraphicsScene;
|
QGraphicsScene *scene = new QGraphicsScene(&view);
|
||||||
view.setScene(scene);
|
view.setScene(scene);
|
||||||
view.setSceneRect(-1000, -1000, 2000, 2000);
|
view.setSceneRect(-1000, -1000, 2000, 2000);
|
||||||
|
|
||||||
|
@ -10425,14 +10425,13 @@ public slots:
|
|||||||
|
|
||||||
bool eventFilter(QObject *o, QEvent *e)
|
bool eventFilter(QObject *o, QEvent *e)
|
||||||
{
|
{
|
||||||
if (modal && modal->button && o == modal->button) {
|
switch (e->type()) {
|
||||||
switch (e->type()) {
|
case QEvent::Enter:
|
||||||
case QEvent::Enter:
|
if (modal && modal->button && o == modal->button)
|
||||||
enters++;
|
enters++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return QDialog::eventFilter(o, e);
|
return QDialog::eventFilter(o, e);
|
||||||
}
|
}
|
||||||
|
@ -760,22 +760,22 @@ void tst_QXmlSimpleReader::dtdRecursionLimit()
|
|||||||
QVERIFY(file.open(QIODevice::ReadOnly));
|
QVERIFY(file.open(QIODevice::ReadOnly));
|
||||||
QXmlSimpleReader xmlReader;
|
QXmlSimpleReader xmlReader;
|
||||||
{
|
{
|
||||||
QXmlInputSource *source = new QXmlInputSource(&file);
|
QXmlInputSource source(&file);
|
||||||
TestHandler handler;
|
TestHandler handler;
|
||||||
xmlReader.setDeclHandler(&handler);
|
xmlReader.setDeclHandler(&handler);
|
||||||
xmlReader.setErrorHandler(&handler);
|
xmlReader.setErrorHandler(&handler);
|
||||||
QVERIFY(!xmlReader.parse(source));
|
QVERIFY(!xmlReader.parse(&source));
|
||||||
}
|
}
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
file.setFileName("xmldocs/1-levels-nested-dtd.xml");
|
file.setFileName("xmldocs/1-levels-nested-dtd.xml");
|
||||||
QVERIFY(file.open(QIODevice::ReadOnly));
|
QVERIFY(file.open(QIODevice::ReadOnly));
|
||||||
{
|
{
|
||||||
QXmlInputSource *source = new QXmlInputSource(&file);
|
QXmlInputSource source(&file);
|
||||||
TestHandler handler;
|
TestHandler handler;
|
||||||
xmlReader.setDeclHandler(&handler);
|
xmlReader.setDeclHandler(&handler);
|
||||||
xmlReader.setErrorHandler(&handler);
|
xmlReader.setErrorHandler(&handler);
|
||||||
QVERIFY(!xmlReader.parse(source));
|
QVERIFY(!xmlReader.parse(&source));
|
||||||
// The error wasn't because of the recursion limit being reached,
|
// The error wasn't because of the recursion limit being reached,
|
||||||
// it was because the document is not valid.
|
// it was because the document is not valid.
|
||||||
QVERIFY(handler.recursionCount < 2);
|
QVERIFY(handler.recursionCount < 2);
|
||||||
@ -785,11 +785,11 @@ void tst_QXmlSimpleReader::dtdRecursionLimit()
|
|||||||
file.setFileName("xmldocs/internal-entity-polynomial-attribute.xml");
|
file.setFileName("xmldocs/internal-entity-polynomial-attribute.xml");
|
||||||
QVERIFY(file.open(QIODevice::ReadOnly));
|
QVERIFY(file.open(QIODevice::ReadOnly));
|
||||||
{
|
{
|
||||||
QXmlInputSource *source = new QXmlInputSource(&file);
|
QXmlInputSource source(&file);
|
||||||
TestHandler handler;
|
TestHandler handler;
|
||||||
xmlReader.setDeclHandler(&handler);
|
xmlReader.setDeclHandler(&handler);
|
||||||
xmlReader.setErrorHandler(&handler);
|
xmlReader.setErrorHandler(&handler);
|
||||||
QVERIFY(!xmlReader.parse(source));
|
QVERIFY(!xmlReader.parse(&source));
|
||||||
QCOMPARE(handler.recursionCount, 2);
|
QCOMPARE(handler.recursionCount, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user