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!
|
||||
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;
|
||||
|
@ -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) {
|
||||
|
@ -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";
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
typedef QMultiHash<quint64, QExplicitlySharedDataPointer<const CacheInfo> > QGradientColorTableHash;
|
||||
|
||||
public:
|
||||
typedef QPair<const QRgb *, const QRgba64 *> ColorBufferPair;
|
||||
|
||||
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;
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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())));
|
||||
|
@ -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);
|
||||
|
@ -671,6 +671,7 @@ QString QSqlDriver::formatValue(const QSqlField &field, bool trimStrings) const
|
||||
break;
|
||||
}
|
||||
}
|
||||
// fall through
|
||||
default:
|
||||
r = field.value().toString();
|
||||
break;
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
{
|
||||
|
@ -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();
|
||||
|
@ -3168,6 +3168,7 @@ void QComboBox::keyPressEvent(QKeyEvent *e)
|
||||
showPopup();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case Qt::Key_Enter:
|
||||
case Qt::Key_Return:
|
||||
case Qt::Key_Escape:
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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"
|
||||
|
@ -2,8 +2,7 @@
|
||||
[testDragWindow]
|
||||
osx
|
||||
[testMouseEnter]
|
||||
osx-10.9
|
||||
osx-10.8
|
||||
osx
|
||||
[testChildDialogInFrontOfModalParent]
|
||||
osx
|
||||
[testChildWindowInFrontOfStaysOnTopParentWindow]
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user