summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-04-24 01:00:18 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-04-24 01:00:19 +0200
commit02268b84960244945cbff4b11f8475bbf1f9388b (patch)
treee5d5e7477b6cf9de9cac3664fa98172f91d80591
parentbe9a56e5e3ced5d0d668fa24e4c65ae928f2e25a (diff)
parentc579f49e2a80a55a4004ff8e5b2ee76bda146387 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
-rw-r--r--qmake/generators/unix/unixmake.cpp18
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp13
-rw-r--r--src/corelib/doc/snippets/qstringlist/main.cpp11
-rw-r--r--src/corelib/global/qglobal.cpp12
-rw-r--r--src/corelib/global/qlogging.cpp3
-rw-r--r--src/corelib/tools/qlist.cpp13
-rw-r--r--src/corelib/tools/qstringlist.cpp15
-rw-r--r--src/plugins/platforms/windows/qwindowsinputcontext.cpp8
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp6
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp4
10 files changed, 73 insertions, 30 deletions
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 30f99174f8..894020d2bd 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -461,10 +461,24 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
opt = (*++it).toQString();
else
opt = opt.mid(10).trimmed();
+ static const QChar suffixMarker = ',';
+ const int suffixPosition = opt.indexOf(suffixMarker);
+ const bool hasSuffix = suffixPosition >= 0;
+ QString frameworkName = opt;
+ if (hasSuffix) {
+ frameworkName.truncate(suffixPosition);
+ opt.remove(suffixMarker); // Apply suffix by removing marker
+ }
for (const QMakeLocalFileName &dir : qAsConst(frameworkdirs)) {
- QString prl = dir.local() + "/" + opt + ".framework/" + opt + Option::prl_ext;
- if (processPrlFile(prl))
+ QString frameworkDirectory = dir.local() + "/" + frameworkName + + ".framework/";
+ QString suffixedPrl = frameworkDirectory + opt + Option::prl_ext;
+ if (processPrlFile(suffixedPrl))
break;
+ if (hasSuffix) {
+ QString unsuffixedPrl = frameworkDirectory + frameworkName + Option::prl_ext;
+ if (processPrlFile(unsuffixedPrl))
+ break;
+ }
}
} else {
if (opt.length() == 10)
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp
index ac17de1bee..27565a7878 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp
@@ -54,11 +54,14 @@ QList<QDate> dateList;
//! [0]
-//! [1]
-QList<QString> list;
-list << "one" << "two" << "three";
-// list: ["one", "two", "three"]
-//! [1]
+//! [1a]
+QList<QString> list = { "one", "two", "three" };
+//! [1a]
+
+
+//! [1b]
+list << "four" << "five";
+//! [1b]
//! [2]
diff --git a/src/corelib/doc/snippets/qstringlist/main.cpp b/src/corelib/doc/snippets/qstringlist/main.cpp
index 4d9c015747..55c60650fe 100644
--- a/src/corelib/doc/snippets/qstringlist/main.cpp
+++ b/src/corelib/doc/snippets/qstringlist/main.cpp
@@ -61,10 +61,13 @@ public:
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
-//! [0]
- QStringList fonts;
- fonts << "Arial" << "Helvetica" << "Times" << "Courier";
-//! [0]
+//! [0a]
+ QStringList fonts = { "Arial", "Helvetica", "Times" };
+//! [0a]
+
+//! [0b]
+ fonts << "Courier" << "Verdana";
+//! [0b]
//! [1]
for (int i = 0; i < fonts.size(); ++i)
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index b75b218201..30c80b8b6f 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -3268,14 +3268,15 @@ QByteArray qgetenv(const char *varName)
/*!
- QString qEnvironmentVariable(const char *varName, const QString &defaultValue);
+ \fn QString qEnvironmentVariable(const char *varName, const QString &defaultValue)
+ \fn QString qEnvironmentVariable(const char *varName)
\relates <QtGlobal>
\since 5.10
- Returns the value of the environment variable with name \a varName as a
- QString. If no variable by that name is found in the environment, this
- function returns \a defaultValue.
+ These functions return the value of the environment variable, \a varName, as a
+ QString. If no variable \a varName is found in the environment and \a defaultValue
+ is provided, \a defaultValue is returned. Otherwise QString() is returned.
The Qt environment manipulation functions are thread-safe, but this
requires that the C library equivalent functions like getenv and putenv are
@@ -3344,9 +3345,6 @@ QString qEnvironmentVariable(const char *varName, const QString &defaultValue)
#endif
}
-/*!
- \internal
-*/
QString qEnvironmentVariable(const char *varName)
{
return qEnvironmentVariable(varName, QString());
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 17002c4231..7444145e82 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -208,6 +208,7 @@ static bool isDefaultCategory(const char *category)
/*!
Returns true if writing to \c stderr is supported.
+ \internal
\sa stderrHasConsoleAttached()
*/
static bool systemHasStderr()
@@ -236,6 +237,7 @@ static bool systemHasStderr()
the output might still end up visible to the user. For this reason, we don't guard
the stderr output in the default message handler with stderrHasConsoleAttached().
+ \internal
\sa systemHasStderr()
*/
bool stderrHasConsoleAttached()
@@ -288,6 +290,7 @@ namespace QtPrivate {
This is normally the case if \c stderr has a console attached, but may be overridden
by the user by setting the QT_FORCE_STDERR_LOGGING environment variable to \c 1.
+ \internal
\sa stderrHasConsoleAttached()
*/
bool shouldLogToStderr()
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 33835e3d28..17aba8035b 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -408,15 +408,20 @@ void **QListData::erase(void **xi)
from strings.
QList stores a list of items. The default constructor creates an
- empty list. To insert items into the list, you can use
- operator<<():
+ empty list. You can use the initializer-list constructor to create
+ a list with elements:
- \snippet code/src_corelib_tools_qlistdata.cpp 1
+ \snippet code/src_corelib_tools_qlistdata.cpp 1a
QList provides these basic functions to add, move, and remove
items: insert(), replace(), removeAt(), move(), and swap(). In
addition, it provides the following convenience functions:
- append(), prepend(), removeFirst(), and removeLast().
+ append(), \l{operator<<()}, \l{operator+=()}, prepend(), removeFirst(),
+ and removeLast().
+
+ \l{operator<<()} allows to conveniently add multiple elements to a list:
+
+ \snippet code/src_corelib_tools_qlistdata.cpp 1b
QList uses 0-based indexes, just like C++ arrays. To access the
item at a particular index position, you can use operator[](). On
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index d10d9ad9d0..c9db39a29f 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -98,14 +98,25 @@ QT_BEGIN_NAMESPACE
\tableofcontents
+ \section1 Initializing
+
+ The default constructor creates an empty list. You can use the
+ initializer-list constructor to create a list with elements:
+
+ \snippet qstringlist/main.cpp 0a
+
\section1 Adding Strings
Strings can be added to a list using the \l
+ {QList::insert()}{insert()} \l
{QList::append()}{append()}, \l
{QList::operator+=()}{operator+=()} and \l
- {QStringList::operator<<()}{operator<<()} functions. For example:
+ {operator<<()} functions.
+
+ \l{operator<<()} can be used to
+ conveniently add multiple elements to a list:
- \snippet qstringlist/main.cpp 0
+ \snippet qstringlist/main.cpp 0b
\section1 Iterating Over the Strings
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
index b9dd2c557e..2dbca6047c 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
@@ -530,6 +530,14 @@ bool QWindowsInputContext::endComposition(HWND hwnd)
if (m_compositionContext.focusObject.isNull())
return false;
+ // QTBUG-58300: Ignore WM_IME_ENDCOMPOSITION when CTRL is pressed to prevent
+ // for example the text being cleared when pressing CTRL+A
+ if (m_locale.language() == QLocale::Korean
+ && QGuiApplication::queryKeyboardModifiers().testFlag(Qt::ControlModifier)) {
+ reset();
+ return true;
+ }
+
m_endCompositionRecursionGuard = true;
imeNotifyCancelComposition(m_compositionContext.hwnd);
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 36e5b03c0d..8ba6504f87 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -4996,11 +4996,13 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
if (!subRule.hasGeometry()) {
QSize nativeContentsSize;
bool nullIcon = hdr->icon.isNull();
+ const int margin = pixelMetric(QStyle::PM_HeaderMargin, hdr, w);
int iconSize = nullIcon ? 0 : pixelMetric(QStyle::PM_SmallIconSize, hdr, w);
const QSize txt = subRule.hasFont ? QFontMetrics(subRule.font).size(0, hdr->text)
: hdr->fontMetrics.size(0, hdr->text);
- nativeContentsSize.setHeight(qMax(iconSize, txt.height()));
- nativeContentsSize.setWidth(iconSize + txt.width());
+ nativeContentsSize.setHeight(margin + qMax(iconSize, txt.height()) + margin);
+ nativeContentsSize.setWidth((nullIcon ? 0 : margin) + iconSize
+ + (hdr->text.isNull() ? 0 : margin) + txt.width() + margin);
sz = sz.expandedTo(nativeContentsSize);
}
return subRule.size(sz);
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index cd13e2bd19..ad00e25e7d 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -2878,10 +2878,6 @@ void tst_QFile::nativeHandleLeaks()
#endif
QCOMPARE( fd2, fd1 );
-
-#ifdef Q_OS_WIN
- QCOMPARE( handle2, handle1 );
-#endif
}
void tst_QFile::readEof_data()