summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp8
-rw-r--r--src/android/java/src/org/qtproject/qt5/android/bindings/QtActivityLoader.java2
-rw-r--r--src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java2
-rw-r--r--src/dbus/qdbusabstractinterface.cpp14
-rw-r--r--src/gui/image/qiconloader_p.h17
-rw-r--r--src/gui/image/qimage.cpp2
-rw-r--r--src/gui/kernel/qplatformscreen.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_p.h2
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp53
-rw-r--r--src/opengl/qgl.cpp11
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp5
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp16
-rw-r--r--src/sql/kernel/qsqldriver.cpp1
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp2
-rw-r--r--src/widgets/styles/qfusionstyle.cpp2
-rw-r--r--src/widgets/widgets/qcalendarwidget.cpp4
-rw-r--r--src/widgets/widgets/qcombobox.cpp1
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp4
-rw-r--r--src/widgets/widgets/qtoolbararealayout.cpp7
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp19
-rw-r--r--tests/auto/other/macnativeevents/BLACKLIST3
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp14
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp13
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp12
24 files changed, 148 insertions, 70 deletions
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
index 30dde281e8..82977db5e7 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
@@ -156,12 +156,14 @@ static inline void positionCluster(HB_ShaperItem *item, int gfrom, int glast)
// ### wrong in rtl context!
case HB_Combining_BelowLeft:
p.y += offset;
+ // fall through
case HB_Combining_BelowLeftAttached:
p.x += attachmentRect.x - markMetrics.x;
p.y += (attachmentRect.y + attachmentRect.height) - markMetrics.y;
break;
case HB_Combining_Below:
p.y += offset;
+ // fall through
case HB_Combining_BelowAttached:
p.x += attachmentRect.x - markMetrics.x;
p.y += (attachmentRect.y + attachmentRect.height) - markMetrics.y;
@@ -170,28 +172,33 @@ static inline void positionCluster(HB_ShaperItem *item, int gfrom, int glast)
break;
case HB_Combining_BelowRight:
p.y += offset;
+ // fall through
case HB_Combining_BelowRightAttached:
p.x += attachmentRect.x + attachmentRect.width - markMetrics.width - markMetrics.x;
p.y += attachmentRect.y + attachmentRect.height - markMetrics.y;
break;
case HB_Combining_Left:
p.x -= offset;
+ // fall through
case HB_Combining_LeftAttached:
break;
case HB_Combining_Right:
p.x += offset;
+ // fall through
case HB_Combining_RightAttached:
break;
case HB_Combining_DoubleAbove:
// ### wrong in RTL context!
case HB_Combining_AboveLeft:
p.y -= offset;
+ // fall through
case HB_Combining_AboveLeftAttached:
p.x += attachmentRect.x - markMetrics.x;
p.y += attachmentRect.y - markMetrics.y - markMetrics.height;
break;
case HB_Combining_Above:
p.y -= offset;
+ // fall through
case HB_Combining_AboveAttached:
p.x += attachmentRect.x - markMetrics.x;
p.y += attachmentRect.y - markMetrics.y - markMetrics.height;
@@ -200,6 +207,7 @@ static inline void positionCluster(HB_ShaperItem *item, int gfrom, int glast)
break;
case HB_Combining_AboveRight:
p.y -= offset;
+ // fall through
case HB_Combining_AboveRightAttached:
p.x += attachmentRect.x + attachmentRect.width - markMetrics.x - markMetrics.width;
p.y += attachmentRect.y - markMetrics.y - markMetrics.height;
diff --git a/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivityLoader.java b/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivityLoader.java
index 2494035c60..ce0ce3abc7 100644
--- a/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivityLoader.java
+++ b/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivityLoader.java
@@ -66,7 +66,7 @@ public class QtActivityLoader extends QtLoader {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
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);
m_activity.startActivityForResult(intent, MINISTRO_INSTALL_REQUEST_CODE);
} catch (Exception e) {
diff --git a/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java b/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java
index d281cb0996..aeac2448bb 100644
--- a/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java
+++ b/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java
@@ -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 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 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_MESSAGE_KEY = "error.message";
diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp
index eb57ad1816..c90173db76 100644
--- a/src/dbus/qdbusabstractinterface.cpp
+++ b/src/dbus/qdbusabstractinterface.cpp
@@ -761,18 +761,25 @@ QDBusMessage QDBusAbstractInterface::call(QDBus::CallMode mode, const QString &m
switch (count) {
case 8:
argList.prepend(arg8);
+ // fall through
case 7:
argList.prepend(arg7);
+ // fall through
case 6:
argList.prepend(arg6);
+ // fall through
case 5:
argList.prepend(arg5);
+ // fall through
case 4:
argList.prepend(arg4);
+ // fall through
case 3:
argList.prepend(arg3);
+ // fall through
case 2:
argList.prepend(arg2);
+ // fall through
case 1:
argList.prepend(arg1);
}
@@ -819,18 +826,25 @@ QDBusPendingCall QDBusAbstractInterface::asyncCall(const QString &method, const
switch (count) {
case 8:
argList.prepend(arg8);
+ // fall through
case 7:
argList.prepend(arg7);
+ // fall through
case 6:
argList.prepend(arg6);
+ // fall through
case 5:
argList.prepend(arg5);
+ // fall through
case 4:
argList.prepend(arg4);
+ // fall through
case 3:
argList.prepend(arg3);
+ // fall through
case 2:
argList.prepend(arg2);
+ // fall through
case 1:
argList.prepend(arg1);
}
diff --git a/src/gui/image/qiconloader_p.h b/src/gui/image/qiconloader_p.h
index 0945add2fb..c3421b2047 100644
--- a/src/gui/image/qiconloader_p.h
+++ b/src/gui/image/qiconloader_p.h
@@ -95,7 +95,6 @@ public:
QIcon::State state) = 0;
QString filename;
QIconDirInfo dir;
- static int count;
};
struct ScalableEntry : public QIconLoaderEngineEntry
@@ -124,18 +123,18 @@ public:
QIconLoaderEngine(const QString& iconName = QString());
~QIconLoaderEngine();
- void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state);
- QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state);
- QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state);
- QIconEngine *clone() const;
- bool read(QDataStream &in);
- bool write(QDataStream &out) const;
+ 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) Q_DECL_OVERRIDE;
+ QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
+ QIconEngine *clone() const Q_DECL_OVERRIDE;
+ bool read(QDataStream &in) Q_DECL_OVERRIDE;
+ bool write(QDataStream &out) const Q_DECL_OVERRIDE;
private:
- QString key() const;
+ QString key() const Q_DECL_OVERRIDE;
bool hasIcon() const;
void ensureLoaded();
- void virtual_hook(int id, void *data);
+ void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
QIconLoaderEngineEntry *entryForSize(const QSize &size);
QIconLoaderEngine(const QIconLoaderEngine &other);
QThemeIconInfo m_info;
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 64673d44b8..f3cc48cf33 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -5026,7 +5026,7 @@ static Q_CONSTEXPR QPixelFormat pixelformats[] = {
/*ALPHA USAGE*/ QPixelFormat::IgnoresAlpha,
/*ALPHA POSITION*/ QPixelFormat::AtBeginning,
/*PREMULTIPLIED*/ QPixelFormat::NotPremultiplied,
- /*INTERPRETATION*/ QPixelFormat::UnsignedInteger,
+ /*INTERPRETATION*/ QPixelFormat::UnsignedByte,
/*BYTE ORDER*/ QPixelFormat::CurrentSystemEndian),
//QImage::Format_RGB444:
QPixelFormat(QPixelFormat::RGB,
diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp
index 3c1552c31e..1d519e84f9 100644
--- a/src/gui/kernel/qplatformscreen.cpp
+++ b/src/gui/kernel/qplatformscreen.cpp
@@ -342,6 +342,10 @@ void QPlatformScreen::resizeMaximizedWindows()
for (int i = 0; i < windows.size(); ++i) {
QWindow *w = windows.at(i);
+ // Skip non-platform windows, e.g., offscreen windows.
+ if (!w->handle())
+ continue;
+
if (platformScreenForWindow(w) != this)
continue;
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index fa3e6396ec..f13cdbaec0 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -335,6 +335,8 @@ struct QSpanData
QGradientData gradient;
QTextureData texture;
};
+ QExplicitlySharedDataPointer<const QSharedData> cachedGradient;
+
void init(QRasterBuffer *rb, const QRasterPaintEngine *pe);
void setup(const QBrush &brush, int alpha, QPainter::CompositionMode compositionMode);
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 0edd9125a3..df96a993e3 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -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(),
clippedTargetRect.width(), clippedTargetRect.height()).toRect();
+ clippedSourceRect = clippedSourceRect.intersected(img.rect());
+
uint dbpl = d->rasterBuffer->bytesPerLine();
uint sbpl = img.bytesPerLine();
@@ -4147,7 +4149,8 @@ void QRasterBuffer::flushToARGBImage(QImage *target) const
class QGradientCache
{
- struct CacheInfo
+public:
+ struct CacheInfo : public QSharedData
{
inline CacheInfo(QGradientStops s, int op, QGradient::InterpolationMode mode) :
stops(qMove(s)), opacity(op), interpolationMode(mode) {}
@@ -4158,12 +4161,9 @@ class QGradientCache
QGradient::InterpolationMode interpolationMode;
};
- typedef QMultiHash<quint64, CacheInfo> QGradientColorTableHash;
-
-public:
- typedef QPair<const QRgb *, const QRgba64 *> ColorBufferPair;
+ typedef QMultiHash<quint64, QExplicitlySharedDataPointer<const CacheInfo> > QGradientColorTableHash;
- inline ColorBufferPair getBuffer(const QGradient &gradient, int opacity) {
+ inline QExplicitlySharedDataPointer<const CacheInfo> getBuffer(const QGradient &gradient, int opacity) {
quint64 hash_val = 0;
const QGradientStops stops = gradient.stops();
@@ -4177,10 +4177,9 @@ public:
return addCacheElement(hash_val, gradient, opacity);
else {
do {
- const CacheInfo &cache_info = it.value();
- if (cache_info.stops == stops && cache_info.opacity == opacity && cache_info.interpolationMode == gradient.interpolationMode())
- return qMakePair(reinterpret_cast<const QRgb *>(cache_info.buffer32),
- reinterpret_cast<const QRgba64 *>(cache_info.buffer64));
+ const QExplicitlySharedDataPointer<const CacheInfo> &cache_info = it.value();
+ if (cache_info->stops == stops && cache_info->opacity == opacity && cache_info->interpolationMode == gradient.interpolationMode())
+ return cache_info;
++it;
} while (it != cache.constEnd() && it.key() == hash_val);
// 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,
QRgba64 *colorTable,
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()) {
// may remove more than 1, but OK
cache.erase(cache.begin() + (qrand() % maxCacheSize()));
}
- CacheInfo cache_entry(gradient.stops(), opacity, gradient.interpolationMode());
- generateGradientColorTable(gradient, cache_entry.buffer64, paletteSize(), opacity);
+ QExplicitlySharedDataPointer<CacheInfo> cache_entry(new CacheInfo (gradient.stops(), opacity, gradient.interpolationMode()));
+ generateGradientColorTable(gradient, cache_entry->buffer64, paletteSize(), opacity);
for (int i = 0; i < GRADIENT_STOPTABLE_SIZE; ++i)
- cache_entry.buffer32[i] = cache_entry.buffer64[i].toArgb32();
- CacheInfo &cache_value = cache.insert(hash_val, cache_entry).value();
- return qMakePair(reinterpret_cast<const QRgb *>(cache_value.buffer32),
- reinterpret_cast<const QRgba64 *>(cache_value.buffer64));
+ cache_entry->buffer32[i] = cache_entry->buffer64[i].toArgb32();
+ return cache.insert(hash_val, cache_entry).value();
}
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)
{
Qt::BrushStyle brushStyle = qbrush_style(brush);
+ cachedGradient.reset();
switch (brushStyle) {
case Qt::SolidPattern: {
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());
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
- QGradientCache::ColorBufferPair colorBuffers = qt_gradient_cache()->getBuffer(*g, alpha);
- gradient.colorTable64 = colorBuffers.second;
- gradient.colorTable32 = colorBuffers.first;
+ QExplicitlySharedDataPointer<const QGradientCache::CacheInfo> cacheInfo = qt_gradient_cache()->getBuffer(*g, alpha);
+ cachedGradient = cacheInfo;
+ gradient.colorTable32 = cacheInfo->buffer32;
+ gradient.colorTable64 = cacheInfo->buffer64;
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());
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
- QGradientCache::ColorBufferPair colorBuffers = qt_gradient_cache()->getBuffer(*g, alpha);
- gradient.colorTable64 = colorBuffers.second;
- gradient.colorTable32 = colorBuffers.first;
+ QExplicitlySharedDataPointer<const QGradientCache::CacheInfo> cacheInfo = qt_gradient_cache()->getBuffer(*g, alpha);
+ cachedGradient = cacheInfo;
+ gradient.colorTable32 = cacheInfo->buffer32;
+ gradient.colorTable64 = cacheInfo->buffer64;
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());
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
- QGradientCache::ColorBufferPair colorBuffers = qt_gradient_cache()->getBuffer(*g, alpha);
- gradient.colorTable64 = colorBuffers.second;
- gradient.colorTable32 = colorBuffers.first;
+ QExplicitlySharedDataPointer<const QGradientCache::CacheInfo> cacheInfo = qt_gradient_cache()->getBuffer(*g, alpha);
+ cachedGradient = cacheInfo;
+ gradient.colorTable32 = cacheInfo->buffer32;
+ gradient.colorTable64 = cacheInfo->buffer64;
gradient.spread = QGradient::RepeatSpread;
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 6b0501e8d0..e64a29d1a4 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1293,14 +1293,19 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co
switch (versionString[2].toLatin1()) {
case '5':
versionFlags |= QGLFormat::OpenGL_Version_1_5;
+ // fall through
case '4':
versionFlags |= QGLFormat::OpenGL_Version_1_4;
+ // fall through
case '3':
versionFlags |= QGLFormat::OpenGL_Version_1_3;
+ // fall through
case '2':
versionFlags |= QGLFormat::OpenGL_Version_1_2;
+ // fall through
case '1':
versionFlags |= QGLFormat::OpenGL_Version_1_1;
+ // fall through
default:
break;
}
@@ -1325,10 +1330,13 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co
switch (versionString[2].toLatin1()) {
case '3':
versionFlags |= QGLFormat::OpenGL_Version_3_3;
+ // fall through
case '2':
versionFlags |= QGLFormat::OpenGL_Version_3_2;
+ // fall through
case '1':
versionFlags |= QGLFormat::OpenGL_Version_3_1;
+ // fall through
case '0':
break;
default:
@@ -1353,10 +1361,13 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co
switch (versionString[2].toLatin1()) {
case '3':
versionFlags |= QGLFormat::OpenGL_Version_4_3;
+ // fall through
case '2':
versionFlags |= QGLFormat::OpenGL_Version_4_2;
+ // fall through
case '1':
versionFlags |= QGLFormat::OpenGL_Version_4_1;
+ // fall through
case '0':
break;
default:
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index c79198d7fe..2614bb52a8 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -635,6 +635,11 @@ static void updateWindow(JNIEnv */*env*/, jobject /*thiz*/)
if (QGuiApplication::instance() != nullptr) {
const auto tlw = QGuiApplication::topLevelWindows();
for (QWindow *w : tlw) {
+
+ // Skip non-platform windows, e.g., offscreen windows.
+ if (!w->handle())
+ continue;
+
QRect availableGeometry = w->screen()->availableGeometry();
if (w->geometry().width() > 0 && w->geometry().height() > 0 && availableGeometry.width() > 0 && availableGeometry.height() > 0)
QWindowSystemInterface::handleExposeEvent(w, QRegion(QRect(QPoint(), w->geometry().size())));
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index a999fb0aa2..ce9e5d926e 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -168,12 +168,13 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
return;
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)",
errno, strerror(errno), segmentSize, size.width(), size.height());
- else
- m_shm_info.shmid = id;
- m_shm_info.shmaddr = m_xcb_image->data = (quint8 *)shmat (m_shm_info.shmid, 0, 0);
+ } else {
+ m_shm_info.shmaddr = m_xcb_image->data = (quint8 *)shmat(id, 0, 0);
+ }
+ m_shm_info.shmid = id;
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);
@@ -184,9 +185,10 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
if (!shm_present || error || id == -1) {
free(error);
- shmdt(m_shm_info.shmaddr);
- shmctl(m_shm_info.shmid, IPC_RMID, 0);
-
+ if (id != -1) {
+ shmdt(m_shm_info.shmaddr);
+ shmctl(m_shm_info.shmid, IPC_RMID, 0);
+ }
m_shm_info.shmaddr = 0;
m_xcb_image->data = (uint8_t *)malloc(segmentSize);
diff --git a/src/sql/kernel/qsqldriver.cpp b/src/sql/kernel/qsqldriver.cpp
index ad5207cf6e..bf98f82087 100644
--- a/src/sql/kernel/qsqldriver.cpp
+++ b/src/sql/kernel/qsqldriver.cpp
@@ -671,6 +671,7 @@ QString QSqlDriver::formatValue(const QSqlField &field, bool trimStrings) const
break;
}
}
+ // fall through
default:
r = field.value().toString();
break;
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index fc360d8381..12616e14f6 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -2042,10 +2042,12 @@ QString QFileDialog::labelText(DialogLabel label) const
button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Save);
if (button)
return button->text();
+ break;
case Reject:
button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Cancel);
if (button)
return button->text();
+ break;
}
return QString();
}
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index 3a39441785..1e98b1775a 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -1080,8 +1080,8 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
painter->setPen(innerLine);
painter->drawRoundedRect(option->rect.adjusted(1, 1, -2, -2), 1, 1);
painter->restore();
- return;
}
+ break;
case CE_SizeGrip:
painter->save();
{
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp
index caeabb660b..a8c031ac1b 100644
--- a/src/widgets/widgets/qcalendarwidget.cpp
+++ b/src/widgets/widgets/qcalendarwidget.cpp
@@ -213,10 +213,9 @@ QString QCalendarDayValidator::text(const QDate &date, int repeat) const
return formatNumber(date.day(), 2);
} else if (repeat == 3) {
return m_locale.dayName(date.dayOfWeek(), QLocale::ShortFormat);
- } else if (repeat >= 4) {
+ } else /* repeat >= 4 */ {
return m_locale.dayName(date.dayOfWeek(), QLocale::LongFormat);
}
- return QString();
}
//////////////////////////////////
@@ -3030,6 +3029,7 @@ bool QCalendarWidget::event(QEvent *event)
switch (event->type()) {
case QEvent::LayoutDirectionChange:
d->updateButtonIcons();
+ break;
case QEvent::LocaleChange:
d->m_model->setFirstColumnDay(locale().firstDayOfWeek());
d->cachedSizeHint = QSize();
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index af178ce8f5..728d243ce3 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -3168,6 +3168,7 @@ void QComboBox::keyPressEvent(QKeyEvent *e)
showPopup();
return;
}
+ break;
case Qt::Key_Enter:
case Qt::Key_Return:
case Qt::Key_Escape:
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index 54094de765..7fe569a042 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -2350,7 +2350,9 @@ void QDateTimeEditPrivate::interpret(EmitPolicy ep)
const QValidator::State state = q->validate(tmp, pos);
if (state != QValidator::Acceptable
&& correctionMode == QAbstractSpinBox::CorrectToPreviousValue
- && (state == QValidator::Invalid || !(fieldInfo(currentSectionIndex) & AllowPartial))) {
+ && (state == QValidator::Invalid
+ || currentSectionIndex < 0
+ || !(fieldInfo(currentSectionIndex) & AllowPartial))) {
setValue(value, ep);
updateTimeSpec();
} else {
diff --git a/src/widgets/widgets/qtoolbararealayout.cpp b/src/widgets/widgets/qtoolbararealayout.cpp
index 05564bb6b1..0c57d9251d 100644
--- a/src/widgets/widgets/qtoolbararealayout.cpp
+++ b/src/widgets/widgets/qtoolbararealayout.cpp
@@ -604,16 +604,21 @@ int QToolBarAreaLayoutInfo::distance(const QPoint &pos) const
case QInternal::LeftDock:
if (pos.y() < rect.bottom())
return pos.x() - rect.right();
+ break;
case QInternal::RightDock:
if (pos.y() < rect.bottom())
return rect.left() - pos.x();
+ break;
case QInternal::TopDock:
if (pos.x() < rect.right())
return pos.y() - rect.bottom();
+ break;
case QInternal::BottomDock:
if (pos.x() < rect.right())
return rect.top() - pos.y();
- default:
+ break;
+
+ case QInternal::DockCount:
break;
}
return -1;
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 8a97a9261f..bb7e2dca35 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -297,6 +297,8 @@ private slots:
void QTBUG50153_drawImage_assert();
+ void QTBUG56252();
+
private:
void fillData();
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)
#include "tst_qpainter.moc"
diff --git a/tests/auto/other/macnativeevents/BLACKLIST b/tests/auto/other/macnativeevents/BLACKLIST
index 4129868022..3e68ba0cf0 100644
--- a/tests/auto/other/macnativeevents/BLACKLIST
+++ b/tests/auto/other/macnativeevents/BLACKLIST
@@ -2,8 +2,7 @@
[testDragWindow]
osx
[testMouseEnter]
-osx-10.9
-osx-10.8
+osx
[testChildDialogInFrontOfModalParent]
osx
[testChildWindowInFrontOfStaysOnTopParentWindow]
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 1df9a9434c..5b6f219d11 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -2924,6 +2924,9 @@ void tst_QGraphicsView::scrollBarRanges()
if (useStyledPanel && style == QStringLiteral("Macintosh") && platformName == QStringLiteral("cocoa"))
QSKIP("Insignificant on OSX");
+
+ QScopedPointer<QStyle> stylePtr;
+
QGraphicsScene scene;
QGraphicsView view(&scene);
view.setRenderHint(QPainter::Antialiasing);
@@ -2931,9 +2934,10 @@ void tst_QGraphicsView::scrollBarRanges()
view.setFrameStyle(useStyledPanel ? QFrame::StyledPanel : QFrame::NoFrame);
if (style == QString("motif"))
- view.setStyle(new FauxMotifStyle);
+ stylePtr.reset(new FauxMotifStyle);
else
- view.setStyle(QStyleFactory::create(style));
+ stylePtr.reset(QStyleFactory::create(style));
+ view.setStyle(stylePtr.data());
view.setStyleSheet(" "); // enables style propagation ;-)
int adjust = 0;
@@ -3500,7 +3504,7 @@ void tst_QGraphicsView::task245469_itemsAtPointWithClip()
static QGraphicsView *createSimpleViewAndScene()
{
QGraphicsView *view = new QGraphicsView;
- QGraphicsScene *scene = new QGraphicsScene;
+ QGraphicsScene *scene = new QGraphicsScene(view);
view->setScene(scene);
view->setBackgroundBrush(Qt::blue);
@@ -3628,7 +3632,7 @@ void tst_QGraphicsView::moveItemWhileScrolling()
MoveItemScrollView()
{
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->setPos(50, 50);
rect->setPen(QPen(Qt::black, 0));
@@ -3694,7 +3698,7 @@ void tst_QGraphicsView::centerOnDirtyItem()
toplevel.setWindowFlags(view.windowFlags() | Qt::WindowStaysOnTopHint);
view.resize(200, 200);
- QGraphicsScene *scene = new QGraphicsScene;
+ QGraphicsScene *scene = new QGraphicsScene(&view);
view.setScene(scene);
view.setSceneRect(-1000, -1000, 2000, 2000);
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 272e6ef02f..5a00b0dad9 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -10425,14 +10425,13 @@ public slots:
bool eventFilter(QObject *o, QEvent *e)
{
- if (modal && modal->button && o == modal->button) {
- switch (e->type()) {
- case QEvent::Enter:
+ switch (e->type()) {
+ case QEvent::Enter:
+ if (modal && modal->button && o == modal->button)
enters++;
- break;
- default:
- break;
- }
+ break;
+ default:
+ break;
}
return QDialog::eventFilter(o, e);
}
diff --git a/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp b/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp
index 5d5e00ac42..b591112bd1 100644
--- a/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp
+++ b/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp
@@ -760,22 +760,22 @@ void tst_QXmlSimpleReader::dtdRecursionLimit()
QVERIFY(file.open(QIODevice::ReadOnly));
QXmlSimpleReader xmlReader;
{
- QXmlInputSource *source = new QXmlInputSource(&file);
+ QXmlInputSource source(&file);
TestHandler handler;
xmlReader.setDeclHandler(&handler);
xmlReader.setErrorHandler(&handler);
- QVERIFY(!xmlReader.parse(source));
+ QVERIFY(!xmlReader.parse(&source));
}
file.close();
file.setFileName("xmldocs/1-levels-nested-dtd.xml");
QVERIFY(file.open(QIODevice::ReadOnly));
{
- QXmlInputSource *source = new QXmlInputSource(&file);
+ QXmlInputSource source(&file);
TestHandler handler;
xmlReader.setDeclHandler(&handler);
xmlReader.setErrorHandler(&handler);
- QVERIFY(!xmlReader.parse(source));
+ QVERIFY(!xmlReader.parse(&source));
// The error wasn't because of the recursion limit being reached,
// it was because the document is not valid.
QVERIFY(handler.recursionCount < 2);
@@ -785,11 +785,11 @@ void tst_QXmlSimpleReader::dtdRecursionLimit()
file.setFileName("xmldocs/internal-entity-polynomial-attribute.xml");
QVERIFY(file.open(QIODevice::ReadOnly));
{
- QXmlInputSource *source = new QXmlInputSource(&file);
+ QXmlInputSource source(&file);
TestHandler handler;
xmlReader.setDeclHandler(&handler);
xmlReader.setErrorHandler(&handler);
- QVERIFY(!xmlReader.parse(source));
+ QVERIFY(!xmlReader.parse(&source));
QCOMPARE(handler.recursionCount, 2);
}
}