summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-03-06 14:38:07 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-03-06 14:38:07 +0100
commit49a2ec05b43b49d06dba8c6909c9df8d308e127d (patch)
tree46d596c4c0e184aab0d4698f05247d1ed13c7e9a
parentb86106387350f673a20d3b0a2413023f6205169b (diff)
parent31c5b34e808db102bfc5364405711ec94fe51f0a (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/plugins/platforms/qnx/qqnxscreen.cpp src/plugins/platforms/windows/qwindowsdialoghelpers.cpp Change-Id: Ib64f21c077b54f2291d19187590bfe869b98477a
-rw-r--r--examples/widgets/tools/customcompleter/doc/src/customcompleter.qdoc (renamed from examples/tools/doc/src/customcompleter.qdoc)40
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp5
-rw-r--r--qmake/option.cpp3
-rw-r--r--qmake/option.h1
-rw-r--r--src/corelib/doc/src/objectmodel/object.qdoc6
-rw-r--r--src/corelib/global/qcompilerdetection.h1
-rw-r--r--src/corelib/kernel/qobject.cpp4
-rw-r--r--src/corelib/kernel/qobjectdefs_impl.h4
-rw-r--r--src/corelib/mimetypes/qmimedatabase.cpp2
-rw-r--r--src/corelib/tools/qdatetime.cpp10
-rw-r--r--src/corelib/xml/qxmlstream.cpp2
-rw-r--r--src/corelib/xml/qxmlstream_p.h1
-rw-r--r--src/dbus/dbus.pro4
-rw-r--r--src/network/socket/qnativesocketengine.cpp10
-rw-r--r--src/platformsupport/linuxaccessibility/application.cpp14
-rw-r--r--src/platformsupport/linuxaccessibility/application_p.h3
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm1
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp7
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp9
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.h2
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp2
-rw-r--r--src/tools/qdoc/doc.cpp2
-rw-r--r--src/tools/qdoc/generator.cpp2
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp16
-rw-r--r--src/tools/qdoc/qmlvisitor.cpp32
-rw-r--r--src/tools/qdoc/qmlvisitor.h5
-rw-r--r--src/widgets/doc/images/customcompleter-example.png (renamed from doc/src/images/customcompleter-example.png)bin11636 -> 11636 bytes
-rw-r--r--src/widgets/doc/images/customcompleter-insertcompletion.png (renamed from doc/src/images/customcompleter-insertcompletion.png)bin1371 -> 1371 bytes
-rw-r--r--src/widgets/styles/qcommonstyle.cpp6
-rw-r--r--tests/auto/corelib/kernel/kernel.pro1
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp4
-rw-r--r--tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp2
34 files changed, 143 insertions, 70 deletions
diff --git a/examples/tools/doc/src/customcompleter.qdoc b/examples/widgets/tools/customcompleter/doc/src/customcompleter.qdoc
index f9ad3a43e9..a6c425d4c8 100644
--- a/examples/tools/doc/src/customcompleter.qdoc
+++ b/examples/widgets/tools/customcompleter/doc/src/customcompleter.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2012 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.
@@ -26,9 +26,11 @@
****************************************************************************/
/*!
- \example customcompleter
+ \example tools/customcompleter
\title Custom Completer Example
+ \ingroup examples-widgets-tools
+
\brief The Custom Completer example shows how to provide string-completion
facilities for an input widget based on data provided by a model. The
completer pops up suggestions for possible words based on the first three
@@ -43,7 +45,7 @@
that has a list of words to help QCompleter complete words. This file
contains the following:
- \quotefile customcompleter/customcompleter.qrc
+ \quotefile tools/customcompleter/customcompleter.qrc
\section1 TextEdit Class Definition
@@ -54,7 +56,7 @@
contains a private function \c textUnderCursor() and a private instance
of QCompleter, \c c.
- \snippet customcompleter/textedit.h 0
+ \snippet tools/customcompleter/textedit.h 0
\section1 TextEdit Class Implementation
@@ -63,11 +65,11 @@
the \c TextEdit object, using the
\l{QTextEdit::setPlainText()}{setPlainText()} function.
- \snippet customcompleter/textedit.cpp 0
+ \snippet tools/customcompleter/textedit.cpp 0
In addition, \c TextEdit also includes a default destructor:
- \snippet customcompleter/textedit.cpp 1
+ \snippet tools/customcompleter/textedit.cpp 1
The \c setCompleter() function accepts a \a completer and sets it up.
We use \c{if (c)} to check if \c c has been initialized. If it has been
@@ -75,7 +77,7 @@
the signal from the slot. This is to ensure that no previous completer
object is still connected to the slot.
- \snippet customcompleter/textedit.cpp 2
+ \snippet tools/customcompleter/textedit.cpp 2
We then instantiate \c c with \a completer and set it as \c{TextEdit}'s
widget. The completion mode and case sensitivity are also set and then
@@ -84,7 +86,7 @@
The \c completer() function is a getter function that returns \c c.
- \snippet customcompleter/textedit.cpp 3
+ \snippet tools/customcompleter/textedit.cpp 3
The completer pops up the options available, based on the contents of
\e wordlist.txt, but the text cursor is responsible for filling in the
@@ -99,7 +101,7 @@
completer's widget is \c TextEdit before using \c tc to insert the extra
characters to complete the word.
- \snippet customcompleter/textedit.cpp 4
+ \snippet tools/customcompleter/textedit.cpp 4
The figure below illustrates this process:
@@ -116,13 +118,13 @@
The \c textUnderCursor() function uses a QTextCursor, \c tc, to select a
word under the cursor and return it.
- \snippet customcompleter/textedit.cpp 5
+ \snippet tools/customcompleter/textedit.cpp 5
The \c TextEdit class reimplements \l{QWidget::focusInEvent()}
{focusInEvent()} function, which is an event handler used to receive
keyboard focus events for the widget.
- \snippet customcompleter/textedit.cpp 6
+ \snippet tools/customcompleter/textedit.cpp 6
The \l{QAbstractScrollArea::keyPressEvent()}{keyPressEvent()} is
reimplemented to ignore key events like Qt::Key_Enter, Qt::Key_Return,
@@ -131,12 +133,12 @@
If there is an active completer, we cannot process the shortcut, Ctrl+E.
- \snippet customcompleter/textedit.cpp 7
+ \snippet tools/customcompleter/textedit.cpp 7
We also handle other modifiers and shortcuts for which we do not want the
completer to respond to.
- \snippet customcompleter/textedit.cpp 8
+ \snippet tools/customcompleter/textedit.cpp 8
Finally, we pop up the completer.
@@ -147,7 +149,7 @@
\c createMenu() and \c modelFromFile() as well as private instances of
QCompleter and \c TextEdit.
- \snippet customcompleter/mainwindow.h 0
+ \snippet tools/customcompleter/mainwindow.h 0
\section1 MainWindow Class Implementation
@@ -157,31 +159,31 @@
to populate the \c completer. The \c{MainWindow}'s central widget is set
to \c TextEdit and its size is set to 500 x 300.
- \snippet customcompleter/mainwindow.cpp 0
+ \snippet tools/customcompleter/mainwindow.cpp 0
The \c createMenu() function creates the necessary QAction objects needed
for the "File" and "Help" menu and their \l{QAction::triggered()}
{triggered()} signals are connected to the \c quit(), \c about(), and
\c aboutQt() slots respectively.
- \snippet customcompleter/mainwindow.cpp 1
+ \snippet tools/customcompleter/mainwindow.cpp 1
The \c modelFromFile() function accepts a \a fileName and attempts to
extract the contents of this file into a QStringListModel. We display the
Qt::WaitCursor when we are populating the QStringList, \c words, and
restore the mouse cursor when we are done.
- \snippet customcompleter/mainwindow.cpp 2
+ \snippet tools/customcompleter/mainwindow.cpp 2
The \c about() function provides a brief description about the Custom
Completer example.
- \snippet customcompleter/mainwindow.cpp 3
+ \snippet tools/customcompleter/mainwindow.cpp 3
\section1 \c main() Function
The \c main() function instantiates \c MainWindow and invokes the
\l{QWidget::show()}{show()} function.
- \snippet customcompleter/main.cpp 0
+ \snippet tools/customcompleter/main.cpp 0
*/
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index 0658eef391..54dea886af 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -307,6 +307,11 @@ void NmakeMakefileGenerator::init()
project->values("QMAKE_CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".ilk");
project->values("QMAKE_CLEAN").append("vc*.pdb");
project->values("QMAKE_CLEAN").append("vc*.idb");
+ project->values("DEFINES").removeAll("NDEBUG");
+ } else {
+ ProStringList &defines = project->values("DEFINES");
+ if (!defines.contains("NDEBUG"))
+ defines.append("NDEBUG");
}
}
diff --git a/qmake/option.cpp b/qmake/option.cpp
index fdf11d9266..983d3490d8 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -57,7 +57,6 @@ ProFileCache *Option::proFileCache;
QMakeParser *Option::parser;
//convenience
-const char *Option::application_argv0 = 0;
QString Option::prf_ext;
QString Option::prl_ext;
QString Option::libtool_ext;
@@ -318,13 +317,11 @@ Option::parseCommandLine(QStringList &args, QMakeCmdLineParserState &state)
int
Option::init(int argc, char **argv)
{
- Option::application_argv0 = 0;
Option::prf_ext = ".prf";
Option::pro_ext = ".pro";
Option::field_sep = ' ';
if(argc && argv) {
- Option::application_argv0 = argv[0];
QString argv0 = argv[0];
if(Option::qmake_mode == Option::QMAKE_GENERATE_NOTHING)
Option::qmake_mode = default_mode(argv0);
diff --git a/qmake/option.h b/qmake/option.h
index 541757b264..6225f6b4d2 100644
--- a/qmake/option.h
+++ b/qmake/option.h
@@ -109,7 +109,6 @@ struct Option
static QString pro_ext;
static QString res_ext;
static char field_sep;
- static const char *application_argv0;
enum CmdLineFlags {
QMAKE_CMDLINE_SUCCESS = 0x00,
diff --git a/src/corelib/doc/src/objectmodel/object.qdoc b/src/corelib/doc/src/objectmodel/object.qdoc
index 281c1a30cb..1d33c14d0f 100644
--- a/src/corelib/doc/src/objectmodel/object.qdoc
+++ b/src/corelib/doc/src/objectmodel/object.qdoc
@@ -66,11 +66,7 @@
by Qt's own \l{moc}{Meta-Object Compiler (moc)}.
The meta-object system is a C++ extension that makes the language
- better suited to true component GUI programming. Although
- templates can be used to extend C++, the meta-object system
- provides benefits using standard C++ that cannot be achieved with
- templates; see \l{Why Doesn't Qt Use Templates for Signals and
- Slots?}
+ better suited to true component GUI programming.
\section1 Important Classes
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 383d9c9c6e..e547d58c2e 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -870,6 +870,7 @@
const bool valueOfExpression = Expr;\
Q_ASSERT_X(valueOfExpression, "Q_ASSUME()", "Assumption in Q_ASSUME(\"" #Expr "\") was not correct");\
Q_ASSUME_IMPL(valueOfExpression);\
+ Q_UNUSED(valueOfExpression); /* the value may not be used if Q_ASSERT_X and Q_ASSUME_IMPL are noop */\
} while (0)
#endif // QCOMPILERDETECTION_H
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index e8c30d753e..c96fb446d6 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -4194,7 +4194,7 @@ void qDeleteInEventHandler(QObject *o)
connecting to a static function or a functor
\a slot a pointer only used when using Qt::UniqueConnection
\a type the Qt::ConnctionType passed as argument to connect
- \a types an array of integer with the metatype id of the parametter of the signal
+ \a types an array of integer with the metatype id of the parameter of the signal
to be used with queued connection
must stay valid at least for the whole time of the connection, this function
do not take ownership. typically static data.
@@ -4209,7 +4209,7 @@ QMetaObject::Connection QObject::connectImpl(const QObject *sender, void **signa
const int *types, const QMetaObject *senderMetaObject)
{
if (!sender || !signal || !slotObj || !senderMetaObject) {
- qWarning("QObject::connect: invalid null parametter");
+ qWarning("QObject::connect: invalid null parameter");
if (slotObj)
slotObj->destroyIfLastRef();
return QMetaObject::Connection();
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h
index 8d85175a17..959a255389 100644
--- a/src/corelib/kernel/qobjectdefs_impl.h
+++ b/src/corelib/kernel/qobjectdefs_impl.h
@@ -62,7 +62,7 @@ namespace QtPrivate {
/*
The following List classes are used to help to handle the list of arguments.
It follow the same principles as the lisp lists.
- List_Left<L,N> take a list and a number as a parametter and returns (via the Value typedef,
+ List_Left<L,N> take a list and a number as a parameter and returns (via the Value typedef,
the list composed of the first N element of the list
*/
#ifndef Q_COMPILER_VARIADIC_TEMPLATES
@@ -116,7 +116,7 @@ namespace QtPrivate {
- ArgumentCount is the number of argument, or -1 if it is unknown
- the Object typedef is the Object of a pointer to member function
- the Arguments typedef is the list of argument (in a QtPrivate::List)
- - the Function typedef is an alias to the template parametter Func
+ - the Function typedef is an alias to the template parameter Func
- the call<Args, R>(f,o,args) method is used to call that slot
Args is the list of argument of the signal
R is the return type of the signal
diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp
index d8b7a02a1b..a5f5a326d4 100644
--- a/src/corelib/mimetypes/qmimedatabase.cpp
+++ b/src/corelib/mimetypes/qmimedatabase.cpp
@@ -418,7 +418,7 @@ QMimeType QMimeDatabase::mimeTypeForFile(const QString &fileName, MatchMode mode
} else {
// Implemented as a wrapper around mimeTypeForFile(QFileInfo), so no mutex.
QFileInfo fileInfo(fileName);
- return mimeTypeForFile(fileInfo);
+ return mimeTypeForFile(fileInfo, mode);
}
}
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 83db1c3cc9..31c870b012 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -4045,6 +4045,16 @@ static void localToUtc(QDate &date, QTime &time, int isdst)
_tzset();
#endif
time_t secsSince1Jan1970UTC = mktime(&localTM);
+#ifdef Q_OS_QNX
+ //mktime sometimes fails on QNX. Following workaround converts the date and time then manually
+ if (secsSince1Jan1970UTC == (time_t)-1) {
+ QDateTime tempTime = QDateTime(date, time, Qt::UTC);;
+ tempTime = tempTime.addMSecs(timezone * 1000);
+ date = tempTime.date();
+ time = tempTime.time();
+ return;
+ }
+#endif
#endif
tm *brokenDown = 0;
#if defined(Q_OS_WINCE)
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index 4be4593e95..372b1d91fe 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -784,6 +784,7 @@ QXmlStreamPrivateTagStack::QXmlStreamPrivateTagStack()
NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.push();
namespaceDeclaration.prefix = addToStringStorage(QLatin1String("xml"));
namespaceDeclaration.namespaceUri = addToStringStorage(QLatin1String("http://www.w3.org/XML/1998/namespace"));
+ initialTagStackStringStorageSize = tagStackStringStorageSize;
}
#ifndef QT_NO_XMLSTREAMREADER
@@ -854,6 +855,7 @@ void QXmlStreamReaderPrivate::init()
rawReadBuffer.clear();
dataBuffer.clear();
readBuffer.clear();
+ tagStackStringStorageSize = initialTagStackStringStorageSize;
type = QXmlStreamReader::NoToken;
error = QXmlStreamReader::NoError;
diff --git a/src/corelib/xml/qxmlstream_p.h b/src/corelib/xml/qxmlstream_p.h
index 68b7ff7af3..448764ab58 100644
--- a/src/corelib/xml/qxmlstream_p.h
+++ b/src/corelib/xml/qxmlstream_p.h
@@ -697,6 +697,7 @@ public:
QXmlStreamSimpleStack<NamespaceDeclaration> namespaceDeclarations;
QString tagStackStringStorage;
int tagStackStringStorageSize;
+ int initialTagStackStringStorageSize;
bool tagsDone;
inline QStringRef addToStringStorage(const QStringRef &s) {
diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro
index 5ad77ddf95..2e4119ba93 100644
--- a/src/dbus/dbus.pro
+++ b/src/dbus/dbus.pro
@@ -6,6 +6,8 @@ MODULE_CONFIG = dbusadaptors dbusinterfaces
!isEmpty(DBUS_PATH) {
INCLUDEPATH += $$DBUS_PATH/include
QMAKE_LIBDIR += $$DBUS_PATH/lib
+ win32:CONFIG(debug, debug|release):QT_LIBS_DBUS += -ldbus-1d
+ else:QT_LIBS_DBUS += -ldbus-1
}
DEFINES += DBUS_API_SUBJECT_TO_CHANGE
@@ -21,8 +23,6 @@ win32 {
-ladvapi32 \
-lnetapi32 \
-luser32
- CONFIG(debug, debug|release):LIBS_PRIVATE += -ldbus-1d
- else:LIBS_PRIVATE += -ldbus-1
}
QMAKE_DOCS = $$PWD/doc/qtdbus.qdocconf
diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp
index 6dbc25db4c..02f78aeaed 100644
--- a/src/network/socket/qnativesocketengine.cpp
+++ b/src/network/socket/qnativesocketengine.cpp
@@ -623,8 +623,8 @@ int QNativeSocketEngine::accept()
{
Q_D(QNativeSocketEngine);
Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::accept(), -1);
- Q_CHECK_STATE(QNativeSocketEngine::accept(), QAbstractSocket::ListeningState, false);
- Q_CHECK_TYPE(QNativeSocketEngine::accept(), QAbstractSocket::TcpSocket, false);
+ Q_CHECK_STATE(QNativeSocketEngine::accept(), QAbstractSocket::ListeningState, -1);
+ Q_CHECK_TYPE(QNativeSocketEngine::accept(), QAbstractSocket::TcpSocket, -1);
return d->nativeAccept();
}
@@ -702,7 +702,7 @@ qint64 QNativeSocketEngine::bytesAvailable() const
{
Q_D(const QNativeSocketEngine);
Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::bytesAvailable(), -1);
- Q_CHECK_NOT_STATE(QNativeSocketEngine::bytesAvailable(), QAbstractSocket::UnconnectedState, false);
+ Q_CHECK_NOT_STATE(QNativeSocketEngine::bytesAvailable(), QAbstractSocket::UnconnectedState, -1);
return d->nativeBytesAvailable();
}
@@ -732,7 +732,7 @@ qint64 QNativeSocketEngine::pendingDatagramSize() const
{
Q_D(const QNativeSocketEngine);
Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::pendingDatagramSize(), -1);
- Q_CHECK_TYPE(QNativeSocketEngine::pendingDatagramSize(), QAbstractSocket::UdpSocket, false);
+ Q_CHECK_TYPE(QNativeSocketEngine::pendingDatagramSize(), QAbstractSocket::UdpSocket, -1);
return d->nativePendingDatagramSize();
}
@@ -757,7 +757,7 @@ qint64 QNativeSocketEngine::readDatagram(char *data, qint64 maxSize, QHostAddres
{
Q_D(QNativeSocketEngine);
Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::readDatagram(), -1);
- Q_CHECK_TYPE(QNativeSocketEngine::readDatagram(), QAbstractSocket::UdpSocket, false);
+ Q_CHECK_TYPE(QNativeSocketEngine::readDatagram(), QAbstractSocket::UdpSocket, -1);
return d->nativeReceiveDatagram(data, maxSize, address, port);
}
diff --git a/src/platformsupport/linuxaccessibility/application.cpp b/src/platformsupport/linuxaccessibility/application.cpp
index 6e826e4432..5c8f2e5fe2 100644
--- a/src/platformsupport/linuxaccessibility/application.cpp
+++ b/src/platformsupport/linuxaccessibility/application.cpp
@@ -174,7 +174,7 @@ bool QSpiApplicationAdaptor::eventFilter(QObject *target, QEvent *event)
SLOT(notifyKeyboardListenerError(QDBusError, QDBusMessage)), timeout);
if (sent) {
//queue the event and send it after callback
- keyEvents.enqueue(QPair<QObject*, QKeyEvent*> (target, copyKeyEvent(keyEvent)));
+ keyEvents.enqueue(QPair<QPointer<QObject>, QKeyEvent*> (QPointer<QObject>(target), copyKeyEvent(keyEvent)));
#ifdef KEYBOARD_DEBUG
qDebug() << QStringLiteral("Sent key: ") << de.text;
#endif
@@ -200,11 +200,12 @@ void QSpiApplicationAdaptor::notifyKeyboardListenerCallback(const QDBusMessage&
}
Q_ASSERT(message.arguments().length() == 1);
if (message.arguments().at(0).toBool() == true) {
- QPair<QObject*, QKeyEvent*> event = keyEvents.dequeue();
+ QPair<QPointer<QObject>, QKeyEvent*> event = keyEvents.dequeue();
delete event.second;
} else {
- QPair<QObject*, QKeyEvent*> event = keyEvents.dequeue();
- QCoreApplication::postEvent(event.first, event.second);
+ QPair<QPointer<QObject>, QKeyEvent*> event = keyEvents.dequeue();
+ if (event.first)
+ QCoreApplication::postEvent(event.first.data(), event.second);
}
}
@@ -212,8 +213,9 @@ void QSpiApplicationAdaptor::notifyKeyboardListenerError(const QDBusError& error
{
qWarning() << QStringLiteral("QSpiApplication::keyEventError ") << error.name() << error.message();
while (!keyEvents.isEmpty()) {
- QPair<QObject*, QKeyEvent*> event = keyEvents.dequeue();
- QCoreApplication::postEvent(event.first, event.second);
+ QPair<QPointer<QObject>, QKeyEvent*> event = keyEvents.dequeue();
+ if (event.first)
+ QCoreApplication::postEvent(event.first.data(), event.second);
}
}
diff --git a/src/platformsupport/linuxaccessibility/application_p.h b/src/platformsupport/linuxaccessibility/application_p.h
index 5efd7089ea..e8684ab2b5 100644
--- a/src/platformsupport/linuxaccessibility/application_p.h
+++ b/src/platformsupport/linuxaccessibility/application_p.h
@@ -42,6 +42,7 @@
#ifndef Q_SPI_APPLICATION_H
#define Q_SPI_APPLICATION_H
+#include <QtCore/QPointer>
#include <QtCore/QQueue>
#include <QtDBus/QDBusConnection>
#include <QtGui/QAccessibleInterface>
@@ -75,7 +76,7 @@ private Q_SLOTS:
private:
static QKeyEvent* copyKeyEvent(QKeyEvent*);
- QQueue<QPair<QObject*, QKeyEvent*> > keyEvents;
+ QQueue<QPair<QPointer<QObject>, QKeyEvent*> > keyEvents;
QDBusConnection dbusConnection;
};
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index 0d90e5d693..6ea68397b6 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -380,7 +380,7 @@ QVariant QGnomeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
return QVariant(QGenericUnixTheme::xdgIconThemePaths());
case QPlatformTheme::StyleNames: {
QStringList styleNames;
- styleNames << QStringLiteral("GTK+") << QStringLiteral("cleanlooks") << QStringLiteral("windows");
+ styleNames << QStringLiteral("GTK+") << QStringLiteral("fusion") << QStringLiteral("windows");
return QVariant(styleNames);
}
case QPlatformTheme::KeyboardScheme:
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 4c58c22644..500eea6f4b 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -777,7 +777,6 @@ void QCocoaWindow::setNSWindow(NSWindow *window)
{
m_nsWindowDelegate = [[QNSWindowDelegate alloc] initWithQCocoaWindow:this];
[window setDelegate:m_nsWindowDelegate];
- [window setAcceptsMouseMovedEvents:YES];
// Prevent Cocoa from releasing the window on close. Qt
// handles the close event asynchronously and we want to
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp
index bd60c6b71d..3e79ca7f1d 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreen.cpp
@@ -151,6 +151,8 @@ QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display,
QQnxScreen::~QQnxScreen()
{
qScreenDebug() << Q_FUNC_INFO;
+ Q_FOREACH (QQnxWindow *childWindow, m_childWindows)
+ childWindow->setScreen(0);
delete m_cursor;
}
@@ -501,6 +503,11 @@ QPlatformCursor * QQnxScreen::cursor() const
return m_cursor;
}
+QPlatformCursor * QQnxScreen::cursor() const
+{
+ return m_cursor;
+}
+
void QQnxScreen::keyboardHeightChanged(int height)
{
if (height == m_keyboardHeight)
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index 43e24034c9..cabbd405e5 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -156,7 +156,8 @@ QQnxWindow::~QQnxWindow()
// Remove from parent's Hierarchy.
removeFromParent();
- m_screen->updateHierarchy();
+ if (m_screen)
+ m_screen->updateHierarchy();
// Cleanup QNX window and its buffers
screen_destroy_window(m_window);
@@ -497,6 +498,11 @@ void QQnxWindow::setScreen(QQnxScreen *platformScreen)
{
qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "platformScreen =" << platformScreen;
+ if (platformScreen == 0) { // The screen has been destroyed
+ m_screen = 0;
+ return;
+ }
+
if (m_screen == platformScreen)
return;
@@ -539,7 +545,7 @@ void QQnxWindow::removeFromParent()
m_parentWindow = 0;
else
qFatal("QQnxWindow: Window Hierarchy broken; window has parent, but parent hasn't got child.");
- } else {
+ } else if (m_screen) {
m_screen->removeWindow(this);
}
}
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index 869e94b566..14bc26f770 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -1495,8 +1495,9 @@ QWindowsNativeDialogBase *QWindowsFileDialogHelper::createNativeDialog()
// Apply settings.
const QSharedPointer<QFileDialogOptions> &opts = options();
m_data.fromOptions(opts);
+ const QFileDialogOptions::FileMode mode = opts->fileMode();
result->setWindowTitle(opts->windowTitle());
- result->setMode(opts->fileMode(), opts->options());
+ result->setMode(mode, opts->options());
result->setHideFiltersDetails(opts->testOption(QFileDialogOptions::HideNameFilterDetails));
const QStringList nameFilters = opts->nameFilters();
if (!nameFilters.isEmpty())
@@ -1513,6 +1514,12 @@ QWindowsNativeDialogBase *QWindowsFileDialogHelper::createNativeDialog()
if (!info.isDir())
result->selectFile(info.fileName());
}
+ // No need to select initialNameFilter if mode is Dir
+ if (mode != QFileDialogOptions::Directory && mode != QFileDialogOptions::DirectoryOnly) {
+ const QString initialNameFilter = opts->initiallySelectedNameFilter();
+ if (!initialNameFilter.isEmpty())
+ result->selectNameFilter(initialNameFilter);
+ }
const QString defaultSuffix = opts->defaultSuffix();
if (!defaultSuffix.isEmpty())
result->setDefaultSuffix(defaultSuffix);
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.h b/src/plugins/platforms/windows/qwindowsmousehandler.h
index b3bfa03380..caf30e6b1a 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.h
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.h
@@ -109,6 +109,8 @@ Qt::KeyboardModifiers QWindowsMouseHandler::keyStateToModifiers(int wParam)
mods |= Qt::ControlModifier;
if (wParam & MK_SHIFT)
mods |= Qt::ShiftModifier;
+ if (GetKeyState(VK_MENU) < 0)
+ mods |= Qt::AltModifier;
return mods;
}
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index bb0092cd54..2d0f537477 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -257,6 +257,8 @@ static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qr
} else {
QWindowsContext::user32dll.setLayeredWindowAttributes(hwnd, 0, (int)(level * 255), LWA_ALPHA);
}
+ } else if (IsWindowVisible(hwnd)) { // Repaint when switching from layered.
+ InvalidateRect(hwnd, NULL, TRUE);
}
#endif // !Q_OS_WINCE
}
diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp
index a0a2e51198..e20e85028f 100644
--- a/src/tools/qdoc/doc.cpp
+++ b/src/tools/qdoc/doc.cpp
@@ -3291,7 +3291,7 @@ QString Doc::canonicalTitle(const QString &title)
for (int i = 0; i != title.size(); ++i) {
uint c = title.at(i).unicode();
if (c >= 'A' && c <= 'Z')
- c -= 'A' - 'a';
+ c += 'a' - 'A';
bool alnum = (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9');
if (alnum) {
result += QLatin1Char(c);
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index 95ba6d28bf..47ebded1b1 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -360,7 +360,7 @@ QString Generator::fileBase(const Node *node) const
QChar c = base.at(i);
uint u = c.unicode();
if (u >= 'A' && u <= 'Z')
- u -= 'A' - 'a';
+ u += 'a' - 'A';
if ((u >= 'a' && u <= 'z') || (u >= '0' && u <= '9')) {
res += QLatin1Char(u);
begun = true;
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp
index 58c674de7a..191da5caf8 100644
--- a/src/tools/qdoc/qdocdatabase.cpp
+++ b/src/tools/qdoc/qdocdatabase.cpp
@@ -291,29 +291,29 @@ DocNode* QDocDatabase::addToModule(const QString& name, Node* node)
*/
DocNode* QDocDatabase::addToQmlModule(const QString& name, Node* node)
{
- QString longQmid, shortQmid;
+ QStringList qmid;
QStringList dotSplit;
QStringList blankSplit = name.split(QLatin1Char(' '));
+ qmid.append(blankSplit[0]);
if (blankSplit.size() > 1) {
- longQmid = blankSplit[0] + blankSplit[1];
+ qmid.append(blankSplit[0] + blankSplit[1]);
dotSplit = blankSplit[1].split(QLatin1Char('.'));
- shortQmid = blankSplit[0] + dotSplit[0];
+ qmid.append(blankSplit[0] + dotSplit[0]);
}
DocNode* dn = findQmlModule(name);
dn->addMember(node);
node->setQmlModuleInfo(name);
if (node->subType() == Node::QmlClass) {
QmlClassNode* n = static_cast<QmlClassNode*>(node);
- QString key = longQmid + "::" + node->name();
- for (int i=0; i<2; ++i) {
+ for (int i=0; i<qmid.size(); ++i) {
+ QString key = qmid[i] + "::" + node->name();
if (!qmlTypeMap_.contains(key))
qmlTypeMap_.insert(key,n);
if (!masterMap_.contains(key))
masterMap_.insert(key,node);
- if (!masterMap_.contains(node->name(),node))
- masterMap_.insert(node->name(),node);
- key = shortQmid + "::" + node->name();
}
+ if (!masterMap_.contains(node->name(),node))
+ masterMap_.insert(node->name(),node);
}
return dn;
}
diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp
index 8b6f81de3e..058ab9a725 100644
--- a/src/tools/qdoc/qmlvisitor.cpp
+++ b/src/tools/qdoc/qmlvisitor.cpp
@@ -424,8 +424,9 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiObjectDefinition *definition)
*/
void QmlDocVisitor::endVisit(QQmlJS::AST::UiObjectDefinition *definition)
{
- if (nestingLevel > 0)
+ if (nestingLevel > 0) {
--nestingLevel;
+ }
lastEndOffset = definition->lastSourceLocation().end();
}
@@ -461,6 +462,26 @@ void QmlDocVisitor::endVisit(QQmlJS::AST::UiImportList *definition)
lastEndOffset = definition->lastSourceLocation().end();
}
+bool QmlDocVisitor::visit(QQmlJS::AST::UiObjectBinding *)
+{
+ ++nestingLevel;
+ return true;
+}
+
+void QmlDocVisitor::endVisit(QQmlJS::AST::UiObjectBinding *)
+{
+ --nestingLevel;
+}
+
+bool QmlDocVisitor::visit(QQmlJS::AST::UiArrayBinding *)
+{
+ return true;
+}
+
+void QmlDocVisitor::endVisit(QQmlJS::AST::UiArrayBinding *)
+{
+}
+
/*!
Visits the public \a member declaration, which can be a
signal or a property. It is a custom signal or property.
@@ -468,8 +489,9 @@ void QmlDocVisitor::endVisit(QQmlJS::AST::UiImportList *definition)
*/
bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member)
{
- if (nestingLevel > 1)
+ if (nestingLevel > 1) {
return true;
+ }
switch (member->type) {
case QQmlJS::AST::UiPublicMember::Signal:
{
@@ -535,8 +557,9 @@ bool QmlDocVisitor::visit(QQmlJS::AST::IdentifierPropertyName *)
*/
bool QmlDocVisitor::visit(QQmlJS::AST::FunctionDeclaration* fd)
{
- if (nestingLevel > 1)
+ if (nestingLevel > 1) {
return true;
+ }
if (current->type() == Node::Document) {
QmlClassNode* qmlClass = static_cast<QmlClassNode*>(current);
if (qmlClass) {
@@ -581,8 +604,9 @@ void QmlDocVisitor::endVisit(QQmlJS::AST::FunctionDeclaration* fd)
*/
bool QmlDocVisitor::visit(QQmlJS::AST::UiScriptBinding* sb)
{
- if (nestingLevel > 1)
+ if (nestingLevel > 1) {
return true;
+ }
if (current->type() == Node::Document) {
QString handler = sb->qualifiedId->name.toString();
if (handler.length() > 2 && handler.startsWith("on") && handler.at(2).isUpper()) {
diff --git a/src/tools/qdoc/qmlvisitor.h b/src/tools/qdoc/qmlvisitor.h
index bfec61eb34..cc00ccbe6c 100644
--- a/src/tools/qdoc/qmlvisitor.h
+++ b/src/tools/qdoc/qmlvisitor.h
@@ -85,6 +85,11 @@ public:
bool visit(QQmlJS::AST::UiPublicMember *member);
void endVisit(QQmlJS::AST::UiPublicMember *definition);
+ virtual bool visit(QQmlJS::AST::UiObjectBinding *);
+ virtual void endVisit(QQmlJS::AST::UiObjectBinding *);
+ virtual void endVisit(QQmlJS::AST::UiArrayBinding *);
+ virtual bool visit(QQmlJS::AST::UiArrayBinding *);
+
bool visit(QQmlJS::AST::IdentifierPropertyName *idproperty);
bool visit(QQmlJS::AST::FunctionDeclaration *);
diff --git a/doc/src/images/customcompleter-example.png b/src/widgets/doc/images/customcompleter-example.png
index a525208118..a525208118 100644
--- a/doc/src/images/customcompleter-example.png
+++ b/src/widgets/doc/images/customcompleter-example.png
Binary files differ
diff --git a/doc/src/images/customcompleter-insertcompletion.png b/src/widgets/doc/images/customcompleter-insertcompletion.png
index 0bb2c25c39..0bb2c25c39 100644
--- a/doc/src/images/customcompleter-insertcompletion.png
+++ b/src/widgets/doc/images/customcompleter-insertcompletion.png
Binary files differ
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 52c733b8ec..64eb76dbb4 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -2265,11 +2265,11 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
case QFrame::VLine: {
QPoint p1, p2;
if (frameShape == QFrame::HLine) {
- p1 = QPoint(opt->rect.x(), opt->rect.height() / 2);
+ p1 = QPoint(opt->rect.x(), opt->rect.y() + opt->rect.height() / 2);
p2 = QPoint(opt->rect.x() + opt->rect.width(), p1.y());
} else {
- p1 = QPoint(opt->rect.x()+opt->rect.width() / 2, 0);
- p2 = QPoint(p1.x(), opt->rect.height());
+ p1 = QPoint(opt->rect.x() + opt->rect.width() / 2, opt->rect.y());
+ p2 = QPoint(p1.x(), p1.y() + opt->rect.height());
}
if (frameShadow == QFrame::Plain) {
QPen oldPen = p->pen();
diff --git a/tests/auto/corelib/kernel/kernel.pro b/tests/auto/corelib/kernel/kernel.pro
index 24b4c6d6eb..73bc71a40a 100644
--- a/tests/auto/corelib/kernel/kernel.pro
+++ b/tests/auto/corelib/kernel/kernel.pro
@@ -33,3 +33,4 @@ SUBDIRS=\
# This test is only applicable on Windows
!win32*:SUBDIRS -= qwineventnotifier
+qnx: SUBDIRS -= qsharedmemory qsystemsemaphore
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
index 79d8b3dfe4..a90bfadd73 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
@@ -442,6 +442,8 @@ void tst_QMimeDatabase::mimeTypeForFileWithContent()
txtTempFile.close();
mime = db.mimeTypeForFile(txtTempFileName);
QCOMPARE(mime.name(), QString::fromLatin1("text/plain"));
+ mime = db.mimeTypeForFile(txtTempFileName, QMimeDatabase::MatchContent);
+ QCOMPARE(mime.name(), QString::fromLatin1("application/smil"));
}
// Test what happens with an incorrect path
@@ -714,6 +716,8 @@ void tst_QMimeDatabase::findByData()
QFileInfo info(filePath);
QString mimeForInfo = database.mimeTypeForFile(info, QMimeDatabase::MatchContent).name();
QCOMPARE(mimeForInfo, resultMimeTypeName);
+ QString mimeForFile = database.mimeTypeForFile(filePath, QMimeDatabase::MatchContent).name();
+ QCOMPARE(mimeForFile, resultMimeTypeName);
}
void tst_QMimeDatabase::findByFile_data()
diff --git a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
index 50952237fa..40f22d6d1e 100644
--- a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
+++ b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
@@ -139,7 +139,7 @@ void tst_PlatformSocketEngine::construction()
QVERIFY(socketDevice.error() == QAbstractSocket::UnknownSocketError);
QTest::ignoreMessage(QtWarningMsg, PLATFORMSOCKETENGINESTRING "::bytesAvailable() was called in QAbstractSocket::UnconnectedState");
- QVERIFY(socketDevice.bytesAvailable() == 0);
+ QVERIFY(socketDevice.bytesAvailable() == -1);
QTest::ignoreMessage(QtWarningMsg, PLATFORMSOCKETENGINESTRING "::hasPendingDatagrams() was called in QAbstractSocket::UnconnectedState");
QVERIFY(!socketDevice.hasPendingDatagrams());