Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.6' into 5.7
Browse files Browse the repository at this point in the history
Change-Id: Ibd81cd1df4a0650d93fcb556a57be90be2e1f569
  • Loading branch information
ediosyncratic committed Jul 4, 2016
2 parents 840729a + b7744e0 commit b5695bd
Show file tree
Hide file tree
Showing 33 changed files with 240 additions and 121 deletions.
2 changes: 1 addition & 1 deletion doc/global/externalsites/external-resources.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
*/

/*!
\externalpage http://code.google.com/p/angleproject/
\externalpage https://chromium.googlesource.com/angle/angle/+/master/README.md
\title ANGLE
*/

Expand Down
2 changes: 1 addition & 1 deletion examples/network/torrent/connectionmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ QByteArray ConnectionManager::clientId() const
// Generate peer id
int startupTime = int(QDateTime::currentDateTime().toTime_t());

id += QString::asprintf("-QT%04x-", (QT_VERSION % 0xffff00) >> 8).toLatin1();
id += QString::asprintf("-QT%04x-", QT_VERSION >> 8).toLatin1();
id += QByteArray::number(startupTime, 10);
id += QByteArray(20 - id.size(), '-');
}
Expand Down
2 changes: 1 addition & 1 deletion mkspecs/common/clang.conf
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG

# Wrapper tools that understand .o/.a files with LLVM bytecode instead of machine code
QMAKE_AR_LTCG = llvm-ar cqs
QMAKE_NM_LTCG = gcc-nm -P
QMAKE_NM_LTCG = llvm-nm -P
QMAKE_RANLIB_LTCG = true # No need to run, since llvm-ar has "s"
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</Properties>

<Dependencies>
<TargetDeviceFamily Name=\"Windows.Universal\" MinVersion=\"10.0.10240.0\" MaxVersionTested=\"10.0.10586.0\" />$${WINRT_MANIFEST.dependencies}
<TargetDeviceFamily Name=\"Windows.Universal\" MinVersion=\"10.0.10586.0\" MaxVersionTested=\"10.0.10586.0\" />$${WINRT_MANIFEST.dependencies}
</Dependencies>

<Resources>
Expand Down
3 changes: 3 additions & 0 deletions mkspecs/netbsd-g++/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ QMAKE_LIBDIR_X11 = /usr/X11R7/lib
QMAKE_INCDIR_OPENGL = /usr/X11R7/include
QMAKE_LIBDIR_OPENGL = /usr/X11R7/lib

# NetBSD requires rpath to be used for all lib dirs, see http://www.netbsd.org/docs/elf.html
QMAKE_RPATHDIR += $$QMAKE_LIBDIR $$QMAKE_LIBDIR_X11

include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
load(qt_config)
1 change: 0 additions & 1 deletion qmake/library/qmakeevaluator.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ class QMAKE_EXPORT QMakeEvaluator
void setTemplate();

ProStringList split_value_list(const QString &vals, const ProFile *source = 0);
ProStringList expandVariableReferences(const ProString &value, int *pos = 0, bool joined = false);
ProStringList expandVariableReferences(const ushort *&tokPtr, int sizeHint = 0, bool joined = false);

QString currentFileName() const;
Expand Down
2 changes: 1 addition & 1 deletion src/angle/README.qt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This is the ANGLE project from:

http://code.google.com/p/angleproject/
https://chromium.googlesource.com/angle/angle/+/master/README.md

The upstream version used here can be found in:

Expand Down
2 changes: 1 addition & 1 deletion src/corelib/io/qdir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ QString QDir::filePath(const QString &fileName) const
{
const QDirPrivate* d = d_ptr.constData();
if (isAbsolutePath(fileName))
return QString(fileName);
return fileName;

QString ret = d->dirEntry.filePath();
if (!fileName.isEmpty()) {
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/io/qsettings_winrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static IApplicationDataContainer *subContainer(IApplicationDataContainer *parent
if (FAILED(hr))
return 0;

while (SUCCEEDED(S_OK) && current) {
while (SUCCEEDED(hr) && current) {
ComPtr<ContainerItem> item;
hr = iterator->get_Current(&item);
if (FAILED(hr))
Expand Down
10 changes: 6 additions & 4 deletions src/corelib/io/qurl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -984,10 +984,12 @@ inline bool QUrlPrivate::setScheme(const QString &value, int len, bool doSetErro
needsLowercasing = i;
continue;
}
if (p[i] >= '0' && p[i] <= '9' && i > 0)
continue;
if (p[i] == '+' || p[i] == '-' || p[i] == '.')
continue;
if (i) {
if (p[i] >= '0' && p[i] <= '9')
continue;
if (p[i] == '+' || p[i] == '-' || p[i] == '.')
continue;
}

// found something else
// don't call setError needlessly:
Expand Down
12 changes: 5 additions & 7 deletions src/corelib/json/qjsondocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,16 +357,14 @@ QByteArray QJsonDocument::toJson(JsonFormat format) const
#endif

/*!
Parses a UTF-8 encoded JSON document and creates a QJsonDocument
Parses \a json as a UTF-8 encoded JSON document, and creates a QJsonDocument
from it.
\a json contains the json document to be parsed.
Returns a valid (non-null) QJsonDocument if the parsing succeeds. If it fails,
the returned document will be null, and the optional \a error variable will contain
further details about the error.
The optional \a error variable can be used to pass in a QJsonParseError data
structure that will contain information about possible errors encountered during
parsing.
\sa toJson(), QJsonParseError
\sa toJson(), QJsonParseError, isNull()
*/
QJsonDocument QJsonDocument::fromJson(const QByteArray &json, QJsonParseError *error)
{
Expand Down
4 changes: 4 additions & 0 deletions src/corelib/kernel/qcore_unix_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
#include <errno.h>
#include <fcntl.h>

#if !defined(QT_POSIX_IPC) && !defined(QT_NO_SHAREDMEMORY) && !defined(Q_OS_ANDROID)
# include <sys/ipc.h>
#endif

#if defined(Q_OS_VXWORKS)
# include <ioLib.h>
#endif
Expand Down
6 changes: 4 additions & 2 deletions src/corelib/kernel/qeventloop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,10 @@ int QEventLoop::exec(ProcessEventsFlags flags)
{
if (exceptionCaught) {
qWarning("Qt has caught an exception thrown from an event handler. Throwing\n"
"exceptions from an event handler is not supported in Qt. You must\n"
"reimplement QApplication::notify() and catch all exceptions there.\n");
"exceptions from an event handler is not supported in Qt.\n"
"You must not let any exception whatsoever propagate through Qt code.\n"
"If that is not possible, in Qt 5 you must at least reimplement\n"
"QCoreApplication::notify() and catch all exceptions there.\n");
}
locker.relock();
QEventLoop *eventLoop = d->threadData->eventLoops.pop();
Expand Down
16 changes: 13 additions & 3 deletions src/corelib/tools/qdatetime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2721,7 +2721,7 @@ qint64 QDateTimePrivate::toMSecsSinceEpoch() const

case Qt::TimeZone:
#ifdef QT_BOOTSTRAPPED
break;
return 0;
#else
return zoneMSecsToEpochMSecs(m_msecs, m_timeZone);
#endif
Expand Down Expand Up @@ -4782,7 +4782,12 @@ QDataStream &operator>>(QDataStream &in, QDate &date)

QDataStream &operator<<(QDataStream &out, const QTime &time)
{
return out << quint32(time.mds);
if (out.version() >= QDataStream::Qt_4_0) {
return out << quint32(time.mds);
} else {
// Qt3 had no support for reading -1, QTime() was valid and serialized as 0
return out << quint32(time.isNull() ? 0 : time.mds);
}
}

/*!
Expand All @@ -4797,7 +4802,12 @@ QDataStream &operator>>(QDataStream &in, QTime &time)
{
quint32 ds;
in >> ds;
time.mds = int(ds);
if (in.version() >= QDataStream::Qt_4_0) {
time.mds = int(ds);
} else {
// Qt3 would write 0 for a null time
time.mds = (ds == 0) ? QTime::NullTime : int(ds);
}
return in;
}

Expand Down
5 changes: 1 addition & 4 deletions src/network/socket/qnativesocketengine_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -902,10 +902,7 @@ qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxS
if (cmsgptr->cmsg_level == IPPROTO_IP && cmsgptr->cmsg_type == IP_RECVIF
&& cmsgptr->cmsg_len >= CMSG_LEN(sizeof(sockaddr_dl))) {
sockaddr_dl *sdl = reinterpret_cast<sockaddr_dl *>(CMSG_DATA(cmsgptr));
# if defined(Q_OS_OPENBSD)
# define LLINDEX(s) ((s)->sdl_index)
# endif
header->ifindex = LLINDEX(sdl);
header->ifindex = sdl->sdl_index;
}
# endif
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/network/ssl/qsslsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
QSslSocket establishes a secure, encrypted TCP connection you can
use for transmitting encrypted data. It can operate in both client
and server mode, and it supports modern SSL protocols, including
SSLv3 and TLSv1_0. By default, QSslSocket uses TLSv1_0, but you can
SSL 3 and TLS 1.2. By default, QSslSocket uses only SSL protocols
which are considered to be secure (QSsl::SecureProtocols), but you can
change the SSL protocol by calling setProtocol() as long as you do
it before the handshake has started.
Expand Down
9 changes: 6 additions & 3 deletions src/network/ssl/qsslsocket_mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ void QSslSocketBackendPrivate::transmit()

if (connectionEncrypted && !writeBuffer.isEmpty()) {
qint64 totalBytesWritten = 0;
while (writeBuffer.nextDataBlockSize() > 0) {
while (writeBuffer.nextDataBlockSize() > 0 && context) {
const size_t nextDataBlockSize = writeBuffer.nextDataBlockSize();
size_t writtenBytes = 0;
const OSStatus err = SSLWrite(context, writeBuffer.readPointer(), nextDataBlockSize, &writtenBytes);
Expand Down Expand Up @@ -652,7 +652,7 @@ void QSslSocketBackendPrivate::transmit()

if (connectionEncrypted) {
QVarLengthArray<char, 4096> data;
while (true) {
while (context) {
size_t readBytes = 0;
data.resize(4096);
const OSStatus err = SSLRead(context, data.data(), data.size(), &readBytes);
Expand Down Expand Up @@ -1296,7 +1296,10 @@ bool QSslSocketBackendPrivate::verifyPeerTrust()
// report errors
if (!errors.isEmpty() && !canIgnoreVerify) {
sslErrors = errors;
if (!checkSslErrors())
// checkSslErrors unconditionally emits sslErrors:
// a user's slot can abort/close/disconnect on this
// signal, so we also test the socket's state:
if (!checkSslErrors() || q->state() != QAbstractSocket::ConnectedState)
return false;
} else {
sslErrors.clear();
Expand Down
7 changes: 6 additions & 1 deletion src/plugins/platforms/windows/qwindowscontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ void QWindowsContext::setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiA
qCDebug(lcQpaWindows) << __FUNCTION__ << dpiAwareness;
if (QWindowsContext::shcoredll.isValid()) {
const HRESULT hr = QWindowsContext::shcoredll.setProcessDpiAwareness(dpiAwareness);
if (FAILED(hr)) {
// E_ACCESSDENIED means set externally (MSVC manifest or external app loading Qt plugin).
// Silence warning in that case unless debug is enabled.
if (FAILED(hr) && (hr != E_ACCESSDENIED || lcQpaWindows().isDebugEnabled())) {
qWarning().noquote().nospace() << "SetProcessDpiAwareness("
<< dpiAwareness << ") failed: " << QWindowsContext::comErrorString(hr)
<< ", using " << QWindowsContext::processDpiAwareness();
Expand Down Expand Up @@ -849,6 +851,9 @@ QByteArray QWindowsContext::comErrorString(HRESULT hr)
case E_UNEXPECTED:
result += QByteArrayLiteral("E_UNEXPECTED");
break;
case E_ACCESSDENIED:
result += QByteArrayLiteral("E_ACCESSDENIED");
break;
case CO_E_ALREADYINITIALIZED:
result += QByteArrayLiteral("CO_E_ALREADYINITIALIZED");
break;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/platforms/windows/qwindowseglcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ QSurfaceFormat QWindowsEGLStaticContext::formatFromConfig(EGLDisplay display, EG
\list
\o Install the Direct X SDK
\o Checkout and build ANGLE (SVN repository) as explained here:
\l{http://code.google.com/p/angleproject/wiki/DevSetup}{ANGLE-Project}.
\l{https://chromium.googlesource.com/angle/angle/+/master/README.md}
When building for 64bit, de-activate the "WarnAsError" option
in every project file (as otherwise integer conversion
warnings will break the build).
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/platforms/winrt/qwinrtdrag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@ static HRESULT qt_drop(IInspectable *sender, ABI::Windows::UI::Xaml::IDragEventA
class QtDragEventHandler##name : public IDragEventHandler \
{ \
public: \
virtual HRESULT STDMETHODCALLTYPE Invoke(IInspectable *sender, \
ABI::Windows::UI::Xaml::IDragEventArgs *e) \
STDMETHODIMP Invoke(IInspectable *sender, \
ABI::Windows::UI::Xaml::IDragEventArgs *e) \
{ \
return qt_##func(sender, e);\
} \
Expand Down
15 changes: 13 additions & 2 deletions src/plugins/platforms/xcb/qxcbkeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -979,10 +979,21 @@ QList<int> QXcbKeyboard::possibleKeys(const QKeyEvent *event) const
xkb_layout_index_t lockedLayout = xkb_state_serialize_layout(xkb_state, XKB_STATE_LAYOUT_LOCKED);
xkb_mod_mask_t latchedMods = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_LATCHED);
xkb_mod_mask_t lockedMods = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_LOCKED);
xkb_mod_mask_t depressedMods = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_DEPRESSED);

xkb_state_update_mask(kb_state, 0, latchedMods, lockedMods, 0, 0, lockedLayout);

xkb_state_update_mask(kb_state, depressedMods, latchedMods, lockedMods, 0, 0, lockedLayout);
quint32 keycode = event->nativeScanCode();
// handle shortcuts for level three and above
xkb_layout_index_t layoutIndex = xkb_state_key_get_layout(kb_state, keycode);
xkb_level_index_t levelIndex = 0;
if (layoutIndex != XKB_LAYOUT_INVALID) {
levelIndex = xkb_state_key_get_level(kb_state, keycode, layoutIndex);
if (levelIndex == XKB_LEVEL_INVALID)
levelIndex = 0;
}
if (levelIndex <= 1)
xkb_state_update_mask(kb_state, 0, latchedMods, lockedMods, 0, 0, lockedLayout);

xkb_keysym_t sym = xkb_state_key_get_one_sym(kb_state, keycode);
if (sym == XKB_KEY_NoSymbol) {
xkb_state_unref(kb_state);
Expand Down
9 changes: 8 additions & 1 deletion src/plugins/platforms/xcb/qxcbmime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ bool QXcbMime::mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeDa
ret = true;
} else if ((a == XCB_ATOM_PIXMAP || a == XCB_ATOM_BITMAP) && mimeData->hasImage()) {
ret = true;
} else if (atomName == QLatin1String("text/plain")
&& mimeData->hasFormat(QLatin1String("text/uri-list"))) {
// Return URLs also as plain text.
*data = QInternalMimeData::renderDataHelper(atomName, mimeData);
ret = true;
}
return ret;
}
Expand All @@ -149,8 +154,10 @@ QVector<xcb_atom_t> QXcbMime::mimeAtomsForFormat(QXcbConnection *connection, con
}

// special cases for uris
if (format == QLatin1String("text/uri-list"))
if (format == QLatin1String("text/uri-list")) {
atoms.append(connection->internAtom("text/x-moz-url"));
atoms.append(connection->internAtom("text/plain"));
}

//special cases for images
if (format == QLatin1String("image/ppm"))
Expand Down
3 changes: 3 additions & 0 deletions src/printsupport/kernel/qprintengine_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ int QWin32PrintEngine::metric(QPaintDevice::PaintDeviceMetric m) const
case QPaintDevice::PdmDevicePixelRatio:
val = 1;
break;
case QPaintDevice::PdmDevicePixelRatioScaled:
val = 1 * QPaintDevice::devicePixelRatioFScale();
break;
default:
qWarning("QPrinter::metric: Invalid metric command");
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/dialogs/qfilesystemmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ QT_BEGIN_NAMESPACE
about the underlying files and directories related to items in the model.
Directories can be created and removed using mkdir(), rmdir().
\note QFileSystemModel requires an instance of a GUI application.
\note QFileSystemModel requires an instance of \l QApplication.
\section1 Example Usage
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/itemviews/qdirmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ void QDirModelPrivate::invalidate()
Directories can be created and removed using mkdir(), rmdir(), and the
model will be automatically updated to take the changes into account.
\note QDirModel requires an instance of a GUI application.
\note QDirModel requires an instance of \l QApplication.
\sa nameFilters(), setFilter(), filter(), QListView, QTreeView, QFileSystemModel,
{Dir View Example}, {Model Classes}
Expand Down
11 changes: 10 additions & 1 deletion src/widgets/styles/qcommonstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5237,6 +5237,13 @@ static QPixmap cachedPixmapFromXPM(const char * const *xpm)
return result;
}

#ifndef QT_NO_IMAGEFORMAT_PNG
static inline QString clearText16IconPath()
{
return QStringLiteral(":/qt-project.org/styles/commonstyle/images/cleartext-16.png");
}
#endif // !QT_NO_IMAGEFORMAT_PNG

static QIcon clearTextIcon(bool rtl)
{
const QString directionalThemeName = rtl
Expand All @@ -5249,7 +5256,7 @@ static QIcon clearTextIcon(bool rtl)

QIcon icon;
#ifndef QT_NO_IMAGEFORMAT_PNG
QPixmap clearText16(QStringLiteral(":/qt-project.org/styles/commonstyle/images/cleartext-16.png"));
QPixmap clearText16(clearText16IconPath());
Q_ASSERT(!clearText16.size().isEmpty());
icon.addPixmap(clearText16);
QPixmap clearText32(QStringLiteral(":/qt-project.org/styles/commonstyle/images/cleartext-32.png"));
Expand Down Expand Up @@ -5564,6 +5571,8 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-16.png"));
case SP_MediaVolumeMuted:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png"));
case SP_LineEditClearButton:
return QPixmap(clearText16IconPath());
#endif // QT_NO_IMAGEFORMAT_PNG
default:
break;
Expand Down
3 changes: 2 additions & 1 deletion src/widgets/widgets/qdockwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,8 @@ void QDockWidgetPrivate::endDrag(bool abort)
} else {
setResizerActive(false);
}
undockedGeometry = q->geometry();
if (q->isFloating()) // Might not be floating when dragging a QDockWidgetGroupWindow
undockedGeometry = q->geometry();
q->activateWindow();
} else {
// The tab was not plugged back in the QMainWindow but the QDockWidget cannot
Expand Down
Loading

0 comments on commit b5695bd

Please sign in to comment.