summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-08-21 10:38:57 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-08-21 11:03:18 +0200
commitc8ca300e491c186304d0864a9e870337e891e6f7 (patch)
treef1d991c5960b5acc0bf2a709960e871d48d91acf /src
parent31c96d34d27f8cad020238df28c10a71b2c4a34f (diff)
parent8b540f68a8404e4b9e3ac65a22c11416a91ee749 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: qmake/doc/src/qmake-manual.qdoc src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/src.pro Change-Id: I0a560826c420e46988da3776bd8f9160c365459a
Diffstat (limited to 'src')
-rw-r--r--src/angle/src/config.pri3
-rw-r--r--src/corelib/global/qlibraryinfo.cpp2
-rw-r--r--src/corelib/json/qjsonobject.cpp38
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp23
-rw-r--r--src/corelib/kernel/qobjectdefs_impl.h18
-rw-r--r--src/corelib/tools/qcryptographichash.cpp6
-rw-r--r--src/corelib/tools/qcryptographichash.h6
-rw-r--r--src/network/socket/qabstractsocket.cpp4
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor.cpp21
-rw-r--r--src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp195
-rw-r--r--src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h22
-rw-r--r--src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp6
-rw-r--r--src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibility.mm3
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm3
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm6
-rw-r--r--src/plugins/platforms/windows/qtwindowsglobal.h5
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp41
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h3
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp8
-rw-r--r--src/src.pro6
-rw-r--r--src/testlib/qtestlog.cpp42
-rw-r--r--src/testlib/qtestmouse.h6
-rw-r--r--src/tools/moc/main.cpp2
-rw-r--r--src/tools/moc/moc.pro2
-rw-r--r--src/tools/qdoc/doc/qtgui-qdocconf.qdoc292
-rw-r--r--src/tools/uic/main.cpp2
-rw-r--r--src/widgets/itemviews/qheaderview.cpp24
-rw-r--r--src/widgets/itemviews/qheaderview_p.h2
-rw-r--r--src/widgets/widgets/qmdiarea.cpp2
31 files changed, 608 insertions, 191 deletions
diff --git a/src/angle/src/config.pri b/src/angle/src/config.pri
index 465bcf6a1e..1c6d8b0167 100644
--- a/src/angle/src/config.pri
+++ b/src/angle/src/config.pri
@@ -78,10 +78,11 @@ msvc {
# 4239: nonstandard extension used : 'token' : conversion from 'type' to 'type'
# 4244: 'argument' : conversion from 'type1' to 'type2', possible loss of data
# 4245: 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch
+ # 4275: non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'
# 4512: 'class' : assignment operator could not be generated
# 4702: unreachable code
QMAKE_CFLAGS_WARN_ON -= -W3
- QMAKE_CFLAGS_WARN_ON += -W4 -wd"4100" -wd"4127" -wd"4189" -wd"4239" -wd"4244" -wd"4245" -wd"4512" -wd"4702"
+ QMAKE_CFLAGS_WARN_ON += -W4 -wd"4100" -wd"4127" -wd"4189" -wd"4239" -wd"4244" -wd"4245" -wd"4275" -wd"4512" -wd"4702"
# Optimizations
# /Oy: Omits frame pointer (x86 only).
# /Gy: Enables function-level linking.
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 18f293bba5..61841cab76 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -320,7 +320,7 @@ QLibraryInfo::location(LibraryLocation loc)
QString ret = rawLocation(loc, FinalPaths);
// Automatically prepend the sysroot to target paths
- if (loc < SysrootPath || loc > LastHostPath) {
+ if ((loc < SysrootPath || loc > LastHostPath) && qt_sysrootify_prefix[12] == 'y') {
QString sysroot = rawLocation(SysrootPath, FinalPaths);
if (!sysroot.isEmpty() && ret.length() > 2 && ret.at(1) == QLatin1Char(':')
&& (ret.at(2) == QLatin1Char('/') || ret.at(2) == QLatin1Char('\\')))
diff --git a/src/corelib/json/qjsonobject.cpp b/src/corelib/json/qjsonobject.cpp
index 2be9d8891d..43336de2e7 100644
--- a/src/corelib/json/qjsonobject.cpp
+++ b/src/corelib/json/qjsonobject.cpp
@@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE
QJsonObject is an implicitly shared class, and shares the data with the document
it has been created from as long as it is not being modified.
- You can convert the array to and from text based JSON through QJsonDocument.
+ You can convert the object to and from text based JSON through QJsonDocument.
*/
/*!
@@ -104,7 +104,7 @@ QT_BEGIN_NAMESPACE
/*!
- Constructs an empty JSON object
+ Constructs an empty JSON object.
\sa isEmpty()
*/
@@ -245,7 +245,7 @@ bool QJsonObject::isEmpty() const
/*!
Returns a QJsonValue representing the value for the key \a key.
- The returned QJsonValue is \c Undefined, if the key does not exist.
+ The returned QJsonValue is QJsonValue::Undefined if the key does not exist.
\sa QJsonValue, QJsonValue::isUndefined()
*/
@@ -266,7 +266,7 @@ QJsonValue QJsonObject::value(const QString &key) const
This does the same as value().
- The returned QJsonValue is \c Undefined, if the key does not exist.
+ The returned QJsonValue is QJsonValue::Undefined if the key does not exist.
\sa value(), QJsonValue, QJsonValue::isUndefined()
*/
@@ -281,7 +281,7 @@ QJsonValue QJsonObject::operator [](const QString &key) const
The return value is of type QJsonValueRef, a helper class for QJsonArray
and QJsonObject. When you get an object of type QJsonValueRef, you can
use it as if it were a reference to a QJsonValue. If you assign to it,
- the assignment will apply to the character in the QJsonArray of QJsonObject
+ the assignment will apply to the element in the QJsonArray or QJsonObject
from which you got the reference.
\sa value()
@@ -301,13 +301,13 @@ QJsonValueRef QJsonObject::operator [](const QString &key)
/*!
Inserts a new item with the key \a key and a value of \a value.
- If there is already an item with the key \a key then that item's value
+ If there is already an item with the key \a key, then that item's value
is replaced with \a value.
Returns an iterator pointing to the inserted item.
If the value is QJsonValue::Undefined, it will cause the key to get removed
- from the object. The returned iterator will then point to end()
+ from the object. The returned iterator will then point to end().
\sa remove(), take(), QJsonObject::iterator, end()
*/
@@ -382,7 +382,7 @@ void QJsonObject::remove(const QString &key)
Returns a QJsonValue containing the value referenced by \a key.
If \a key was not contained in the object, the returned QJsonValue
- is Undefined.
+ is QJsonValue::Undefined.
\sa insert(), remove(), QJsonValue
*/
@@ -422,7 +422,7 @@ bool QJsonObject::contains(const QString &key) const
}
/*!
- Returns \c true if \a other is equal to this object
+ Returns \c true if \a other is equal to this object.
*/
bool QJsonObject::operator==(const QJsonObject &other) const
{
@@ -447,7 +447,7 @@ bool QJsonObject::operator==(const QJsonObject &other) const
}
/*!
- Returns \c true if \a other is not equal to this object
+ Returns \c true if \a other is not equal to this object.
*/
bool QJsonObject::operator!=(const QJsonObject &other) const
{
@@ -501,7 +501,7 @@ QJsonObject::iterator QJsonObject::find(const QString &key)
*/
/*!
- Returns an const iterator pointing to the item with key \a key in the
+ Returns a const iterator pointing to the item with key \a key in the
map.
If the map contains no item with key \a key, the function
@@ -594,7 +594,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
should use QJsonObject::const_iterator. It is generally good practice to
use QJsonObject::const_iterator on a non-const QJsonObject as well, unless you
need to change the QJsonObject through the iterator. Const iterators are
- slightly faster, and improves code readability.
+ slightly faster, and improve code readability.
The default QJsonObject::iterator constructor creates an uninitialized
iterator. You must initialize it using a QJsonObject function like
@@ -614,8 +614,8 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
/*! \typedef QJsonObject::iterator::iterator_category
- A synonym for \e {std::bidirectional_iterator_tag} indicating
- this iterator is a bidirectional iterator.
+ A synonym for \e {std::bidirectional_iterator_tag} indicating
+ this iterator is a bidirectional iterator.
*/
/*! \typedef QJsonObject::iterator::reference
@@ -664,7 +664,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
The return value is of type QJsonValueRef, a helper class for QJsonArray
and QJsonObject. When you get an object of type QJsonValueRef, you can
use it as if it were a reference to a QJsonValue. If you assign to it,
- the assignment will apply to the character in the QJsonArray of QJsonObject
+ the assignment will apply to the element in the QJsonArray or QJsonObject
from which you got the reference.
\sa key(), operator*()
@@ -679,7 +679,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
The return value is of type QJsonValueRef, a helper class for QJsonArray
and QJsonObject. When you get an object of type QJsonValueRef, you can
use it as if it were a reference to a QJsonValue. If you assign to it,
- the assignment will apply to the character in the QJsonArray of QJsonObject
+ the assignment will apply to the element in the QJsonArray or QJsonObject
from which you got the reference.
\sa key()
@@ -788,7 +788,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
over it, you must use QJsonObject::iterator instead. It is generally
good practice to use QJsonObject::const_iterator on a non-const QJsonObject as
well, unless you need to change the QJsonObject through the iterator.
- Const iterators are slightly faster and improves code
+ Const iterators are slightly faster and improve code
readability.
The default QJsonObject::const_iterator constructor creates an
@@ -809,8 +809,8 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
/*! \typedef QJsonObject::const_iterator::iterator_category
- A synonym for \e {std::bidirectional_iterator_tag} indicating
- this iterator is a bidirectional iterator.
+ A synonym for \e {std::bidirectional_iterator_tag} indicating
+ this iterator is a bidirectional iterator.
*/
/*! \typedef QJsonObject::const_iterator::reference
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index d1bd8fbe95..dfb897c0fd 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -52,8 +52,6 @@
#include "qelapsedtimer.h"
#include "qcoreapplication_p.h"
-#include "qsysinfo.h"
-
#include <private/qthread_p.h>
#include <private/qmutexpool_p.h>
@@ -307,14 +305,8 @@ static void resolveTimerAPI()
#endif
triedResolve = true;
#if !defined(Q_OS_WINCE)
-# if defined(_MSC_VER) && _MSC_VER >= 1700
- if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8) { // QTBUG-27266, Disable when running MSVC2012-built code on pre-Windows 8
-# else
- {
-# endif
qtimeSetEvent = (ptimeSetEvent)QSystemLibrary::resolve(QLatin1String("winmm"), "timeSetEvent");
qtimeKillEvent = (ptimeKillEvent)QSystemLibrary::resolve(QLatin1String("winmm"), "timeKillEvent");
- }
#else
qtimeSetEvent = (ptimeSetEvent)QSystemLibrary::resolve(QLatin1String("Mmtimer"), "timeSetEvent");
qtimeKillEvent = (ptimeKillEvent)QSystemLibrary::resolve(QLatin1String("Mmtimer"), "timeKillEvent");
@@ -438,6 +430,18 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
return DefWindowProc(hwnd, message, wp, lp);
}
+static inline UINT inputTimerMask()
+{
+ UINT result = QS_TIMER | QS_INPUT | QS_RAWINPUT;
+ // QTBUG 28513, QTBUG-29097, QTBUG-29435: QS_TOUCH, QS_POINTER became part of
+ // QS_INPUT in Windows Kit 8. They should not be used when running on pre-Windows 8.
+#if defined(_MSC_VER) && _MSC_VER >= 1700
+ if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8)
+ result &= ~(QS_TOUCH | QS_POINTER);
+#endif // _MSC_VER >= 1700
+ return result;
+}
+
LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
{
if (wp == PM_REMOVE) {
@@ -447,7 +451,8 @@ LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
MSG *msg = (MSG *) lp;
QEventDispatcherWin32Private *d = q->d_func();
const int localSerialNumber = d->serialNumber.load();
- if (HIWORD(GetQueueStatus(QS_TIMER | QS_INPUT | QS_RAWINPUT)) == 0) {
+ static const UINT mask = inputTimerMask();
+ if (HIWORD(GetQueueStatus(mask)) == 0) {
// no more input or timer events in the message queue, we can allow posted events to be sent normally now
if (d->sendPostedEventsWindowsTimerId != 0) {
// stop the timer to send posted events, since we now allow the WM_QT_SENDPOSTEDEVENTS message
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h
index 4f44d9204e..d775ef1b65 100644
--- a/src/corelib/kernel/qobjectdefs_impl.h
+++ b/src/corelib/kernel/qobjectdefs_impl.h
@@ -496,22 +496,22 @@ namespace QtPrivate {
template<typename Func> struct FunctionPointer { enum {ArgumentCount = -1}; };
template <typename, typename, typename, typename> struct FunctorCall;
- template <int... I, typename... SignalArgs, typename R, typename Function>
- struct FunctorCall<IndexesList<I...>, List<SignalArgs...>, R, Function> {
+ template <int... II, typename... SignalArgs, typename R, typename Function>
+ struct FunctorCall<IndexesList<II...>, List<SignalArgs...>, R, Function> {
static void call(Function f, void **arg) {
- f((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[I+1]))...), ApplyReturnValue<R>(arg[0]);
+ f((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[II+1]))...), ApplyReturnValue<R>(arg[0]);
}
};
- template <int... I, typename... SignalArgs, typename R, typename... SlotArgs, typename SlotRet, class Obj>
- struct FunctorCall<IndexesList<I...>, List<SignalArgs...>, R, SlotRet (Obj::*)(SlotArgs...)> {
+ template <int... II, typename... SignalArgs, typename R, typename... SlotArgs, typename SlotRet, class Obj>
+ struct FunctorCall<IndexesList<II...>, List<SignalArgs...>, R, SlotRet (Obj::*)(SlotArgs...)> {
static void call(SlotRet (Obj::*f)(SlotArgs...), Obj *o, void **arg) {
- (o->*f)((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[I+1]))...), ApplyReturnValue<R>(arg[0]);
+ (o->*f)((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[II+1]))...), ApplyReturnValue<R>(arg[0]);
}
};
- template <int... I, typename... SignalArgs, typename R, typename... SlotArgs, typename SlotRet, class Obj>
- struct FunctorCall<IndexesList<I...>, List<SignalArgs...>, R, SlotRet (Obj::*)(SlotArgs...) const> {
+ template <int... II, typename... SignalArgs, typename R, typename... SlotArgs, typename SlotRet, class Obj>
+ struct FunctorCall<IndexesList<II...>, List<SignalArgs...>, R, SlotRet (Obj::*)(SlotArgs...) const> {
static void call(SlotRet (Obj::*f)(SlotArgs...) const, Obj *o, void **arg) {
- (o->*f)((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[I+1]))...), ApplyReturnValue<R>(arg[0]);
+ (o->*f)((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[II+1]))...), ApplyReturnValue<R>(arg[0]);
}
};
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index 32f5f0b33a..f4f465a623 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -45,8 +45,12 @@
#include "../../3rdparty/sha1/sha1.cpp"
+#if defined(QT_BOOTSTRAPPED) && !defined(QT_CRYPTOGRAPHICHASH_ONLY_SHA1)
+# error "Are you sure you need the other hashing algorithms besides SHA-1?"
+#endif
+
#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
-// qdoc only needs SHA-1
+// qdoc and qmake only need SHA-1
#include "../../3rdparty/md5/md5.h"
#include "../../3rdparty/md5/md5.cpp"
#include "../../3rdparty/md4/md4.h"
diff --git a/src/corelib/tools/qcryptographichash.h b/src/corelib/tools/qcryptographichash.h
index d4e75c4667..c4f7c3ab4a 100644
--- a/src/corelib/tools/qcryptographichash.h
+++ b/src/corelib/tools/qcryptographichash.h
@@ -55,9 +55,12 @@ class Q_CORE_EXPORT QCryptographicHash
{
public:
enum Algorithm {
+#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
Md4,
Md5,
- Sha1,
+#endif
+ Sha1 = 2,
+#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
Sha224,
Sha256,
Sha384,
@@ -66,6 +69,7 @@ public:
Sha3_256,
Sha3_384,
Sha3_512
+#endif
};
explicit QCryptographicHash(Algorithm method);
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 71d6166840..084e0bc656 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -208,6 +208,10 @@
This signal is emitted after an error occurred. The \a socketError
parameter describes the type of error that occurred.
+ When this signal is emitted, the socket may not be ready for a reconnect
+ attempt. In that case, attempts to reconnect should be done from the event
+ loop. For example, use a QTimer::singleShot() with 0 as the timeout.
+
QAbstractSocket::SocketError is not a registered metatype, so for queued
connections, you will have to register it with Q_DECLARE_METATYPE() and
qRegisterMetaType().
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
index 6efd5085ac..d42251d4dd 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
@@ -2230,16 +2230,21 @@ bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString
int index = message.arguments().at(0).toInt();
bool success = false;
- int row, col, rowExtents, colExtents;
- bool isSelected;
+ int row = -1;
+ int col = -1;
+ int rowExtents = -1;
+ int colExtents = -1;
+ bool isSelected = false;
int cols = interface->tableInterface()->columnCount();
- row = index/cols;
- col = index%cols;
- QAccessibleTableCellInterface *cell = interface->tableInterface()->cellAt(row, col)->tableCellInterface();
- if (cell) {
- cell->rowColumnExtents(&row, &col, &rowExtents, &colExtents, &isSelected);
- success = true;
+ if (cols > 0) {
+ row = index / cols;
+ col = index % cols;
+ QAccessibleTableCellInterface *cell = interface->tableInterface()->cellAt(row, col)->tableCellInterface();
+ if (cell) {
+ cell->rowColumnExtents(&row, &col, &rowExtents, &colExtents, &isSelected);
+ success = true;
+ }
}
QVariantList list;
diff --git a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
index f746207cc0..116c6cfa7d 100644
--- a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
+++ b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
@@ -41,7 +41,6 @@
#include "qtablegenerator.h"
-#include <QtCore/QRegularExpression>
#include <QtCore/QByteArray>
#include <QtCore/QTextCodec>
#include <QtCore/QDebug>
@@ -54,7 +53,8 @@
#include <xkbcommon_workaround.h>
#endif
-//#define DEBUG_GENERATOR
+#include <string.h> // strchr, strncmp, etc.
+#include <strings.h> // strncasecmp
TableGenerator::TableGenerator() : m_state(NoErrors),
m_systemComposeDir(QString())
@@ -111,11 +111,9 @@ void TableGenerator::findComposeFile()
// check for the system provided compose files
if (!found && cleanState()) {
- readLocaleMappings();
+ QString table = readLocaleMappings(locale().toUpper().toUtf8());
if (cleanState()) {
-
- QString table = m_localeToTable.value(locale().toUpper());
if (table.isEmpty())
// no table mappings for the system's locale in the compose.dir
m_state = UnsupportedLocale;
@@ -174,28 +172,49 @@ QString TableGenerator::locale() const
return QLatin1String(name);
}
-void TableGenerator::readLocaleMappings()
+QString TableGenerator::readLocaleMappings(const QByteArray &locale)
{
QFile mappings(systemComposeDir() + QLatin1String("/compose.dir"));
- if (mappings.exists()) {
- mappings.open(QIODevice::ReadOnly);
- QTextStream in(&mappings);
- // formating of compose.dir has some inconsistencies
- while (!in.atEnd()) {
- QString line = in.readLine();
- if (!line.startsWith("#") && line.size() != 0 &&
- line.at(0).isLower()) {
+ QString file;
+ if (mappings.open(QIODevice::ReadOnly)) {
+ const int localeNameLength = locale.size();
+ const char * const localeData = locale.constData();
- QStringList pair = line.split(QRegExp(QLatin1String("\\s+")));
- QString table = pair.at(0);
- if (table.endsWith(QLatin1String(":")))
- table.remove(table.size() - 1, 1);
-
- m_localeToTable.insert(pair.at(1).toUpper(), table);
+ char l[1024];
+ // formating of compose.dir has some inconsistencies
+ while (!mappings.atEnd()) {
+ int read = mappings.readLine(l, sizeof(l));
+ if (read <= 0)
+ break;
+
+ char *line = l;
+ if (*line >= 'a' && *line <= 'z') {
+ // file name
+ while (*line && *line != ':' && *line != ' ' && *line != '\t')
+ ++line;
+ if (!*line)
+ continue;
+ const char * const composeFileNameEnd = line;
+ *line = '\0';
+ ++line;
+
+ // locale name
+ while (*line && (*line == ' ' || *line == '\t'))
+ ++line;
+ const char * const lc = line;
+ while (*line && *line != ' ' && *line != '\t' && *line != '\n')
+ ++line;
+ *line = '\0';
+
+ if (localeNameLength == (line - lc) && !strncasecmp(lc, localeData, line - lc)) {
+ file = QString::fromUtf8(l, composeFileNameEnd - l);
+ break;
+ }
}
}
mappings.close();
}
+ return file;
}
bool TableGenerator::processFile(QString composeFileName)
@@ -215,7 +234,7 @@ TableGenerator::~TableGenerator()
{
}
-QList<QComposeTableElement> TableGenerator::composeTable() const
+QVector<QComposeTableElement> TableGenerator::composeTable() const
{
return m_composeTable;
}
@@ -225,15 +244,14 @@ void TableGenerator::parseComposeFile(QFile *composeFile)
#ifdef DEBUG_GENERATOR
qDebug() << "TableGenerator::parseComposeFile: " << composeFile->fileName();
#endif
- QTextStream in(composeFile);
- while (!in.atEnd()) {
- QString line = in.readLine();
- if (line.startsWith(QLatin1String("<"))) {
+ char line[1024];
+ while (!composeFile->atEnd()) {
+ composeFile->readLine(line, sizeof(line));
+ if (*line == '<')
parseKeySequence(line);
- } else if (line.startsWith(QLatin1String("include"))) {
- parseIncludeInstruction(line);
- }
+ else if (!strncmp(line, "include", 7))
+ parseIncludeInstruction(QString::fromUtf8(line));
}
composeFile->close();
@@ -290,79 +308,103 @@ ushort TableGenerator::keysymToUtf8(quint32 sym)
return QString::fromUtf8(chars).at(0).unicode();
}
-quint32 TableGenerator::stringToKeysym(QString keysymName)
+static inline int fromBase8(const char *s, const char *end)
{
- quint32 keysym;
- QByteArray keysymArray = keysymName.toLatin1();
- const char *name = keysymArray.constData();
-
- if ((keysym = xkb_keysym_from_name(name, (xkb_keysym_flags)0)) == XKB_KEY_NoSymbol)
- qWarning() << QString("Qt Warning - invalid keysym: %1").arg(keysymName);
+ int result = 0;
+ while (*s && s != end) {
+ if (*s <= '0' && *s >= '7')
+ return 0;
+ result *= 8;
+ result += *s - '0';
+ ++s;
+ }
+ return result;
+}
- return keysym;
+static inline int fromBase16(const char *s, const char *end)
+{
+ int result = 0;
+ while (*s && s != end) {
+ result *= 16;
+ if (*s >= '0' && *s <= '9')
+ result += *s - '0';
+ else if (*s >= 'a' && *s <= 'f')
+ result += *s - 'a' + 10;
+ else if (*s >= 'A' && *s <= 'F')
+ result += *s - 'A' + 10;
+ else
+ return 0;
+ ++s;
+ }
+ return result;
}
-void TableGenerator::parseKeySequence(QString line)
+void TableGenerator::parseKeySequence(char *line)
{
// we are interested in the lines with the following format:
// <Multi_key> <numbersign> <S> : "♬" U266c # BEAMED SIXTEENTH NOTE
- int keysEnd = line.indexOf(QLatin1String(":"));
- QString keys = line.left(keysEnd).trimmed();
-
- // find the key sequence
- QString regexp = QStringLiteral("<[^>]+>");
- QRegularExpression reg(regexp);
- QRegularExpressionMatchIterator i = reg.globalMatch(keys);
- QStringList keyList;
- while (i.hasNext()) {
- QRegularExpressionMatch match = i.next();
- QString word = match.captured(0);
- keyList << word;
- }
+ char *keysEnd = strchr(line, ':');
+ if (!keysEnd)
+ return;
QComposeTableElement elem;
- QString quote = QStringLiteral("\"");
// find the composed value - strings may be direct text encoded in the locale
// for which the compose file is to be used, or an escaped octal or hexadecimal
// character code. Octal codes are specified as "\123" and hexadecimal codes as "\0x123a".
- int composeValueIndex = line.indexOf(quote, keysEnd) + 1;
- const QChar valueType(line.at(composeValueIndex));
+ char *composeValue = strchr(keysEnd, '"');
+ if (!composeValue)
+ return;
+ ++composeValue;
+
+ char *composeValueEnd = strchr(composeValue, '"');
+ if (!composeValueEnd)
+ return;
- if (valueType == '\\' && line.at(composeValueIndex + 1).isDigit()) {
+ if (*composeValue == '\\' && composeValue[1] >= '0' && composeValue[1] <= '9') {
// handle octal and hex code values
- QChar detectBase(line.at(composeValueIndex + 2));
- QString codeValue = line.mid(composeValueIndex + 1, line.lastIndexOf(quote) - composeValueIndex - 1);
+ char detectBase = composeValue[2];
if (detectBase == 'x') {
// hexadecimal character code
- elem.value = keysymToUtf8(codeValue.toUInt(0, 16));
+ elem.value = keysymToUtf8(fromBase16(composeValue + 3, composeValueEnd));
} else {
// octal character code
- QString hexStr = QString::number(codeValue.toUInt(0, 8), 16);
- elem.value = keysymToUtf8(hexStr.toUInt(0, 16));
+ elem.value = keysymToUtf8(fromBase8(composeValue + 1, composeValueEnd));
}
} else {
// handle direct text encoded in the locale
- elem.value = valueType.unicode();
+ if (*composeValue == '\\')
+ ++composeValue;
+ elem.value = QString::fromUtf8(composeValue).at(0).unicode();
+ ++composeValue;
}
+#ifdef DEBUG_GENERATOR
// find the comment
- int commnetIndex = line.lastIndexOf(quote) + 1;
- elem.comment = line.mid(commnetIndex).trimmed();
-
- // Convert to X11 keysym
- int count = keyList.length();
- for (int i = 0; i < QT_KEYSEQUENCE_MAX_LEN; i++) {
- if (i < count) {
- QString keysym = keyList.at(i);
- keysym.remove(keysym.length() - 1, 1);
- keysym.remove(0, 1);
+ elem.comment = QString::fromUtf8(composeValueEnd + 1).trimmed();
+#endif
- if (keysym == QLatin1String("dead_inverted_breve"))
- keysym = QStringLiteral("dead_invertedbreve");
- else if (keysym == QLatin1String("dead_double_grave"))
- keysym = QStringLiteral("dead_doublegrave");
+ // find the key sequence and convert to X11 keysym
+ char *k = line;
+ const char *kend = keysEnd;
- elem.keys[i] = stringToKeysym(keysym);
+ for (int i = 0; i < QT_KEYSEQUENCE_MAX_LEN; i++) {
+ // find the next pair of angle brackets and get the contents within
+ while (k < kend && *k != '<')
+ ++k;
+ char *sym = ++k;
+ while (k < kend && *k != '>')
+ ++k;
+ *k = '\0';
+ if (k < kend) {
+ elem.keys[i] = xkb_keysym_from_name(sym, (xkb_keysym_flags)0);
+ if (elem.keys[i] == XKB_KEY_NoSymbol) {
+ if (!strcmp(sym, "dead_inverted_breve"))
+ elem.keys[i] = XKB_KEY_dead_invertedbreve;
+ else if (!strcmp(sym, "dead_double_grave"))
+ elem.keys[i] = XKB_KEY_dead_doublegrave;
+ else
+ qWarning() << QString("Qt Warning - invalid keysym: %1").arg(sym);
+ }
} else {
elem.keys[i] = 0;
}
@@ -372,6 +414,7 @@ void TableGenerator::parseKeySequence(QString line)
void TableGenerator::printComposeTable() const
{
+#ifdef DEBUG_GENERATOR
if (composeTable().isEmpty())
return;
@@ -393,8 +436,8 @@ void TableGenerator::printComposeTable() const
.arg(comma)
.arg(elem.comment));
}
-
qDebug() << "output: \n" << output;
+#endif
}
void TableGenerator::orderComposeTable()
diff --git a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h
index cc1db20432..aa65b7b895 100644
--- a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h
+++ b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h
@@ -42,19 +42,29 @@
#ifndef QTABLEGENERATOR_H
#define QTABLEGENERATOR_H
-#include <QtCore/QList>
+#include <QtCore/QVector>
#include <QtCore/QFile>
#include <QtCore/QMap>
#include <QtCore/QString>
#define QT_KEYSEQUENCE_MAX_LEN 6
+//#define DEBUG_GENERATOR
+
struct QComposeTableElement {
uint keys[QT_KEYSEQUENCE_MAX_LEN];
uint value;
+#ifdef DEBUG_GENERATOR
QString comment;
+#endif
};
+#ifndef DEBUG_GENERATOR
+QT_BEGIN_NAMESPACE
+Q_DECLARE_TYPEINFO(QComposeTableElement, Q_PRIMITIVE_TYPE);
+QT_END_NAMESPACE
+#endif
+
class Compare
{
public:
@@ -97,12 +107,12 @@ public:
void printComposeTable() const;
void orderComposeTable();
- QList<QComposeTableElement> composeTable() const;
+ QVector<QComposeTableElement> composeTable() const;
TableState tableState() const { return m_state; }
protected:
bool processFile(QString composeFileName);
- void parseKeySequence(QString line);
+ void parseKeySequence(char *line);
void parseIncludeInstruction(QString line);
void findComposeFile();
@@ -110,16 +120,14 @@ protected:
QString systemComposeDir();
ushort keysymToUtf8(quint32 sym);
- quint32 stringToKeysym(QString keysymName);
- void readLocaleMappings();
+ QString readLocaleMappings(const QByteArray &locale);
void initPossibleLocations();
bool cleanState() const { return ((m_state & NoErrors) == NoErrors); }
QString locale() const;
private:
- QList<QComposeTableElement> m_composeTable;
- QMap<QString, QString> m_localeToTable;
+ QVector<QComposeTableElement> m_composeTable;
TableState m_state;
QString m_systemComposeDir;
QList<QString> m_possibleLocations;
diff --git a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp
index 433c9eec37..611b9fdd9b 100644
--- a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp
@@ -169,11 +169,11 @@ static bool isDuplicate(const QComposeTableElement &lhs, const QComposeTableElem
bool QComposeInputContext::checkComposeTable()
{
- QList<QComposeTableElement>::iterator it =
- qLowerBound(m_composeTable.begin(), m_composeTable.end(), m_composeBuffer, Compare());
+ QVector<QComposeTableElement>::const_iterator it =
+ qLowerBound(m_composeTable.constBegin(), m_composeTable.constEnd(), m_composeBuffer, Compare());
// prevent dereferencing an 'end' iterator, which would result in a crash
- if (it == m_composeTable.end())
+ if (it == m_composeTable.constEnd())
it -= 1;
QComposeTableElement elem = *it;
diff --git a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h
index 1ced2f8ded..def63486a7 100644
--- a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h
+++ b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h
@@ -75,7 +75,7 @@ protected:
private:
QObject *m_focusObject;
- QList<QComposeTableElement> m_composeTable;
+ QVector<QComposeTableElement> m_composeTable;
uint m_composeBuffer[QT_KEYSEQUENCE_MAX_LEN + 1];
TableGenerator::TableState m_tableState;
};
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
index 5649f3ad73..e135f36e78 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
@@ -231,8 +231,7 @@ NSArray *unignoredChildren(id parentObject, QAccessibleInterface *interface)
NSMutableArray *kids = [NSMutableArray arrayWithCapacity:numKids];
for (int i = 0; i < numKids; ++i) {
QAccessibleInterface *child = interface->child(i);
- Q_ASSERT(child);
- if (child->state().invalid || child->state().invisible)
+ if (!child || !child->isValid() || child->state().invalid || child->state().invisible)
continue;
QAccessible::Id childId = QAccessible::uniqueId(child);
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index fcebb7e0dc..20f767e240 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -489,6 +489,9 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
[m_nsWindow setStyleMask:styleMask];
[m_nsWindow setLevel:level];
setWindowShadow(flags);
+ if (!(styleMask & NSBorderlessWindowMask)) {
+ setWindowTitle(window()->title());
+ }
}
m_windowFlags = flags;
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 3063ce452e..e529e445ad 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -1034,7 +1034,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if ([theEvent respondsToSelector:@selector(scrollingDeltaX)]) {
NSEventPhase phase = [theEvent phase];
- if (phase == NSEventPhaseBegan) {
+ if (phase == NSEventPhaseBegan || phase == NSEventPhaseNone) {
currentWheelModifiers = [QNSView convertKeyModifiers:[theEvent modifierFlags]];
}
@@ -1056,7 +1056,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
QWindowSystemInterface::handleWheelEvent(m_window, qt_timestamp, qt_windowPoint, qt_screenPoint, pixelDelta, angleDelta, currentWheelModifiers, ph);
- if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled) {
+ if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled || phase == NSEventPhaseNone) {
currentWheelModifiers = Qt::NoModifier;
}
} else
@@ -1142,7 +1142,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
if (m_sendKeyEvent && m_composingText.isEmpty())
QWindowSystemInterface::handleExtendedKeyEvent(m_window, timestamp, QEvent::Type(eventType), keyCode, modifiers,
- nativeScanCode, nativeVirtualKey, nativeModifiers, text);
+ nativeScanCode, nativeVirtualKey, nativeModifiers, text, [nsevent isARepeat]);
m_sendKeyEvent = false;
}
diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h
index dcd3db2d47..64bf1d71ca 100644
--- a/src/plugins/platforms/windows/qtwindowsglobal.h
+++ b/src/plugins/platforms/windows/qtwindowsglobal.h
@@ -89,6 +89,7 @@ enum WindowsEventType // Simplify event types
CursorEvent = MouseEventFlag + 3,
TouchEvent = TouchEventFlag + 1,
NonClientMouseEvent = NonClientEventFlag + MouseEventFlag + 1,
+ NonClientHitTest = NonClientEventFlag + 2,
KeyEvent = KeyEventFlag + 1,
KeyDownEvent = KeyEventFlag + KeyDownEventFlag + 1,
InputMethodKeyEvent = InputMethodEventFlag + KeyEventFlag + 1,
@@ -143,6 +144,10 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI
return QtWindows::ResizeEvent;
case WM_NCCALCSIZE:
return QtWindows::CalculateSize;
+#ifndef Q_OS_WINCE
+ case WM_NCHITTEST:
+ return QtWindows::NonClientHitTest;
+#endif // !Q_OS_WINCE
case WM_GETMINMAXINFO:
return QtWindows::QuerySizeHints;
case WM_KEYDOWN: // keyboard event
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index de0a583e58..132b3684e9 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -839,7 +839,9 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
return true;// maybe available on some SDKs revisit WM_NCCALCSIZE
case QtWindows::CalculateSize:
return QWindowsGeometryHint::handleCalculateSize(platformWindow->customMargins(), msg, result);
-#endif
+ case QtWindows::NonClientHitTest:
+ return platformWindow->handleNonClientHitTest(QPoint(msg.pt.x, msg.pt.y), result);
+#endif // !Q_OS_WINCE
case QtWindows::ExposeEvent:
return platformWindow->handleWmPaint(hwnd, message, wParam, lParam);
case QtWindows::NonClientMouseEvent:
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index e7e964a128..8ec10294a2 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1796,6 +1796,47 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const
if (QWindowsContext::verboseWindows)
qDebug() << __FUNCTION__ << window() << *mmi;
}
+
+bool QWindowsWindow::handleNonClientHitTest(const QPoint &globalPos, LRESULT *result) const
+{
+ // QTBUG-32663, suppress resize cursor for fixed size windows.
+ const QWindow *w = window();
+ if (!w->isTopLevel() // Task 105852, minimized windows need to respond to user input.
+ || (m_windowState != Qt::WindowNoState && m_windowState != Qt::WindowActive)
+ || (m_data.flags & Qt::FramelessWindowHint)) {
+ return false;
+ }
+ const QSize minimumSize = w->minimumSize();
+ if (minimumSize.isEmpty())
+ return false;
+ const QSize maximumSize = w->maximumSize();
+ const bool fixedWidth = minimumSize.width() == maximumSize.width();
+ const bool fixedHeight = minimumSize.height() == maximumSize.height();
+ if (!fixedWidth && !fixedHeight)
+ return false;
+ const QPoint localPos = w->mapFromGlobal(globalPos);
+ const QSize size = w->size();
+ if (fixedHeight) {
+ if (localPos.y() >= size.height()) {
+ *result = HTBORDER; // Unspecified border, no resize cursor.
+ return true;
+ }
+ if (localPos.y() < 0) {
+ const QMargins margins = frameMargins();
+ const int topResizeBarPos = margins.left() - margins.top();
+ if (localPos.y() < topResizeBarPos) {
+ *result = HTCAPTION; // Extend caption over top resize bar, let's user move the window.
+ return true;
+ }
+ }
+ }
+ if (fixedWidth && (localPos.x() < 0 || localPos.x() >= size.width())) {
+ *result = HTBORDER; // Unspecified border, no resize cursor.
+ return true;
+ }
+ return false;
+}
+
#endif // !Q_OS_WINCE
#ifndef QT_NO_CURSOR
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index 996542f92a..f7d142fc36 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -234,7 +234,8 @@ public:
void releaseDC();
#ifndef Q_OS_WINCE // maybe available on some SDKs revisit WM_GETMINMAXINFO
void getSizeHints(MINMAXINFO *mmi) const;
-#endif
+ bool handleNonClientHitTest(const QPoint &globalPos, LRESULT *result) const;
+#endif // !Q_OS_WINCE
#ifndef QT_NO_CURSOR
QWindowsWindowCursor cursor() const { return m_cursor; }
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index ee1fe44530..b144d953a7 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -419,8 +419,6 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
touchPoint.state = Qt::TouchPointMoved;
dev->pointPressedPosition[touchPoint.id] = QPointF(x, y);
}
- else
- touchPoint.state = Qt::TouchPointStationary;
break;
case XI_TouchEnd:
touchPoint.state = Qt::TouchPointReleased;
@@ -442,9 +440,13 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
" area " << touchPoint.area << " pressure " << touchPoint.pressure;
#endif
QWindowSystemInterface::handleTouchEvent(platformWindow->window(), xiEvent->time, dev->qtTouchDevice, m_touchPoints.values());
- // If a touchpoint was released, we can forget it, because the ID won't be reused.
if (touchPoint.state == Qt::TouchPointReleased)
+ // If a touchpoint was released, we can forget it, because the ID won't be reused.
m_touchPoints.remove(touchPoint.id);
+ else
+ // Make sure that we don't send TouchPointPressed/Moved in more than one QTouchEvent
+ // with this touch point if the next XI2 event is about a different touch point.
+ touchPoint.state = Qt::TouchPointStationary;
}
}
#endif // XCB_USE_XINPUT22
diff --git a/src/src.pro b/src/src.pro
index 6815fe4a75..c6ae533cff 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -143,5 +143,9 @@ nacl: SUBDIRS -= src_network src_testlib
android:!android-no-sdk: SUBDIRS += src_android
+TR_EXCLUDE = \
+ src_tools_bootstrap src_tools_moc src_tools_rcc src_tools_uic \
+ src_tools_bootstrap_dbus src_tools_qdbusxml2cpp src_tools_qdbuscpp2xml
+
sub-tools.depends = $$TOOLS
-QMAKE_EXTRA_TARGETS = sub-tools
+QMAKE_EXTRA_TARGETS = sub-tools \ No newline at end of file
diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp
index 99c7ec749d..d094372d0b 100644
--- a/src/testlib/qtestlog.cpp
+++ b/src/testlib/qtestlog.cpp
@@ -76,14 +76,6 @@ static void saveCoverageTool(const char * appname, bool testfailed, bool install
#endif
}
-//
-// declare deprecated API from qlogging.h locally
-// (we can't use qInstallMessageHandler because it would break
-// tests that (still) rely on qInstallMsgHandler.)
-//
-typedef void (*QtMsgHandler)(QtMsgType, const char *);
-Q_CORE_EXPORT QtMsgHandler qInstallMsgHandler(QtMsgHandler);
-
namespace QTest {
int fails = 0;
@@ -212,7 +204,7 @@ namespace QTest {
static int maxWarnings = 2002;
static bool installedTestCoverage = true;
- static QtMsgHandler oldMessageHandler;
+ static QtMessageHandler oldMessageHandler;
static bool handleIgnoredMessage(QtMsgType type, const char *msg)
{
@@ -238,23 +230,17 @@ namespace QTest {
return false;
}
-// don't warn about qInstallMsgHandler
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) && !defined(Q_CC_INTEL)
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
-
- static void messageHandler(QtMsgType type, const char *msg)
+ static void messageHandler(QtMsgType type, const QMessageLogContext & /*context*/, const QString &message)
{
static QBasicAtomicInt counter = Q_BASIC_ATOMIC_INITIALIZER(QTest::maxWarnings);
- if (!msg || QTest::TestLoggers::loggerCount() == 0) {
+ if (QTest::TestLoggers::loggerCount() == 0) {
// if this goes wrong, something is seriously broken.
- qInstallMsgHandler(oldMessageHandler);
- QTEST_ASSERT(msg);
+ qInstallMessageHandler(oldMessageHandler);
QTEST_ASSERT(QTest::TestLoggers::loggerCount() != 0);
}
+ QByteArray msg = message.toLocal8Bit();
if (handleIgnoredMessage(type, msg))
// the message is expected, so just swallow it.
return;
@@ -293,10 +279,6 @@ namespace QTest {
break;
}
}
-
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) && !defined(Q_CC_INTEL)
-# pragma GCC diagnostic pop
-#endif
}
void QTestLog::enterTestFunction(const char* function)
@@ -399,31 +381,21 @@ void QTestLog::addBenchmarkResult(const QBenchmarkResult &result)
QTest::TestLoggers::addBenchmarkResult(result);
}
-// don't warn about qInstallMsgHandler
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) && !defined(Q_CC_INTEL)
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
-
void QTestLog::startLogging()
{
QTest::TestLoggers::startLogging();
- QTest::oldMessageHandler = qInstallMsgHandler(QTest::messageHandler);
+ QTest::oldMessageHandler = qInstallMessageHandler(QTest::messageHandler);
}
void QTestLog::stopLogging()
{
- qInstallMsgHandler(QTest::oldMessageHandler);
+ qInstallMessageHandler(QTest::oldMessageHandler);
QTest::TestLoggers::stopLogging();
QTest::TestLoggers::destroyLoggers();
QTest::loggerUsingStdout = false;
saveCoverageTool(QTestResult::currentAppname(), failCount() != 0, QTestLog::installedTestCoverage());
}
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) && !defined(Q_CC_INTEL)
-# pragma GCC diagnostic pop
-#endif
-
void QTestLog::addLogger(LogMode mode, const char *filename)
{
if (filename && strcmp(filename, "-") == 0)
diff --git a/src/testlib/qtestmouse.h b/src/testlib/qtestmouse.h
index 4d70aff27e..8efa80789c 100644
--- a/src/testlib/qtestmouse.h
+++ b/src/testlib/qtestmouse.h
@@ -61,6 +61,8 @@
#include <QtWidgets/qwidget.h>
#endif
+#include <QDebug>
+
QT_BEGIN_NAMESPACE
Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *w, const QPointF & local, const QPointF & global, Qt::MouseButtons b, Qt::KeyboardModifiers mods = Qt::NoModifier);
@@ -84,8 +86,10 @@ namespace QTest
QTEST_ASSERT(window);
extern int Q_TESTLIB_EXPORT defaultMouseDelay();
- if (!window->geometry().contains(pos))
+ // pos is in window local coordinates
+ if (window->geometry().width() <= pos.x() || window->geometry().height() <= pos.y()) {
QTest::qWarn("Mouse event occurs outside of target window.");
+ }
static Qt::MouseButton lastButton = Qt::NoButton;
diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp
index 749cca0911..431c8dd46c 100644
--- a/src/tools/moc/main.cpp
+++ b/src/tools/moc/main.cpp
@@ -42,7 +42,7 @@
#include "preprocessor.h"
#include "moc.h"
#include "outputrevision.h"
-#include <qconfig.cpp>
+
#include <qfile.h>
#include <qfileinfo.h>
#include <qdir.h>
diff --git a/src/tools/moc/moc.pro b/src/tools/moc/moc.pro
index d56c2805eb..d39749a318 100644
--- a/src/tools/moc/moc.pro
+++ b/src/tools/moc/moc.pro
@@ -3,8 +3,6 @@ CONFIG += force_bootstrap
DEFINES += QT_MOC QT_NO_CAST_FROM_ASCII QT_NO_CAST_FROM_BYTEARRAY QT_NO_COMPRESS
-INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
-
include(moc.pri)
HEADERS += qdatetime_p.h
SOURCES += main.cpp
diff --git a/src/tools/qdoc/doc/qtgui-qdocconf.qdoc b/src/tools/qdoc/doc/qtgui-qdocconf.qdoc
new file mode 100644
index 0000000000..7e6da0feb5
--- /dev/null
+++ b/src/tools/qdoc/doc/qtgui-qdocconf.qdoc
@@ -0,0 +1,292 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+
+\page qtgui-qdocconf.html
+\title qtgui.qdocconf with Comments
+
+\brief A walkthrough of a typical qdocconf file
+
+This document goes through a typical Qt 5 qdocconf file. The contents is taken from
+Qt GUI's \e qtgui.qdocconf file.
+
+Below you will find the full contents of qtgui.qdocconf. The subsequent section will discuss
+every statement in the qdocconf file.
+
+\code
+ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+
+ project = QtGui
+ description = Qt GUI Reference Documentation
+ url = http://qt-project.org/doc/qt-$QT_VER/qtgui
+ version = $QT_VERSION
+
+ examplesinstallpath = gui
+
+ qhp.projects = QtGui
+
+ qhp.QtGui.file = qtgui.qhp
+ qhp.QtGui.namespace = org.qt-project.qtgui.$QT_VERSION_TAG
+ qhp.QtGui.virtualFolder = qtgui
+ qhp.QtGui.indexTitle = Qt GUI
+ qhp.QtGui.indexRoot =
+
+ qhp.QtGui.filterAttributes = qtgui $QT_VERSION qtrefdoc
+ qhp.QtGui.customFilters.Qt.name = Qtgui $QT_VERSION
+ qhp.QtGui.customFilters.Qt.filterAttributes = qtgui $QT_VERSION
+
+ qhp.QtGui.subprojects = classes
+ qhp.QtGui.subprojects.classes.title = C++ Classes
+ qhp.QtGui.subprojects.classes.indexTitle = Qt GUI C++ Classes
+ qhp.QtGui.subprojects.classes.selectors = class fake:headerfile
+ qhp.QtGui.subprojects.classes.sortPages = true
+
+ tagfile = ../../../doc/qtgui/qtgui.tags
+
+ depends += \
+ qtcore \
+ qtnetwork \
+ qtopengl \
+ qtsvg \
+ qtqml \
+ qtquick \
+ qtwidgets \
+ qtdoc
+
+ headerdirs += ..
+
+ sourcedirs += .. \
+ ../../../examples/gui/doc/src
+
+ exampledirs += ../../../examples/gui \
+ snippets
+
+ imagedirs += images \
+ ../../../examples/gui/doc/images \
+ ../../../doc/src/images \
+\endcode
+
+\title Qtgui.qdocconf with notes
+
+\code
+ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+\endcode
+
+QDoc inherits the default templates, macros, and settings from the directory
+specified from the \c $QT_INSTALL_DOCS variable. \c qmake prints the value of
+the variable.
+\code
+ qmake -query
+\endcode
+
+\sa include
+
+\code
+ project = QtGui
+\endcode
+
+The \c project variable sets the name of the QDoc build. This name is also
+used to form the index file, which, in this case, will be \e qtgui.index. The
+name of the index file doesn't adopt the uppercase letters of the project name.
+
+\sa project
+
+\code
+ description = Qt GUI Reference Documentation
+\endcode
+
+A short description of the project concerned.
+
+\code
+ url = http://qt-project.org/doc/qt-$QT_VER/qtgui
+\endcode
+
+The \c url variable holds the base url of the project.
+
+The URL is stored in the generated index file for the project.
+QDoc will use this as the base URL when constructing links
+to content listed in the index.
+
+\note QDoc omits this value when the -installdir argument
+is specified when running QDoc.
+
+\keyword examplesinstallpath
+
+\code
+ examplesinstallpath = gui
+\endcode
+
+This \e examplesinstallpath variable indicates that the examples will be installed
+in the \e gui directory under the parent examples directory (for Qt, this is
+$QT_INSTALL_EXAMPLES).
+
+\note The examplepath variable has to match the example directory specified in exampledirs.
+\sa exampledirs
+
+\code
+ qhp.projects = QtGui
+ qhp.QtGui.file = qtgui.qhp
+\endcode
+
+The following parameters are for creating a QHP file (\e .qhp). The qhelpgenerator
+program can convert the QHP file into a QCH file (\e .qch), which can be opened in
+Qt Assistant or Qt Creator.
+
+\code
+ qhp.QtGui.namespace = org.qt-project.qtgui.$QT_VERSION_TAG
+\endcode
+
+A unique identifier which enables QHelpEngine to retrieve the helpfile
+from a given link. This namespace is also used as a base url for links
+to the helpfile.
+
+\code
+ qhp.QtGui.virtualFolder = qtgui
+\endcode
+
+Virtual folders group documentation together into a single location. A
+virtual folder will become the root directory of all files referenced in a
+compressed help file.
+
+When two manuals are located in the same virtual folder, it is possible to refer
+ to sections of the other manual using relative paths.
+The virtual folder tag is mandatory and the folder must not contain any '/'.
+
+\code
+ qhp.QtGui.indexTitle = Qt GUI the title of the page that has the contents
+\endcode
+
+This is the title of the page that has the contents.
+
+\code
+ qhp.QtGui.indexRoot = to be checked
+\endcode
+
+Specifies the title of the root (namespace) page to generate the documentation for.
+Typically defined as an empty string.
+
+\code
+ qhp.QtGui.filterAttributes = qtgui $QT_VERSION qtrefdoc
+ qhp.QtGui.customFilters.Qt.name = QtGui $QT_VERSION
+ qhp.QtGui.customFilters.Qt.filterAttributes = qtgui $QT_VERSION
+\endcode
+
+The documentation set (one per QDoc project) can have any number of filter
+attributes assigned to it. A filter attribute is an ordinary string which
+can be freely chosen. Additionally, custom filters that reference above
+attributes can be defined. Qt Assistant will display the name of the custom
+filter in its \gui{Filtered by} drop-down list. Only the documentation sets
+that have their filter attributes match the attributes of the selected
+custom filter will be shown.
+
+\code
+ qhp.QtGui.subprojects = classes
+ qhp.QtGui.subprojects.classes.title = C++ Classes
+ qhp.QtGui.subprojects.classes.indexTitle = Qt GUI C++ Classes
+\endcode
+The subprojects specify the sections that are displayed in the table of contents
+for this project. In this example, the subproject, which is displayed in
+the Assistant's sidebar, is named "C++ Classes" and its index is the page
+titled "QT GUI C++ Classes".
+
+\code
+ qhp.QtGui.subprojects.classes.selectors = class fake:headerfile
+\endcode
+
+Lists all headerfiles.
+
+A ‘fake’ type specifies a generic documentation node, and is followed by
+a c\ : and a \e subtype specifier.
+
+Possible values:
+\code
+ example
+ headerfile
+ file
+ group
+ module
+ page
+ externalpage
+ qmlclass
+ qmlpropertygroup
+ qmlbasictype
+\endcode
+
+tagfile = ../../../doc/qtgui/qtgui.tags
+This specifies the Doxygen tag file that needs to be written when the html is generated
+by QDoc.
+
+\code
+depends += \
+ qtcore \
+ qtnetwork \
+ qtopengl \
+ qtsvg \
+ qtqml \
+ qtquick \
+ qtwidgets \
+ qtdoc
+\endcode
+
+Specifies the modules QDoc needs to load for generating output for Qt GUI.
+QDoc loads the index files for all modules listed in the depends statement in
+order to enable linking to pages in these modules.
+
+\code
+ headerdirs += ..
+\endcode
+
+Add the parent directory to the list of directories containing the header files
+associated with the \e .cpp source files.
+
+\code
+ sourcedirs += .. \
+ ../../../examples/gui/doc/src
+\endcode
+
+Add the specified directories to the list of directories containing the \e .cpp and
+\e .qdoc files used in the documentation.
+
+\code
+ exampledirs += ../../../examples/gui \
+ snippets
+\endcode
+\sa examplesinstallpath
+
+Add the two directories specified to the list of directories containing the source
+code of the example files.
+
+\code
+ imagedirs += images \
+ ../../../examples/gui/doc/images \
+ ../../../doc/src/images \
+\endcode
+
+Add the directories specified above to the list of directories where the images
+can be found.
+*/
diff --git a/src/tools/uic/main.cpp b/src/tools/uic/main.cpp
index baafb8ec92..a25a40052e 100644
--- a/src/tools/uic/main.cpp
+++ b/src/tools/uic/main.cpp
@@ -42,7 +42,7 @@
#include "uic.h"
#include "option.h"
#include "driver.h"
-#include "../../corelib/global/qconfig.cpp"
+
#include <qfile.h>
#include <qdir.h>
#include <qtextstream.h>
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index e0034d1298..75cd07bb80 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -2711,11 +2711,13 @@ void QHeaderView::paintSection(QPainter *painter, const QRect &rect, int logical
// the section position
int visual = visualIndex(logicalIndex);
Q_ASSERT(visual != -1);
- if (count() == 1)
+ bool first = d->isFirstVisibleSection(visual);
+ bool last = d->isLastVisibleSection(visual);
+ if (first && last)
opt.position = QStyleOptionHeader::OnlyOneSection;
- else if (visual == 0)
+ else if (first)
opt.position = QStyleOptionHeader::Beginning;
- else if (visual == count() - 1)
+ else if (last)
opt.position = QStyleOptionHeader::End;
else
opt.position = QStyleOptionHeader::Middle;
@@ -3138,6 +3140,22 @@ bool QHeaderViewPrivate::isSectionSelected(int section) const
return s;
}
+bool QHeaderViewPrivate::isFirstVisibleSection(int section) const
+{
+ if (sectionStartposRecalc)
+ recalcSectionStartPos();
+ const SectionItem &item = sectionItems.at(section);
+ return item.size > 0 && item.calculated_startpos == 0;
+}
+
+bool QHeaderViewPrivate::isLastVisibleSection(int section) const
+{
+ if (sectionStartposRecalc)
+ recalcSectionStartPos();
+ const SectionItem &item = sectionItems.at(section);
+ return item.size > 0 && item.calculatedEndPos() == length;
+}
+
/*!
\internal
Returns the last visible (ie. not hidden) visual index
diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h
index 2bbd21a942..a8c620b9d2 100644
--- a/src/widgets/itemviews/qheaderview_p.h
+++ b/src/widgets/itemviews/qheaderview_p.h
@@ -115,6 +115,8 @@ public:
void _q_layoutChanged();
bool isSectionSelected(int section) const;
+ bool isFirstVisibleSection(int section) const;
+ bool isLastVisibleSection(int section) const;
inline bool rowIntersectsSelection(int row) const {
return (selectionModel ? selectionModel->rowIntersectsSelection(row, root) : false);
diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp
index b2409e300c..13c9bf8deb 100644
--- a/src/widgets/widgets/qmdiarea.cpp
+++ b/src/widgets/widgets/qmdiarea.cpp
@@ -2043,7 +2043,7 @@ void QMdiArea::setBackground(const QBrush &brush)
if (d->background != brush) {
d->background = brush;
d->viewport->setAttribute(Qt::WA_OpaquePaintEvent, brush.isOpaque());
- update();
+ d->viewport->update();
}
}