Merge remote-tracking branch 'origin/5.11' into dev

Change-Id: Ib58433da04bffb5dfab5486b80f17f39cc4145fa
This commit is contained in:
Qt Forward Merge Bot 2018-05-05 01:00:54 +02:00
commit ba2b7b8e33
18 changed files with 232 additions and 234 deletions

View File

@ -85,7 +85,7 @@ Introduction
encourage you to use the following text: encourage you to use the following text:
""" """
Portions of this software are copyright © <year> The FreeType Portions of this software are copyright © <year> The FreeType
Project (www.freetype.org). All rights reserved. Project (www.freetype.org). All rights reserved.
""" """

View File

@ -355,12 +355,21 @@ public abstract class QtLoader {
destinationFile.createNewFile(); destinationFile.createNewFile();
AssetManager assetsManager = m_context.getAssets(); AssetManager assetsManager = m_context.getAssets();
InputStream inputStream = assetsManager.open(source); InputStream inputStream = null;
OutputStream outputStream = new FileOutputStream(destinationFile); OutputStream outputStream = null;
copyFile(inputStream, outputStream); try {
inputStream = assetsManager.open(source);
outputStream = new FileOutputStream(destinationFile);
copyFile(inputStream, outputStream);
catch (Exception e) {
e.printStackTrace();
} finally {
if (inputStream != null)
inputStream.close();
inputStream.close(); if (outputStream != null)
outputStream.close(); outputStream.close();
}
} }
private static void createBundledBinary(String source, String destination) private static void createBundledBinary(String source, String destination)
@ -377,12 +386,21 @@ public abstract class QtLoader {
destinationFile.createNewFile(); destinationFile.createNewFile();
InputStream inputStream = new FileInputStream(source); InputStream inputStream = null;
OutputStream outputStream = new FileOutputStream(destinationFile); OutputStream outputStream = null;
copyFile(inputStream, outputStream); try {
inputStream = new FileInputStream(source);
outputStream = new FileOutputStream(destinationFile);
copyFile(inputStream, outputStream);
catch (Exception e) {
e.printStackTrace();
} finally {
if (inputStream != null)
inputStream.close();
inputStream.close(); if (outputStream != null)
outputStream.close(); outputStream.close();
}
} }
private boolean cleanCacheIfNecessary(String pluginsPrefix, long packageVersion) private boolean cleanCacheIfNecessary(String pluginsPrefix, long packageVersion)
@ -391,12 +409,15 @@ public abstract class QtLoader {
long cacheVersion = 0; long cacheVersion = 0;
if (versionFile.exists() && versionFile.canRead()) { if (versionFile.exists() && versionFile.canRead()) {
DataInputStream inputStream = null;
try { try {
DataInputStream inputStream = new DataInputStream(new FileInputStream(versionFile)); inputStream = new DataInputStream(new FileInputStream(versionFile));
cacheVersion = inputStream.readLong(); cacheVersion = inputStream.readLong();
inputStream.close();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally {
if (inputStream != null)
inputStream.close();
} }
} }
@ -431,9 +452,16 @@ public abstract class QtLoader {
versionFile.createNewFile(); versionFile.createNewFile();
DataOutputStream outputStream = new DataOutputStream(new FileOutputStream(versionFile)); DataOutputStream outputStream = null;
outputStream.writeLong(packageVersion); try {
outputStream.close(); outputStream = new DataOutputStream(new FileOutputStream(versionFile));
outputStream.writeLong(packageVersion);
catch (Exception e) {
e.printStackTrace();
} finally {
if (outputStream != null)
outputStream.close();
}
} }
{ {

View File

@ -87,6 +87,7 @@ public:
QT_DEPRECATED inline void registerTimer(int timerId, int interval, QObject *object) QT_DEPRECATED inline void registerTimer(int timerId, int interval, QObject *object)
{ registerTimer(timerId, interval, Qt::CoarseTimer, object); } { registerTimer(timerId, interval, Qt::CoarseTimer, object); }
#endif #endif
// ### Qt6: change interval range to qint64 (or use QDeadlineTimer)
int registerTimer(int interval, Qt::TimerType timerType, QObject *object); int registerTimer(int interval, Qt::TimerType timerType, QObject *object);
virtual void registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object) = 0; virtual void registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object) = 0;
virtual bool unregisterTimer(int timerId) = 0; virtual bool unregisterTimer(int timerId) = 0;

View File

@ -328,7 +328,7 @@ int Value::usedStorage(const Base *b) const
bool Value::isValid(const Base *b) const bool Value::isValid(const Base *b) const
{ {
int offset = 0; int offset = -1;
switch (type) { switch (type) {
case QJsonValue::Double: case QJsonValue::Double:
if (latinOrIntValue) if (latinOrIntValue)
@ -345,14 +345,12 @@ bool Value::isValid(const Base *b) const
break; break;
} }
if (!offset) if (offset == -1)
return true; return true;
if (offset + sizeof(uint) > b->tableOffset) if (offset + sizeof(uint) > b->tableOffset || offset < (int)sizeof(Base))
return false; return false;
int s = usedStorage(b); int s = usedStorage(b);
if (!s)
return true;
if (s < 0 || s > (int)b->tableOffset - offset) if (s < 0 || s > (int)b->tableOffset - offset)
return false; return false;
if (type == QJsonValue::Array) if (type == QJsonValue::Array)

View File

@ -450,7 +450,7 @@ static inline void copyString(char *dest, const QString &str, bool compress)
/* /*
Base is the base class for both Object and Array. Both classe work more or less the same way. Base is the base class for both Object and Array. Both classes work more or less the same way.
The class starts with a header (defined by the struct below), then followed by data (the data for The class starts with a header (defined by the struct below), then followed by data (the data for
values in the Array case and Entry's (see below) for objects. values in the Array case and Entry's (see below) for objects.

View File

@ -210,6 +210,9 @@ QJsonDocument QJsonDocument::fromRawData(const char *data, int size, DataValidat
return QJsonDocument(); return QJsonDocument();
} }
if (size < (int)(sizeof(QJsonPrivate::Header) + sizeof(QJsonPrivate::Base)))
return QJsonDocument();
QJsonPrivate::Data *d = new QJsonPrivate::Data((char *)data, size); QJsonPrivate::Data *d = new QJsonPrivate::Data((char *)data, size);
d->ownsData = false; d->ownsData = false;

View File

@ -219,9 +219,8 @@
// AVX intrinsics // AVX intrinsics
# if defined(__AVX__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC)) # if defined(__AVX__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC))
// AES, PCLMULQDQ instructions: // AES, PCLMULQDQ instructions:
// All processors that support AVX support AES, PCLMULQDQ // All processors that support AVX support PCLMULQDQ
// (but neither MSVC nor the Intel compiler define these macros) // (but neither MSVC nor the Intel compiler define this macro)
# define __AES__ 1
# define __PCLMUL__ 1 # define __PCLMUL__ 1
# endif # endif

View File

@ -1433,7 +1433,7 @@ bool QSslSocketBackendPrivate::importPkcs12(QIODevice *device,
if (!key->d->fromEVP_PKEY(pkey)) { if (!key->d->fromEVP_PKEY(pkey)) {
qCWarning(lcSsl, "Unable to convert private key"); qCWarning(lcSsl, "Unable to convert private key");
q_OPENSSL_sk_pop_free(reinterpret_cast<OPENSSL_STACK *>(ca), q_OPENSSL_sk_pop_free(reinterpret_cast<OPENSSL_STACK *>(ca),
reinterpret_cast<void (*)(void *)>(q_OPENSSL_sk_free)); reinterpret_cast<void (*)(void *)>(q_X509_free));
q_X509_free(x509); q_X509_free(x509);
q_EVP_PKEY_free(pkey); q_EVP_PKEY_free(pkey);
q_PKCS12_free(p12); q_PKCS12_free(p12);
@ -1448,8 +1448,6 @@ bool QSslSocketBackendPrivate::importPkcs12(QIODevice *device,
*caCertificates = QSslSocketBackendPrivate::STACKOFX509_to_QSslCertificates(ca); *caCertificates = QSslSocketBackendPrivate::STACKOFX509_to_QSslCertificates(ca);
// Clean up // Clean up
// TODO: verify ASAP, in the past we had sk_pop_free with q_OPENSSL_sk_free
// which seems to be blatantly wrong and even crashes with 1.1.
q_OPENSSL_sk_pop_free(reinterpret_cast<OPENSSL_STACK *>(ca), q_OPENSSL_sk_pop_free(reinterpret_cast<OPENSSL_STACK *>(ca),
reinterpret_cast<void (*)(void *)>(q_X509_free)); reinterpret_cast<void (*)(void *)>(q_X509_free));

View File

@ -437,16 +437,15 @@ QFontEngine *QCoreTextFontDatabaseEngineFactory<QFontEngineFT>::fontEngine(const
{ {
CTFontDescriptorRef descriptor = static_cast<CTFontDescriptorRef>(usrPtr); CTFontDescriptorRef descriptor = static_cast<CTFontDescriptorRef>(usrPtr);
if (NSURL *url = descriptorAttribute<NSURL>(descriptor, kCTFontURLAttribute)) { if (NSValue *fontDataValue = descriptorAttribute<NSValue>(descriptor, (CFStringRef)kQtFontDataAttribute)) {
QByteArray *fontData = static_cast<QByteArray *>(fontDataValue.pointerValue);
return QFontEngineFT::create(*fontData, fontDef.pixelSize,
static_cast<QFont::HintingPreference>(fontDef.hintingPreference));
} else if (NSURL *url = descriptorAttribute<NSURL>(descriptor, kCTFontURLAttribute)) {
Q_ASSERT(url.fileURL); Q_ASSERT(url.fileURL);
QFontEngine::FaceId faceId; QFontEngine::FaceId faceId;
faceId.filename = QString::fromNSString(url.path).toUtf8(); faceId.filename = QString::fromNSString(url.path).toUtf8();
return QFontEngineFT::create(fontDef, faceId); return QFontEngineFT::create(fontDef, faceId);
} else if (NSValue *fontDataValue = descriptorAttribute<NSValue>(descriptor, (CFStringRef)kQtFontDataAttribute)) {
QByteArray *fontData = static_cast<QByteArray *>(fontDataValue.pointerValue);
return QFontEngineFT::create(*fontData, fontDef.pixelSize,
static_cast<QFont::HintingPreference>(fontDef.hintingPreference));
} }
Q_UNREACHABLE(); Q_UNREACHABLE();
} }

View File

@ -48,179 +48,68 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
Qt::Key keyTranslator( int key ) int qtKeyForPrivateUseQnxKey( int key )
{ {
switch (key) { switch (key) {
case KEYCODE_PAUSE: case KEYCODE_PAUSE: return Qt::Key_Pause;
return Qt::Key_Pause; case KEYCODE_SCROLL_LOCK: return Qt::Key_ScrollLock;
case KEYCODE_PRINT: return Qt::Key_Print;
case KEYCODE_SCROLL_LOCK: case KEYCODE_SYSREQ: return Qt::Key_SysReq;
return Qt::Key_ScrollLock;
case KEYCODE_PRINT:
return Qt::Key_Print;
case KEYCODE_SYSREQ:
return Qt::Key_SysReq;
// case KEYCODE_BREAK: // case KEYCODE_BREAK:
case KEYCODE_ESCAPE: return Qt::Key_Escape;
case KEYCODE_ESCAPE: case KEYCODE_BACKSPACE: return Qt::Key_Backspace;
return Qt::Key_Escape; case KEYCODE_TAB: return Qt::Key_Tab;
case KEYCODE_BACK_TAB: return Qt::Key_Backtab;
case KEYCODE_BACKSPACE: case KEYCODE_RETURN: return Qt::Key_Return;
return Qt::Key_Backspace; case KEYCODE_CAPS_LOCK: return Qt::Key_CapsLock;
case KEYCODE_LEFT_SHIFT: return Qt::Key_Shift;
case KEYCODE_TAB: case KEYCODE_RIGHT_SHIFT: return Qt::Key_Shift;
return Qt::Key_Tab; case KEYCODE_LEFT_CTRL: return Qt::Key_Control;
case KEYCODE_RIGHT_CTRL: return Qt::Key_Control;
case KEYCODE_BACK_TAB: case KEYCODE_LEFT_ALT: return Qt::Key_Alt;
return Qt::Key_Backtab; case KEYCODE_RIGHT_ALT: return Qt::Key_Alt;
case KEYCODE_MENU: return Qt::Key_Menu;
case KEYCODE_RETURN: case KEYCODE_LEFT_HYPER: return Qt::Key_Hyper_L;
return Qt::Key_Return; case KEYCODE_RIGHT_HYPER: return Qt::Key_Hyper_R;
case KEYCODE_INSERT: return Qt::Key_Insert;
case KEYCODE_CAPS_LOCK: case KEYCODE_HOME: return Qt::Key_Home;
return Qt::Key_CapsLock; case KEYCODE_PG_UP: return Qt::Key_PageUp;
case KEYCODE_DELETE: return Qt::Key_Delete;
case KEYCODE_LEFT_SHIFT: case KEYCODE_END: return Qt::Key_End;
case KEYCODE_RIGHT_SHIFT: case KEYCODE_PG_DOWN: return Qt::Key_PageDown;
return Qt::Key_Shift; case KEYCODE_LEFT: return Qt::Key_Left;
case KEYCODE_RIGHT: return Qt::Key_Right;
case KEYCODE_LEFT_CTRL: case KEYCODE_UP: return Qt::Key_Up;
case KEYCODE_RIGHT_CTRL: case KEYCODE_DOWN: return Qt::Key_Down;
return Qt::Key_Control; case KEYCODE_NUM_LOCK: return Qt::Key_NumLock;
case KEYCODE_KP_PLUS: return Qt::Key_Plus;
case KEYCODE_LEFT_ALT: case KEYCODE_KP_MINUS: return Qt::Key_Minus;
case KEYCODE_RIGHT_ALT: case KEYCODE_KP_MULTIPLY: return Qt::Key_Asterisk;
return Qt::Key_Alt; case KEYCODE_KP_DIVIDE: return Qt::Key_Slash;
case KEYCODE_KP_ENTER: return Qt::Key_Enter;
case KEYCODE_MENU: case KEYCODE_KP_HOME: return Qt::Key_Home;
return Qt::Key_Menu; case KEYCODE_KP_UP: return Qt::Key_Up;
case KEYCODE_KP_PG_UP: return Qt::Key_PageUp;
case KEYCODE_LEFT_HYPER: case KEYCODE_KP_LEFT: return Qt::Key_Left;
return Qt::Key_Hyper_L; case KEYCODE_KP_FIVE: return Qt::Key_5;
case KEYCODE_KP_RIGHT: return Qt::Key_Right;
case KEYCODE_RIGHT_HYPER: case KEYCODE_KP_END: return Qt::Key_End;
return Qt::Key_Hyper_R; case KEYCODE_KP_DOWN: return Qt::Key_Down;
case KEYCODE_KP_PG_DOWN: return Qt::Key_PageDown;
case KEYCODE_INSERT: case KEYCODE_KP_INSERT: return Qt::Key_Insert;
return Qt::Key_Insert; case KEYCODE_KP_DELETE: return Qt::Key_Delete;
case KEYCODE_F1: return Qt::Key_F1;
case KEYCODE_HOME: case KEYCODE_F2: return Qt::Key_F2;
return Qt::Key_Home; case KEYCODE_F3: return Qt::Key_F3;
case KEYCODE_F4: return Qt::Key_F4;
case KEYCODE_PG_UP: case KEYCODE_F5: return Qt::Key_F5;
return Qt::Key_PageUp; case KEYCODE_F6: return Qt::Key_F6;
case KEYCODE_F7: return Qt::Key_F7;
case KEYCODE_DELETE: case KEYCODE_F8: return Qt::Key_F8;
return Qt::Key_Delete; case KEYCODE_F9: return Qt::Key_F9;
case KEYCODE_F10: return Qt::Key_F10;
case KEYCODE_END: case KEYCODE_F11: return Qt::Key_F11;
return Qt::Key_End; case KEYCODE_F12: return Qt::Key_F12;
case KEYCODE_PG_DOWN:
return Qt::Key_PageDown;
case KEYCODE_LEFT:
return Qt::Key_Left;
case KEYCODE_RIGHT:
return Qt::Key_Right;
case KEYCODE_UP:
return Qt::Key_Up;
case KEYCODE_DOWN:
return Qt::Key_Down;
case KEYCODE_NUM_LOCK:
return Qt::Key_NumLock;
case KEYCODE_KP_PLUS:
return Qt::Key_Plus;
case KEYCODE_KP_MINUS:
return Qt::Key_Minus;
case KEYCODE_KP_MULTIPLY:
return Qt::Key_Asterisk;
case KEYCODE_KP_DIVIDE:
return Qt::Key_Slash;
case KEYCODE_KP_ENTER:
return Qt::Key_Enter;
case KEYCODE_KP_HOME:
return Qt::Key_Home;
case KEYCODE_KP_UP:
return Qt::Key_Up;
case KEYCODE_KP_PG_UP:
return Qt::Key_PageUp;
case KEYCODE_KP_LEFT:
return Qt::Key_Left;
// Is this right?
case KEYCODE_KP_FIVE:
return Qt::Key_5;
case KEYCODE_KP_RIGHT:
return Qt::Key_Right;
case KEYCODE_KP_END:
return Qt::Key_End;
case KEYCODE_KP_DOWN:
return Qt::Key_Down;
case KEYCODE_KP_PG_DOWN:
return Qt::Key_PageDown;
case KEYCODE_KP_INSERT:
return Qt::Key_Insert;
case KEYCODE_KP_DELETE:
return Qt::Key_Delete;
case KEYCODE_F1:
return Qt::Key_F1;
case KEYCODE_F2:
return Qt::Key_F2;
case KEYCODE_F3:
return Qt::Key_F3;
case KEYCODE_F4:
return Qt::Key_F4;
case KEYCODE_F5:
return Qt::Key_F5;
case KEYCODE_F6:
return Qt::Key_F6;
case KEYCODE_F7:
return Qt::Key_F7;
case KEYCODE_F8:
return Qt::Key_F8;
case KEYCODE_F9:
return Qt::Key_F9;
case KEYCODE_F10:
return Qt::Key_F10;
case KEYCODE_F11:
return Qt::Key_F11;
case KEYCODE_F12:
return Qt::Key_F12;
// See keycodes.h for more, but these are all the basics. And printables are already included. // See keycodes.h for more, but these are all the basics. And printables are already included.
@ -231,7 +120,21 @@ Qt::Key keyTranslator( int key )
break; break;
} }
return Qt::Key_Escape; return Qt::Key_unknown;
}
QString keyStringForPrivateUseQnxKey( int key )
{
switch (key) {
case KEYCODE_ESCAPE: return QStringLiteral("\x1B");
case KEYCODE_BACKSPACE: return QStringLiteral("\b");
case KEYCODE_TAB: return QStringLiteral("\t");
case KEYCODE_RETURN: return QStringLiteral("\r");
case KEYCODE_DELETE: return QStringLiteral("\x7F");
case KEYCODE_KP_ENTER: return QStringLiteral("\r");
}
return QString();
} }
bool isKeypadKey( int key ) bool isKeypadKey( int key )

View File

@ -58,6 +58,37 @@
#define qScreenEventDebug QT_NO_QDEBUG_MACRO #define qScreenEventDebug QT_NO_QDEBUG_MACRO
#endif #endif
static int qtKey(int virtualKey, QChar::Category category)
{
if (Q_UNLIKELY(category == QChar::Other_NotAssigned))
return virtualKey;
else if (category == QChar::Other_PrivateUse)
return qtKeyForPrivateUseQnxKey(virtualKey);
else
return QChar::toUpper(virtualKey);
}
static QString keyString(int sym, QChar::Category category)
{
if (Q_UNLIKELY(category == QChar::Other_NotAssigned)) {
return QString();
} else if (category == QChar::Other_PrivateUse) {
return keyStringForPrivateUseQnxKey(sym);
} else {
uint ucs4_sym = sym;
return QString::fromUcs4(&ucs4_sym, 1);
}
}
static QString capKeyString(int cap, int modifiers, int key)
{
if (cap >= 0x20 && cap <= 0x0ff) {
if (modifiers & KEYMOD_CTRL)
return QChar((int)(key & 0x3f));
}
return QString();
}
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
QQnxScreenEventHandler::QQnxScreenEventHandler(QQnxIntegration *integration) QQnxScreenEventHandler::QQnxScreenEventHandler(QQnxIntegration *integration)
@ -154,6 +185,13 @@ void QQnxScreenEventHandler::injectKeyboardEvent(int flags, int sym, int modifie
{ {
Q_UNUSED(scan); Q_UNUSED(scan);
if (!(flags & KEY_CAP_VALID))
return;
// Correct erroneous information.
if ((flags & KEY_SYM_VALID) && sym == static_cast<int>(0xFFFFFFFF))
flags &= ~(KEY_SYM_VALID);
Qt::KeyboardModifiers qtMod = Qt::NoModifier; Qt::KeyboardModifiers qtMod = Qt::NoModifier;
if (modifiers & KEYMOD_SHIFT) if (modifiers & KEYMOD_SHIFT)
qtMod |= Qt::ShiftModifier; qtMod |= Qt::ShiftModifier;
@ -161,37 +199,20 @@ void QQnxScreenEventHandler::injectKeyboardEvent(int flags, int sym, int modifie
qtMod |= Qt::ControlModifier; qtMod |= Qt::ControlModifier;
if (modifiers & KEYMOD_ALT) if (modifiers & KEYMOD_ALT)
qtMod |= Qt::AltModifier; qtMod |= Qt::AltModifier;
if (isKeypadKey(cap))
qtMod |= Qt::KeypadModifier;
// determine event type
QEvent::Type type = (flags & KEY_DOWN) ? QEvent::KeyPress : QEvent::KeyRelease; QEvent::Type type = (flags & KEY_DOWN) ? QEvent::KeyPress : QEvent::KeyRelease;
// Check if the key cap is valid int virtualKey = (flags & KEY_SYM_VALID) ? sym : cap;
if (flags & KEY_CAP_VALID) { QChar::Category category = QChar::category(virtualKey);
Qt::Key key; int key = qtKey(virtualKey, category);
QString keyStr; QString keyStr = (flags & KEY_SYM_VALID) ? keyString(sym, category) :
capKeyString(cap, modifiers, key);
if (cap >= 0x20 && cap <= 0x0ff) { QWindowSystemInterface::handleExtendedKeyEvent(QGuiApplication::focusWindow(), type, key, qtMod,
key = Qt::Key(std::toupper(cap)); // Qt expects the CAP to be upper case. scan, virtualKey, modifiers, keyStr);
qScreenEventDebug() << "Qt key t=" << type << ", k=" << key << ", s=" << keyStr;
if ( qtMod & Qt::ControlModifier ) {
keyStr = QChar((int)(key & 0x3f));
} else {
if (flags & KEY_SYM_VALID)
keyStr = QChar(sym);
}
} else if ((cap > 0x0ff && cap < UNICODE_PRIVATE_USE_AREA_FIRST) || cap > UNICODE_PRIVATE_USE_AREA_LAST) {
key = (Qt::Key)cap;
keyStr = QChar(sym);
} else {
if (isKeypadKey(cap))
qtMod |= Qt::KeypadModifier; // Is this right?
key = keyTranslator(cap);
}
QWindowSystemInterface::handleExtendedKeyEvent(QGuiApplication::focusWindow(), type, key, qtMod,
scan, sym, modifiers, keyStr);
qScreenEventDebug() << "Qt key t=" << type << ", k=" << key << ", s=" << keyStr;
}
} }
void QQnxScreenEventHandler::setScreenEventThread(QQnxScreenEventThread *eventThread) void QQnxScreenEventHandler::setScreenEventThread(QQnxScreenEventThread *eventThread)

View File

@ -858,7 +858,7 @@ void QDialogButtonBoxPrivate::_q_handleButtonClicked()
if (!guard) if (!guard)
return; return;
switch (buttonRole) { switch (QPlatformDialogHelper::ButtonRole(buttonRole)) {
case QPlatformDialogHelper::AcceptRole: case QPlatformDialogHelper::AcceptRole:
case QPlatformDialogHelper::YesRole: case QPlatformDialogHelper::YesRole:
emit q->accepted(); emit q->accepted();

View File

@ -1863,6 +1863,7 @@ void tst_QtJson::invalidBinaryData()
QFile file(files.at(i).filePath()); QFile file(files.at(i).filePath());
file.open(QIODevice::ReadOnly); file.open(QIODevice::ReadOnly);
QByteArray bytes = file.readAll(); QByteArray bytes = file.readAll();
bytes.squeeze();
QJsonDocument document = QJsonDocument::fromRawData(bytes.constData(), bytes.size()); QJsonDocument document = QJsonDocument::fromRawData(bytes.constData(), bytes.size());
QVERIFY(document.isNull()); QVERIFY(document.isNull());
} }

View File

@ -0,0 +1,42 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
ce:db:31:28:45:c4:05:40
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd
Validity
Not Before: Aug 4 09:53:41 2010 GMT
Not After : Aug 29 09:53:41 2051 GMT
Subject: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public-Key: (1024 bit)
Modulus:
00:cd:aa:db:6f:d6:34:c9:a7:f1:c0:be:e4:41:18:
19:e2:02:c9:22:e6:a7:d5:ba:03:2e:9e:28:7a:f4:
5f:1a:77:5f:77:a9:11:3b:8f:7e:f0:2e:c6:9e:eb:
3a:d9:12:d7:c1:0c:51:e8:24:52:3f:23:c3:42:0c:
11:c6:f2:1c:a1:42:fe:b4:c2:69:83:ad:f7:70:b1:
18:15:cc:20:28:62:30:f0:2c:15:e6:33:19:af:c3:
eb:1c:c0:91:f7:11:68:94:50:f8:49:37:08:32:d7:
3e:75:df:a3:bc:69:00:15:de:cd:87:0f:5c:02:6b:
82:c8:01:7d:6a:f0:1d:dc:73
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
8A:6E:19:E7:97:9B:8F:D9:7F:B3:BB:01:4F:E8:6A:2F:52:95:0D:D9
X509v3 Authority Key Identifier:
keyid:8A:6E:19:E7:97:9B:8F:D9:7F:B3:BB:01:4F:E8:6A:2F:52:95:0D:D9
X509v3 Basic Constraints:
CA:TRUE
Signature Algorithm: sha1WithRSAEncryption
a1:74:8e:5d:36:96:2c:05:7e:ea:66:cc:2e:68:c7:3d:93:dc:
8c:a3:11:ad:b5:7e:6e:d0:04:c4:09:bd:0a:f9:39:3b:97:d7:
f0:bb:0c:09:7b:83:fe:bf:87:b0:47:e8:94:b7:aa:9c:79:ad:
71:9e:b7:c4:99:98:6f:1d:38:32:f8:a3:75:38:c4:e5:e7:37:
37:21:ec:7b:50:8b:15:b0:97:1e:17:9c:50:17:3c:c1:df:94:
55:fb:60:2e:50:40:d1:ea:23:c6:3c:21:6f:97:8c:06:16:a5:
82:72:c1:63:14:64:86:eb:d7:ff:72:f6:09:f5:6d:e6:04:13:
7a:6a

View File

@ -922,6 +922,10 @@ void tst_QSslCertificate::toText()
QVERIFY(f101c.open(QIODevice::ReadOnly | QFile::Text)); QVERIFY(f101c.open(QIODevice::ReadOnly | QFile::Text));
QByteArray txt101c = f101c.readAll(); QByteArray txt101c = f101c.readAll();
QFile f111(testDataDir + "more-certificates/cert-large-expiration-date.txt.1.1.1");
QVERIFY(f111.open(QIODevice::ReadOnly | QFile::Text));
QByteArray txt111 = f111.readAll();
QString txtcert = cert.toText(); QString txtcert = cert.toText();
#ifdef QT_NO_OPENSSL #ifdef QT_NO_OPENSSL
@ -930,7 +934,8 @@ void tst_QSslCertificate::toText()
QVERIFY(QString::fromLatin1(txt098) == txtcert || QVERIFY(QString::fromLatin1(txt098) == txtcert ||
QString::fromLatin1(txt100) == txtcert || QString::fromLatin1(txt100) == txtcert ||
QString::fromLatin1(txt101) == txtcert || QString::fromLatin1(txt101) == txtcert ||
QString::fromLatin1(txt101c) == txtcert ); QString::fromLatin1(txt101c) == txtcert ||
QString::fromLatin1(txt111) == txtcert );
} }
void tst_QSslCertificate::multipleCommonNames() void tst_QSslCertificate::multipleCommonNames()