Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.8' into dev
Browse files Browse the repository at this point in the history
Conflicts:
	examples/network/network-chat/peermanager.cpp
	src/widgets/util/qsystemtrayicon.cpp
	src/widgets/util/qsystemtrayicon_qpa.cpp
	src/widgets/util/qsystemtrayicon_win.cpp
	src/widgets/util/qsystemtrayicon_x11.cpp

Change-Id: I1c026df83818c0ccaf956980370e7522960627db
  • Loading branch information
liangqi committed Jan 30, 2017
2 parents 5ad1918 + 02cc57f commit 246799d
Show file tree
Hide file tree
Showing 105 changed files with 661 additions and 374 deletions.
1 change: 0 additions & 1 deletion config_help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ Build options:

-c++std <edition> .... Select C++ standard <edition> [c++1z/c++14/c++11]
(Not supported with MSVC)
-rtti ................ Build with Runtime Type Information [yes] (MSVC only)

-sse2 ................ Use SSE2 instructions [auto]
-sse3/-ssse3/-sse4.1/-sse4.2/-avx/-avx2/-avx512
Expand Down
7 changes: 0 additions & 7 deletions configure.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
"reduce-relocations": { "type": "boolean", "name": "reduce_relocations" },
"release": { "type": "enum", "name": "debug", "values": { "yes": "no", "no": "yes" } },
"rpath": "boolean",
"rtti": "boolean",
"sanitize": "sanitize",
"sdk": "string",
"separate-debug-info": { "type": "boolean", "name": "separate_debug_info" },
Expand Down Expand Up @@ -573,12 +572,6 @@
"autoDetect": false,
"output": [ { "type": "varAppend", "name": "EXTRA_RPATHS", "value": "input.rpaths" } ]
},
"rtti": {
"label": "Build with RTTI",
"comment": "mkspecs/features/win32/default_pre.prf sets no-rtti. Follow default behavior of configure.exe by overriding with rtti.",
"condition": "config.win32",
"output": [ "publicConfig" ]
},
"force_asserts": {
"label": "Force assertions",
"autoDetect": false,
Expand Down
2 changes: 1 addition & 1 deletion doc/global/config.qdocconf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
dita.metadata.default.author = Qt Project
dita.metadata.default.permissions = all
dita.metadata.default.publisher = Qt Project
dita.metadata.default.copyryear = 2016
dita.metadata.default.copyryear = 2017
dita.metadata.default.copyrholder = The Qt Company Ltd
dita.metadata.default.audience = programmer

Expand Down
2 changes: 1 addition & 1 deletion doc/global/html-footer-online.qdocconf
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ HTML.footer += \
" <ul id=\"menu-footer-submenu\" class=\"right clearfix\"><li id=\"menu-item-1795\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1795\"><a title=\"Sign into your account.\" href=\"https://account.qt.io/login\">Sign In</a></li>\n" \
" <li id=\"menu-item-10375\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-10375\"><a href=\"mailto:[email protected]?Subject=Feedback%20about%20doc.qt.io%20site\">Feedback</a></li>\n" \
" <li id=\"menu-item-1494\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1494\"><a href=\"http://qt.io/contact-us/\">Contact us</a></li>\n" \
" <li id=\"menu-item-4472\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-4472\"><a href=\"http://qt.io/about-us/\">© 2016 The Qt Company</a></li>\n" \
" <li id=\"menu-item-4472\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-4472\"><a href=\"http://qt.io/about-us/\">© 2017 The Qt Company</a></li>\n" \
" </ul>\n" \
"</div>\n" \
"</div>\n" \
Expand Down
2 changes: 1 addition & 1 deletion doc/global/html-footer.qdocconf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ HTML.footer = \
"</div>\n" \
"<div class=\"footer\">\n" \
" <p>\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2016 The Qt Company Ltd.\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2017 The Qt Company Ltd.\n" \
" Documentation contributions included herein are the copyrights of\n" \
" their respective owners.<br>" \
" The documentation provided herein is licensed under the terms of the" \
Expand Down
2 changes: 1 addition & 1 deletion doc/global/qt-module-defaults-online.qdocconf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
HTML.footer = \
" </div>\n" \
" <p class=\"copy-notice\">\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2016 The Qt Company Ltd.\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2017 The Qt Company Ltd.\n" \
" Documentation contributions included herein are the copyrights of\n" \
" their respective owners. " \
" The documentation provided herein is licensed under the terms of the" \
Expand Down
3 changes: 2 additions & 1 deletion examples/widgets/dialogs/classwizard/classwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,10 @@ void CodeStylePage::initializePage()
baseIncludeLabel->setEnabled(!baseClass.isEmpty());
baseIncludeLineEdit->setEnabled(!baseClass.isEmpty());

QRegularExpression rx("Q[A-Z].*");
if (baseClass.isEmpty()) {
baseIncludeLineEdit->clear();
} else if (QRegExp("Q[A-Z].*").exactMatch(baseClass)) {
} else if (rx.match(baseClass).hasMatch()) {
baseIncludeLineEdit->setText('<' + baseClass + '>');
} else {
baseIncludeLineEdit->setText('"' + baseClass.toLower() + ".h\"");
Expand Down
6 changes: 4 additions & 2 deletions examples/widgets/dialogs/licensewizard/licensewizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@

#include "licensewizard.h"

QString emailRegExp = QStringLiteral(".+@.+");

//! [0] //! [1] //! [2]
LicenseWizard::LicenseWizard(QWidget *parent)
: QWizard(parent)
Expand Down Expand Up @@ -189,7 +191,7 @@ EvaluatePage::EvaluatePage(QWidget *parent)

emailLabel = new QLabel(tr("&Email address:"));
emailLineEdit = new QLineEdit;
emailLineEdit->setValidator(new QRegExpValidator(QRegExp(".*@.*"), this));
emailLineEdit->setValidator(new QRegularExpressionValidator(QRegularExpression(emailRegExp), this));
emailLabel->setBuddy(emailLineEdit);

//! [21]
Expand Down Expand Up @@ -264,7 +266,7 @@ DetailsPage::DetailsPage(QWidget *parent)

emailLabel = new QLabel(tr("&Email address:"));
emailLineEdit = new QLineEdit;
emailLineEdit->setValidator(new QRegExpValidator(QRegExp(".*@.*"), this));
emailLineEdit->setValidator(new QRegularExpressionValidator(QRegularExpression(emailRegExp), this));
emailLabel->setBuddy(emailLineEdit);

postalLabel = new QLabel(tr("&Postal address:"));
Expand Down
4 changes: 2 additions & 2 deletions examples/widgets/doc/src/icons.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,8 @@
whitespace and one or several digits again.

The first digits of the regular expression are captured using
parentheses. This enables us to use the QRegExp::cap() or
QRegExp::capturedTexts() functions to extract the matched
parentheses. This enables us to use the QRegularExpressionMatch::captured()
or QRegularExpressionMatch::capturedTexts() functions to extract the matched
characters. If the first and second numbers of the spin box value
differ (e.g., "16 x 24"), we use the first number.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ void AddressBook::exportAsVCard()
int index = name.indexOf(" ");

if (index != -1) {
nameList = name.split(QRegExp("\\s+"), QString::SkipEmptyParts);
nameList = name.split(QRegularExpression("\\s+"), QString::SkipEmptyParts);
firstName = nameList.first();
lastName = nameList.last();
} else {
Expand Down
1 change: 1 addition & 0 deletions mkspecs/features/qt_configure.prf
Original file line number Diff line number Diff line change
Expand Up @@ -1878,6 +1878,7 @@ pfx = $$[QT_INSTALL_PREFIX]
equals(pfx, $$[QT_INSTALL_PREFIX/get]) {
logn("Once everything is built, Qt is installed.")
logn("You should NOT run '$$QMAKE_MAKE_NAME install'.")
logn("Note that this build cannot be deployed to other machines or devices.")
} else {
logn("Once everything is built, you must run '$$QMAKE_MAKE_NAME install'.")
logn("Qt will be installed into '$$system_path($$pfx)'.")
Expand Down
13 changes: 12 additions & 1 deletion mkspecs/features/toolchain.prf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,18 @@ isEmpty($${target_prefix}.INCDIRS) {
cmd_prefix = "set LC_ALL=C&"
cmd_suffix = "<NUL >NUL"
}
output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$QMAKE_CXXFLAGS) -xc++ -E -v - 2>&1 $$cmd_suffix", lines)

cxx_flags = $$QMAKE_CXXFLAGS

# Manually inject the sysroot for Apple Platforms because its resolution
# normally does not happen until default_post.prf. This is especially
# important for moc to gain the correct default include directory list.
# While technically incorrect but without any likely practical effect,
# UIKit simulator platforms will see the device SDK's sysroot in
# QMAKE_DEFAULT_*DIRS, because they're handled in a single build pass.
darwin: cxx_flags += -isysroot $$QMAKE_MAC_SDK_PATH

output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ -E -v - 2>&1 $$cmd_suffix", lines)
add_includes = false
for (line, output) {
line ~= s/^ *// # remove leading spaces
Expand Down
2 changes: 1 addition & 1 deletion mkspecs/features/win32/default_pre.prf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
CONFIG = rtti_off incremental_off windows $$CONFIG
CONFIG = incremental_off windows $$CONFIG
load(default_pre)
1 change: 1 addition & 0 deletions mkspecs/linux-icc/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ QMAKE_LINK = icpc
QMAKE_LINK_SHLIB = icpc
QMAKE_LFLAGS =
QMAKE_LFLAGS_RELEASE =
QMAKE_LFLAGS_APP = -pie
QMAKE_LFLAGS_DEBUG =
QMAKE_LFLAGS_SHLIB = -shared -shared-intel
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
Expand Down
4 changes: 2 additions & 2 deletions src/corelib/doc/snippets/qstring/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,14 @@ void Widget::fillFunction()
void Widget::fromRawDataFunction()
{
//! [22]
QRegExp pattern;
QRegularExpression pattern("\u00A4");
static const QChar unicode[] = {
0x005A, 0x007F, 0x00A4, 0x0060,
0x1009, 0x0020, 0x0020};
int size = sizeof(unicode) / sizeof(QChar);

QString str = QString::fromRawData(unicode, size);
if (str.contains(QRegExp(pattern))) {
if (str.contains(pattern) {
// ...
//! [22] //! [23]
}
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/doc/snippets/qstringlist/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Widget::Widget(QWidget *parent)
//! [6]

//! [7]
QStringList monospacedFonts = fonts.filter(QRegExp("Courier|Fixed"));
QStringList monospacedFonts = fonts.filter(QRegularExpression("Courier|Fixed"));
//! [7]

//! [8]
Expand Down
26 changes: 18 additions & 8 deletions src/corelib/global/qlibraryinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,14 +530,24 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
}
#endif

// expand environment variables in the form $(ENVVAR)
int rep;
QRegExp reg_var(QLatin1String("\\$\\(.*\\)"));
reg_var.setMinimal(true);
while((rep = reg_var.indexIn(ret)) != -1) {
ret.replace(rep, reg_var.matchedLength(),
QString::fromLocal8Bit(qgetenv(ret.midRef(rep + 2,
reg_var.matchedLength() - 3).toLatin1().constData()).constData()));
int startIndex = 0;
forever {
startIndex = ret.indexOf(QLatin1Char('$'), startIndex);
if (startIndex < 0)
break;
if (ret.length() < startIndex + 3)
break;
if (ret.at(startIndex + 1) != QLatin1Char('(')) {
startIndex++;
continue;
}
int endIndex = ret.indexOf(QLatin1Char(')'), startIndex + 2);
if (endIndex < 0)
break;
QStringRef envVarName = ret.midRef(startIndex + 2, endIndex - startIndex - 2);
QString value = QString::fromLocal8Bit(qgetenv(envVarName.toLocal8Bit().constData()));
ret.replace(startIndex, endIndex - startIndex + 1, value);
startIndex += value.length();
}

config->endGroup();
Expand Down
6 changes: 3 additions & 3 deletions src/corelib/global/qprocessordetection.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,6 @@
# if defined(_MIPS_ARCH_MIPS2) || (defined(__mips) && __mips - 0 >= 2)
# define Q_PROCESSOR_MIPS_II
# endif
# if defined(_MIPS_ARCH_MIPS32) || defined(__mips32)
# define Q_PROCESSOR_MIPS_32
# endif
# if defined(_MIPS_ARCH_MIPS3) || (defined(__mips) && __mips - 0 >= 3)
# define Q_PROCESSOR_MIPS_III
# endif
Expand All @@ -246,6 +243,9 @@
# if defined(_MIPS_ARCH_MIPS5) || (defined(__mips) && __mips - 0 >= 5)
# define Q_PROCESSOR_MIPS_V
# endif
# if defined(_MIPS_ARCH_MIPS32) || defined(__mips32) || (defined(__mips) && __mips - 0 >= 32)
# define Q_PROCESSOR_MIPS_32
# endif
# if defined(_MIPS_ARCH_MIPS64) || defined(__mips64)
# define Q_PROCESSOR_MIPS_64
# define Q_PROCESSOR_WORDSIZE 8
Expand Down
4 changes: 2 additions & 2 deletions src/corelib/io/qsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,7 @@ void QConfFileSettingsPrivate::syncConfFile(QConfFile *confFile)
ensureAllSectionsParsed(confFile);
ParsedSettingsMap mergedKeys = confFile->mergedKeyMap();

#ifndef QT_BOOTSTRAPPED
#if !defined(QT_BOOTSTRAPPED) && QT_CONFIG(temporaryfile)
QSaveFile sf(confFile->name);
#else
QFile sf(confFile->name);
Expand Down Expand Up @@ -1522,7 +1522,7 @@ void QConfFileSettingsPrivate::syncConfFile(QConfFile *confFile)
ok = writeFunc(sf, tempOriginalKeys);
}

#ifndef QT_BOOTSTRAPPED
#if !defined(QT_BOOTSTRAPPED) && QT_CONFIG(temporaryfile)
if (ok)
ok = sf.commit();
#endif
Expand Down
22 changes: 0 additions & 22 deletions src/corelib/kernel/qeventdispatcher_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ QEventDispatcherWin32Private::QEventDispatcherWin32Private()
: threadId(GetCurrentThreadId()), interrupt(false), closingDown(false), internalHwnd(0),
getMessageHook(0), serialNumber(0), lastSerialNumber(0), sendPostedEventsWindowsTimerId(0),
wakeUps(0)
#ifndef Q_OS_WINCE
, activateNotifiersPosted(false)
#endif
{
}

Expand Down Expand Up @@ -180,11 +178,9 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA

QSockNot *sn = dict ? dict->value(wp) : 0;
if (sn) {
#ifndef Q_OS_WINCE
d->doWsaAsyncSelect(sn->fd, 0);
d->active_fd[sn->fd].selected = false;
d->postActivateSocketNotifiers();
#endif
if (type < 3) {
QEvent event(QEvent::SockAct);
QCoreApplication::sendEvent(sn->obj, &event);
Expand All @@ -195,7 +191,6 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
}
}
return 0;
#ifndef Q_OS_WINCE
} else if (message == WM_QT_ACTIVATENOTIFIERS) {
Q_ASSERT(d != 0);

Expand All @@ -210,7 +205,6 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
}
d->activateNotifiersPosted = false;
return 0;
#endif // !Q_OS_WINCE
} else if (message == WM_QT_SENDPOSTEDEVENTS
// we also use a Windows timer to send posted events when the message queue is full
|| (message == WM_TIMER
Expand Down Expand Up @@ -445,13 +439,11 @@ void QEventDispatcherWin32Private::doWsaAsyncSelect(int socket, long event)
WSAAsyncSelect(socket, internalHwnd, event ? int(WM_QT_SOCKETNOTIFIER) : 0, event);
}

#ifndef Q_OS_WINCE
void QEventDispatcherWin32Private::postActivateSocketNotifiers()
{
if (!activateNotifiersPosted)
activateNotifiersPosted = PostMessage(internalHwnd, WM_QT_ACTIVATENOTIFIERS, 0, 0);
}
#endif // !Q_OS_WINCE

void QEventDispatcherWin32::createInternalHwnd()
{
Expand Down Expand Up @@ -705,22 +697,16 @@ void QEventDispatcherWin32::registerSocketNotifier(QSocketNotifier *notifier)
QSFDict::iterator it = d->active_fd.find(sockfd);
if (it != d->active_fd.end()) {
QSockFd &sd = it.value();
#ifndef Q_OS_WINCE
if (sd.selected) {
d->doWsaAsyncSelect(sockfd, 0);
sd.selected = false;
}
#endif // !Q_OS_WINCE
sd.event |= event;
} else {
d->active_fd.insert(sockfd, QSockFd(event));
}

#ifndef Q_OS_WINCE
d->postActivateSocketNotifiers();
#else
d->doWsaAsyncSelect(sockfd, event);
#endif
}

void QEventDispatcherWin32::unregisterSocketNotifier(QSocketNotifier *notifier)
Expand Down Expand Up @@ -749,7 +735,6 @@ void QEventDispatcherWin32::doUnregisterSocketNotifier(QSocketNotifier *notifier
QSFDict::iterator it = d->active_fd.find(sockfd);
if (it != d->active_fd.end()) {
QSockFd &sd = it.value();
#ifndef Q_OS_WINCE
if (sd.selected)
d->doWsaAsyncSelect(sockfd, 0);
const long event[3] = { FD_READ | FD_CLOSE | FD_ACCEPT, FD_WRITE | FD_CONNECT, FD_OOB };
Expand All @@ -760,13 +745,6 @@ void QEventDispatcherWin32::doUnregisterSocketNotifier(QSocketNotifier *notifier
sd.selected = false;
d->postActivateSocketNotifiers();
}
#else
const long event[3] = { FD_READ | FD_CLOSE | FD_ACCEPT, FD_WRITE | FD_CONNECT, FD_OOB };
sd.event ^= event[type];
d->doWsaAsyncSelect(sockfd, sd.event);
if (sd.event == 0)
d->active_fd.erase(it);
#endif // !Q_OS_WINCE
}

QSNDict *sn_vec[3] = { &d->sn_read, &d->sn_write, &d->sn_except };
Expand Down
2 changes: 0 additions & 2 deletions src/corelib/kernel/qeventdispatcher_win_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,8 @@ class Q_CORE_EXPORT QEventDispatcherWin32Private : public QAbstractEventDispatch
QSNDict sn_write;
QSNDict sn_except;
QSFDict active_fd;
#ifndef Q_OS_WINCE
bool activateNotifiersPosted;
void postActivateSocketNotifiers();
#endif
void doWsaAsyncSelect(int socket, long event);

QList<QWinEventNotifier *> winEventNotifierList;
Expand Down
8 changes: 7 additions & 1 deletion src/corelib/kernel/qobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2636,6 +2636,9 @@ static inline void check_and_warn_compat(const QMetaObject *sender, const QMetaM
(exact same signal to the exact same slot on the same objects),
the connection will fail and connect will return an invalid QMetaObject::Connection.
\note Qt::UniqueConnections do not work for lambdas, non-member functions
and functors; they only apply to connecting to member functions.
The optional \a type parameter describes the type of connection
to establish. In particular, it determines whether a particular
signal is delivered to a slot immediately or queued for delivery
Expand Down Expand Up @@ -4705,7 +4708,10 @@ void qDeleteInEventHandler(QObject *o)
Creates a connection of a given \a type from \a signal in
\a sender object to \a functor to be placed in a specific event
loop of \a context, and returns a handle to the connection
loop of \a context, and returns a handle to the connection.
\note Qt::UniqueConnections do not work for lambdas, non-member functions
and functors; they only apply to connecting to member functions.
The signal must be a function declared as a signal in the header.
The slot function can be any function or functor that can be connected
Expand Down
Loading

0 comments on commit 246799d

Please sign in to comment.