From f43c9697bcae997be3eb6db9504f3d7b64601148 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 27 Sep 2016 14:55:09 +0200 Subject: Plug QMimeData leaks in QXcbClipboard QXcbClipboard failed to delete the various QMimeData instances it owns. For m_xClipboard, where the two QXcbClipboardMime instances are never the same, fix the leak by using a scoped instead of a naked pointer. For m_clientClipboard, where the two QMimeData could be identical objects, keep the naked pointers, but delete the objects manually in the QXcbClipboard destructor, paying attention to the case where they're the same object. Change-Id: I5ce0e3e8fcec068aeb344ca806cdf2667378e946 Reviewed-by: Thiago Macieira --- src/plugins/platforms/xcb/qxcbclipboard.cpp | 12 +++++++----- src/plugins/platforms/xcb/qxcbclipboard.h | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbclipboard.cpp b/src/plugins/platforms/xcb/qxcbclipboard.cpp index 8b75c130fb..d44ebae8f7 100644 --- a/src/plugins/platforms/xcb/qxcbclipboard.cpp +++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp @@ -269,8 +269,6 @@ QXcbClipboard::QXcbClipboard(QXcbConnection *c) { Q_ASSERT(QClipboard::Clipboard == 0); Q_ASSERT(QClipboard::Selection == 1); - m_xClipboard[QClipboard::Clipboard] = 0; - m_xClipboard[QClipboard::Selection] = 0; m_clientClipboard[QClipboard::Clipboard] = 0; m_clientClipboard[QClipboard::Selection] = 0; m_timestamp[QClipboard::Clipboard] = XCB_CURRENT_TIME; @@ -323,6 +321,10 @@ QXcbClipboard::~QXcbClipboard() } free(reply); } + + if (m_clientClipboard[QClipboard::Clipboard] != m_clientClipboard[QClipboard::Selection]) + delete m_clientClipboard[QClipboard::Clipboard]; + delete m_clientClipboard[QClipboard::Selection]; } void QXcbClipboard::incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted) @@ -372,9 +374,9 @@ QMimeData * QXcbClipboard::mimeData(QClipboard::Mode mode) return m_clientClipboard[mode]; } else { if (!m_xClipboard[mode]) - m_xClipboard[mode] = new QXcbClipboardMime(mode, this); + m_xClipboard[mode].reset(new QXcbClipboardMime(mode, this)); - return m_xClipboard[mode]; + return m_xClipboard[mode].data(); } } @@ -724,7 +726,7 @@ void QXcbClipboard::handleXFixesSelectionRequest(xcb_xfixes_selection_notify_eve // here we care only about the xfixes events that come from non Qt processes if (event->owner != XCB_NONE && event->owner != owner()) { if (!m_xClipboard[mode]) { - m_xClipboard[mode] = new QXcbClipboardMime(mode, this); + m_xClipboard[mode].reset(new QXcbClipboardMime(mode, this)); } else { m_xClipboard[mode]->reset(); } diff --git a/src/plugins/platforms/xcb/qxcbclipboard.h b/src/plugins/platforms/xcb/qxcbclipboard.h index 10f07047d8..f9a34f4f3d 100644 --- a/src/plugins/platforms/xcb/qxcbclipboard.h +++ b/src/plugins/platforms/xcb/qxcbclipboard.h @@ -92,7 +92,7 @@ private: QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard - QXcbClipboardMime *m_xClipboard[2]; + QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; -- cgit v1.2.3 From ad1555be7fa2aa9da04509455f83f5d8faab6e3a Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 28 Sep 2016 10:49:57 +0200 Subject: Plug remaining leaks in tests/auto/widgets/util In tst_QCompleter, two completers were leaked because they had no parent and setCompleter() calls don't reparent. Fixed by giving them parents. In tst_QUndo*, fix lots of leaked QActions by storing them in a QScopedPointer. There were some half-hearted attempts to clean them up with manual deletes, but I ported these to scoped pointers, too, to make the code more robust in the face of failures. This fixes the remaining errors in GCC 6.1 Linux ASan runs of tests/auto/widgets/util. Change-Id: Icc5248cc9cf4514540915924df1c4d9e09c071fa Reviewed-by: Thiago Macieira Reviewed-by: Olivier Goffart (Woboq GmbH) --- .../widgets/util/qcompleter/tst_qcompleter.cpp | 4 +- .../widgets/util/qundogroup/tst_qundogroup.cpp | 11 ++--- .../widgets/util/qundostack/tst_qundostack.cpp | 53 +++++++++------------- 3 files changed, 28 insertions(+), 40 deletions(-) diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp index 86a0bdf901..2a14d752e1 100644 --- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp +++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp @@ -1228,7 +1228,7 @@ void tst_QCompleter::task178797_activatedOnReturn() words << "foobar1" << "foobar2"; QLineEdit ledit; setFrameless(&ledit); - QCompleter *completer = new QCompleter(words); + QCompleter *completer = new QCompleter(words, &ledit); ledit.setCompleter(completer); QSignalSpy spy(completer, SIGNAL(activated(QString))); QCOMPARE(spy.count(), 0); @@ -1335,7 +1335,7 @@ public: task250064_TextEdit() { - completer = new QCompleter; + completer = new QCompleter(this); completer->setWidget(this); } diff --git a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp index 464a42b4e8..2b82cbfd03 100644 --- a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp +++ b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp @@ -382,8 +382,8 @@ static QString glue(const QString &s1, const QString &s2) void tst_QUndoGroup::checkSignals() { QUndoGroup group; - QAction *undo_action = group.createUndoAction(0, QString("foo")); - QAction *redo_action = group.createRedoAction(0, QString("bar")); + const QScopedPointer undo_action(group.createUndoAction(0, QString("foo"))); + const QScopedPointer redo_action(group.createRedoAction(0, QString("bar"))); QSignalSpy indexChangedSpy(&group, SIGNAL(indexChanged(int))); QSignalSpy cleanChangedSpy(&group, SIGNAL(cleanChanged(bool))); QSignalSpy canUndoChangedSpy(&group, SIGNAL(canUndoChanged(bool))); @@ -595,9 +595,6 @@ void tst_QUndoGroup::checkSignals() true, // indexChanged true, // undoChanged true) // redoChanged - - delete undo_action; - delete redo_action; } void tst_QUndoGroup::addStackAndDie() @@ -634,8 +631,8 @@ void tst_QUndoGroup::commandTextFormat() qApp->installTranslator(&translator); QUndoGroup group; - QAction *undo_action = group.createUndoAction(0); - QAction *redo_action = group.createRedoAction(0); + const QScopedPointer undo_action(group.createUndoAction(0)); + const QScopedPointer redo_action(group.createRedoAction(0)); QCOMPARE(undo_action->text(), QString("Undo-default-text")); QCOMPARE(redo_action->text(), QString("Redo-default-text")); diff --git a/tests/auto/widgets/util/qundostack/tst_qundostack.cpp b/tests/auto/widgets/util/qundostack/tst_qundostack.cpp index 07c5be417a..22867aba7c 100644 --- a/tests/auto/widgets/util/qundostack/tst_qundostack.cpp +++ b/tests/auto/widgets/util/qundostack/tst_qundostack.cpp @@ -262,8 +262,8 @@ static QString glue(const QString &s1, const QString &s2) static void checkState(QSignalSpy &redoTextChangedSpy, QSignalSpy &canRedoChangedSpy, QSignalSpy &undoTextChangedSpy, - QAction *const redoAction, - QAction *const undoAction, + const QScopedPointer &redoAction, + const QScopedPointer &undoAction, QSignalSpy &canUndoChangedSpy, QSignalSpy &cleanChangedSpy, QSignalSpy &indexChangedSpy, @@ -332,8 +332,8 @@ static void checkState(QSignalSpy &redoTextChangedSpy, void tst_QUndoStack::undoRedo() { QUndoStack stack; - QAction *undoAction = stack.createUndoAction(0, QString("foo")); - QAction *redoAction = stack.createRedoAction(0, QString("bar")); + const QScopedPointer undoAction(stack.createUndoAction(0, QString("foo"))); + const QScopedPointer redoAction(stack.createRedoAction(0, QString("bar"))); QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int))); QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool))); QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool))); @@ -693,8 +693,8 @@ void tst_QUndoStack::undoRedo() void tst_QUndoStack::setIndex() { QUndoStack stack; - QAction *undoAction = stack.createUndoAction(0, QString("foo")); - QAction *redoAction = stack.createRedoAction(0, QString("bar")); + const QScopedPointer undoAction(stack.createUndoAction(0, QString("foo"))); + const QScopedPointer redoAction(stack.createRedoAction(0, QString("bar"))); QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int))); QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool))); QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool))); @@ -957,8 +957,8 @@ void tst_QUndoStack::setIndex() void tst_QUndoStack::setClean() { QUndoStack stack; - QAction *undoAction = stack.createUndoAction(0, QString("foo")); - QAction *redoAction = stack.createRedoAction(0, QString("bar")); + const QScopedPointer undoAction(stack.createUndoAction(0, QString("foo"))); + const QScopedPointer redoAction(stack.createRedoAction(0, QString("bar"))); QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int))); QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool))); QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool))); @@ -1210,8 +1210,8 @@ void tst_QUndoStack::setClean() void tst_QUndoStack::clear() { QUndoStack stack; - QAction *undoAction = stack.createUndoAction(this, QString("foo")); - QAction *redoAction = stack.createRedoAction(this, QString("bar")); + const QScopedPointer undoAction(stack.createUndoAction(0, QString("foo"))); + const QScopedPointer redoAction(stack.createRedoAction(0, QString("bar"))); QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int))); QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool))); QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool))); @@ -1408,8 +1408,8 @@ void tst_QUndoStack::clear() void tst_QUndoStack::childCommand() { QUndoStack stack; - QAction *undoAction = stack.createUndoAction(0, QString("foo")); - QAction *redoAction = stack.createRedoAction(0, QString("bar")); + const QScopedPointer undoAction(stack.createUndoAction(0, QString("foo"))); + const QScopedPointer redoAction(stack.createRedoAction(0, QString("bar"))); QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int))); QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool))); QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool))); @@ -1513,16 +1513,13 @@ void tst_QUndoStack::childCommand() true, // indexChanged true, // undoChanged true); // redoChanged - - delete undoAction; - delete redoAction; } void tst_QUndoStack::macroBeginEnd() { QUndoStack stack; - QAction *undoAction = stack.createUndoAction(0, QString("foo")); - QAction *redoAction = stack.createRedoAction(0, QString("bar")); + const QScopedPointer undoAction(stack.createUndoAction(0, QString("foo"))); + const QScopedPointer redoAction(stack.createRedoAction(0, QString("bar"))); QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int))); QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool))); QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool))); @@ -1983,16 +1980,13 @@ void tst_QUndoStack::macroBeginEnd() true, // indexChanged true, // undoChanged true); // redoChanged - - delete undoAction; - delete redoAction; } void tst_QUndoStack::compression() { QUndoStack stack; - QAction *undoAction = stack.createUndoAction(0, QString("foo")); - QAction *redoAction = stack.createRedoAction(0, QString("bar")); + const QScopedPointer undoAction(stack.createUndoAction(0, QString("foo"))); + const QScopedPointer redoAction(stack.createRedoAction(0, QString("bar"))); QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int))); QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool))); QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool))); @@ -2428,16 +2422,13 @@ void tst_QUndoStack::compression() true, // indexChanged true, // undoChanged true); // redoChanged - - delete undoAction; - delete redoAction; } void tst_QUndoStack::undoLimit() { QUndoStack stack; - QAction *undoAction = stack.createUndoAction(0, QString("foo")); - QAction *redoAction = stack.createRedoAction(0, QString("bar")); + const QScopedPointer undoAction(stack.createUndoAction(0, QString("foo"))); + const QScopedPointer redoAction(stack.createRedoAction(0, QString("bar"))); QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int))); QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool))); QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool))); @@ -2977,8 +2968,8 @@ void tst_QUndoStack::commandTextFormat() qApp->installTranslator(&translator); QUndoStack stack; - QAction *undo_action = stack.createUndoAction(0); - QAction *redo_action = stack.createRedoAction(0); + const QScopedPointer undo_action(stack.createUndoAction(0)); + const QScopedPointer redo_action(stack.createRedoAction(0)); QCOMPARE(undo_action->text(), QString("Undo-default-text")); QCOMPARE(redo_action->text(), QString("Redo-default-text")); @@ -3005,8 +2996,8 @@ void tst_QUndoStack::commandTextFormat() void tst_QUndoStack::separateUndoText() { QUndoStack stack; - QAction *undo_action = stack.createUndoAction(0); - QAction *redo_action = stack.createRedoAction(0); + const QScopedPointer undo_action(stack.createUndoAction(0)); + const QScopedPointer redo_action(stack.createRedoAction(0)); QUndoCommand *command1 = new IdleCommand(); QUndoCommand *command2 = new IdleCommand(); -- cgit v1.2.3 From c62f71722639c39f210ddbec0c4d832521b3f187 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 17 Aug 2016 10:44:53 +0200 Subject: Fix signal code generation The old code is broken because it was passing signal.outputArgs as inputArgs variable of writeArgList, fix can not be passing signal.outputArgs as outputArgs of writeArgList since that ignores the first of the list, so i added a new function that does the right thing Change-Id: If54484e04880d5dcebfedb9d478ee0e9faf37baa Task-number: QTBUG-21577 Reviewed-by: Thiago Macieira --- src/3rdparty/atspi2/xml/Cache.xml | 4 ++-- src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp | 38 +++++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/3rdparty/atspi2/xml/Cache.xml b/src/3rdparty/atspi2/xml/Cache.xml index 9d0c5801a9..01c52810ac 100644 --- a/src/3rdparty/atspi2/xml/Cache.xml +++ b/src/3rdparty/atspi2/xml/Cache.xml @@ -9,12 +9,12 @@ - + - + diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp index 7361fa2230..1835e8a283 100644 --- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp +++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp @@ -332,7 +332,10 @@ static QString classNameForInterface(const QString &interface, ClassType classTy return retval; } -static QByteArray qtTypeName(const QString &signature, const QDBusIntrospection::Annotations &annotations, int paramId = -1, const char *direction = "Out") +// ### Qt6 Remove the two isSignal ifs +// They are only here because before signal arguments where previously searched as "In" so to maintain compatibility +// we first search for "Out" and if not found we search for "In" +static QByteArray qtTypeName(const QString &signature, const QDBusIntrospection::Annotations &annotations, int paramId = -1, const char *direction = "Out", bool isSignal = false) { int type = QDBusMetaType::signatureToType(signature.toLatin1()); if (type == QVariant::Invalid) { @@ -349,9 +352,15 @@ static QByteArray qtTypeName(const QString &signature, const QDBusIntrospection: qttype = annotations.value(oldAnnotationName); if (qttype.isEmpty()) { - fprintf(stderr, "Got unknown type `%s'\n", qPrintable(signature)); - fprintf(stderr, "You should add \"/> to the XML description\n", - qPrintable(annotationName)); + if (!isSignal || qstrcmp(direction, "Out") == 0) { + fprintf(stderr, "Got unknown type `%s'\n", qPrintable(signature)); + fprintf(stderr, "You should add \"/> to the XML description\n", + qPrintable(annotationName)); + } + + if (isSignal) + return qtTypeName(signature, annotations, paramId, "In", isSignal); + exit(1); } @@ -451,6 +460,23 @@ static void writeArgList(QTextStream &ts, const QStringList &argNames, } } +static void writeSignalArgList(QTextStream &ts, const QStringList &argNames, + const QDBusIntrospection::Annotations &annotations, + const QDBusIntrospection::Arguments &outputArgs) +{ + bool first = true; + int argPos = 0; + for (int i = 0; i < outputArgs.count(); ++i) { + const QDBusIntrospection::Argument &arg = outputArgs.at(i); + QString type = constRefArg(qtTypeName(arg.type, annotations, i, "Out", true /* isSignal */)); + + if (!first) + ts << ", "; + ts << type << argNames.at(argPos++); + first = false; + } +} + static QString propertyGetter(const QDBusIntrospection::Property &property) { QString getter = property.annotations.value(QLatin1String("org.qtproject.QtDBus.PropertyGetter")); @@ -765,7 +791,7 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf hs << "void " << signal.name << "("; QStringList argNames = makeArgNames(signal.outputArgs); - writeArgList(hs, argNames, signal.annotations, signal.outputArgs); + writeSignalArgList(hs, argNames, signal.annotations, signal.outputArgs); hs << ");" << endl; // finished for header } @@ -1109,7 +1135,7 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte hs << "void " << signal.name << "("; QStringList argNames = makeArgNames(signal.outputArgs); - writeArgList(hs, argNames, signal.annotations, signal.outputArgs); + writeSignalArgList(hs, argNames, signal.annotations, signal.outputArgs); hs << ");" << endl; // finished for header } -- cgit v1.2.3 From d6b6c15d338320a8f9fb3299121c3b338f2b6481 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 30 Sep 2016 11:41:07 +0200 Subject: QFileSystemModel: fix unused variable with QT_NO_FILESYSTEMWATCHER The QFileInfo 'info' is only used in code conditional on QT_NO_FILESYSTEMWATCHER, so move the definiton into the conditionally-compiled block, too. Turn it into an rvalue while at it. Change-Id: I9983bfdcd0b32d0abecf7c588973a60df9de8cbc Reviewed-by: Thiago Macieira Reviewed-by: Edward Welbourne --- src/widgets/dialogs/qfilesystemmodel.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 441a54bd7d..a4d4230044 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -889,11 +889,10 @@ bool QFileSystemModel::setData(const QModelIndex &idx, const QVariant &value, in parentNode->visibleChildren.removeAt(visibleLocation); QFileSystemModelPrivate::QFileSystemNode * oldValue = parentNode->children.value(oldName); parentNode->children[newName] = oldValue; - QFileInfo info(parentPath, newName); oldValue->fileName = newName; oldValue->parent = parentNode; #ifndef QT_NO_FILESYSTEMWATCHER - oldValue->populate(d->fileInfoGatherer.getInfo(info)); + oldValue->populate(d->fileInfoGatherer.getInfo(QFileInfo(parentPath, newName))); #endif oldValue->isVisible = true; -- cgit v1.2.3 From bf595c4e78187e78d7bedc3e9f95fe5b38683fed Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 30 Sep 2016 11:23:21 +0200 Subject: QFileSystemModel: Plug leak on file renaming In setData(), the old code both called Private::addNode(), which creates a QFileSystemNode and adds it to the parent's QHash of children, and also re-purposed the old node by taking it out of the children hash, adjusting the fileName member of the node and putting it back into the children hash under the new name, where it would overwrite the node just added under the same (new) name in addNode(). Since the hash stores naked pointers, no-one deletes the node that was put into the hash first. Fix by dropping the addNode() call completely. Change-Id: I0c37917fd0ffd74716393786c69b5bb172aa372e Reviewed-by: Edward Welbourne --- src/widgets/dialogs/qfilesystemmodel.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index a4d4230044..8e4697077e 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -885,7 +885,6 @@ bool QFileSystemModel::setData(const QModelIndex &idx, const QVariant &value, in QFileSystemModelPrivate::QFileSystemNode *parentNode = indexNode->parent; int visibleLocation = parentNode->visibleLocation(parentNode->children.value(indexNode->fileName)->fileName); - d->addNode(parentNode, newName,indexNode->info->fileInfo()); parentNode->visibleChildren.removeAt(visibleLocation); QFileSystemModelPrivate::QFileSystemNode * oldValue = parentNode->children.value(oldName); parentNode->children[newName] = oldValue; -- cgit v1.2.3 From 37ad51a44ec66d567ea0491414f87743ab276945 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Fri, 30 Sep 2016 11:41:54 +0200 Subject: Revert "Doc: Added enums in qnamespace.qdoc" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove duplicated enum values from doc. This reverts commit dfb55da5d67c21179ccef107351a90be2815e1e2. Change-Id: I27c85f66123731e0106bd702e843a24d7e9b5931 Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Topi Reiniö --- src/corelib/global/qnamespace.qdoc | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 23eeb01640..65a049548d 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -1724,17 +1724,6 @@ \value Key_Zoom \value Key_Exit \value Key_Cancel - \value Key_MicVolumeUp - \value Key_Find - \value Key_Open - \value Key_MicVolumeDown - \value Key_New - \value Key_Settings - \value Key_Redo - \value Key_Exit - \value Key_Info - \value Key_Undo - \value Key_Guide \sa QKeyEvent::key() */ -- cgit v1.2.3 From 9ab60b9c0db453fb598e42d91ce3217944afd9b6 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 8 Jun 2016 17:58:21 -0700 Subject: QCocoaEventDispatcher: Save interrupt state between embedded calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since QCocoaEventDispatcher::processEvents() resets the interrupt state, this may prevent a higher level event loop from returning. For example, calling QMenu::exec() and, as a result of an action being triggered, the application calls QCoreApplication::processEvents() after QMenu::hideEvent(). In this case, the menu event loop can be stuck until we run another event loop. Task-number: QTBUG-53947 Change-Id: If7efe1c3c07f7222c695195cbb4f41715e49b02e Reviewed-by: Timur Pocheptsov Reviewed-by: Wayne Arnold Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm index 1865624d57..1cfb3ecff9 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm @@ -342,7 +342,7 @@ static inline void qt_mac_waitForMoreEvents(NSString *runLoopMode = NSDefaultRun bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags) { Q_D(QCocoaEventDispatcher); - d->interrupt = false; + QBoolBlocker interruptBlocker(d->interrupt, false); bool interruptLater = false; QtCocoaInterruptDispatcher::cancelInterruptLater(); -- cgit v1.2.3 From 72a1a72776533c2cf95a020876c0959c6af14608 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Mon, 26 Sep 2016 18:23:56 +0100 Subject: docs: Don't mark qDrawBorderPixmap() as overload Because it doesn't overload anything. Change-Id: I871df10b4a0a46da238a5d1061cfb1aa34ccee03 Reviewed-by: Marc Mutz --- src/widgets/styles/qdrawutil.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/widgets/styles/qdrawutil.cpp b/src/widgets/styles/qdrawutil.cpp index 2a4d392413..dd02bad4d5 100644 --- a/src/widgets/styles/qdrawutil.cpp +++ b/src/widgets/styles/qdrawutil.cpp @@ -763,7 +763,6 @@ void qDrawPlainRect(QPainter *p, const QRect &r, const QColor &c, \fn void qDrawBorderPixmap(QPainter *painter, const QRect &target, const QMargins &margins, const QPixmap &pixmap) \relates \since 4.6 - \overload \brief The qDrawBorderPixmap function is for drawing a pixmap into the margins of a rectangle. -- cgit v1.2.3 From d44925507b1c5d9989df8d8144051d2e8730e953 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Tue, 4 Oct 2016 08:32:55 +0200 Subject: winrt: Fix compilation for projects using C++/CX extensions In case a project uses C++/CX extensions via /ZW compile flag including qfunctions_winrt.h resulted in a compile error about duplicate definition of Started due to namespace usages. Change-Id: I8913522eafbabae77dd7d17187f202e555b0275f Reviewed-by: Oliver Wolff --- src/corelib/kernel/qfunctions_winrt.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/kernel/qfunctions_winrt.h b/src/corelib/kernel/qfunctions_winrt.h index 9af5a08a01..db94d6739a 100644 --- a/src/corelib/kernel/qfunctions_winrt.h +++ b/src/corelib/kernel/qfunctions_winrt.h @@ -174,7 +174,7 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr &asyncOp, Awai t.start(); switch (awaitStyle) { case ProcessMainThreadEvents: - while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started) { + while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == AsyncStatus::Started) { QCoreApplication::processEvents(); if (timeout && t.hasExpired(timeout)) return ERROR_TIMEOUT; @@ -182,7 +182,7 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr &asyncOp, Awai break; case ProcessThreadEvents: if (QAbstractEventDispatcher *dispatcher = QThread::currentThread()->eventDispatcher()) { - while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started) { + while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == AsyncStatus::Started) { dispatcher->processEvents(QEventLoop::AllEvents); if (timeout && t.hasExpired(timeout)) return ERROR_TIMEOUT; @@ -192,7 +192,7 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr &asyncOp, Awai // fall through default: case YieldThread: - while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started) { + while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == AsyncStatus::Started) { QThread::yieldCurrentThread(); if (timeout && t.hasExpired(timeout)) return ERROR_TIMEOUT; @@ -200,7 +200,7 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr &asyncOp, Awai break; } - if (FAILED(hr) || status != Completed) { + if (FAILED(hr) || status != AsyncStatus::Completed) { HRESULT ec; hr = asyncInfo->get_ErrorCode(&ec); if (FAILED(hr)) -- cgit v1.2.3 From c3605980d95f28d8ab6dc11eb349ad87ed3adaa9 Mon Sep 17 00:00:00 2001 From: Frederik Schwarzer Date: Thu, 29 Sep 2016 17:05:07 +0200 Subject: Fix some typos and minor sentence structure issues in docs Change-Id: Ibede1aeb046e2df6723e3041152bfae22a9fde32 Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.cpp | 2 +- src/corelib/global/qnamespace.qdoc | 2 +- src/corelib/tools/qlist.cpp | 2 +- src/corelib/tools/qvector.cpp | 2 +- src/sql/kernel/qsqlrecord.cpp | 2 +- src/widgets/doc/src/model-view-programming.qdoc | 6 +++--- tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index eff94f5361..6d7fbce946 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -3395,7 +3395,7 @@ Q_GLOBAL_STATIC(AndroidRandomStorage, randomTLS) pseudo random integers to be returned by qrand(). The sequence of random numbers generated is deterministic per thread. For example, - if two threads call qsrand(1) and subsequently calls qrand(), the threads will get + if two threads call qsrand(1) and subsequently call qrand(), the threads will get the same random number sequence. \sa qrand() diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 65a049548d..8ebbdaabe1 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2258,7 +2258,7 @@ \enum Qt::ItemSelectionMode This enum is used in QGraphicsItem, QGraphicsScene and QGraphicsView to - specify how items are selected, or how to determine if a shapes and items + specify how items are selected, or how to determine if shapes and items collide. \value ContainsItemShape The output list contains only items whose diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index 5710f3925b..cffaa1a1af 100644 --- a/src/corelib/tools/qlist.cpp +++ b/src/corelib/tools/qlist.cpp @@ -373,7 +373,7 @@ void **QListData::erase(void **xi) application must interface with a C API. \note Iterators into a QLinkedList and references into - heap-allocating QLists remain valid long as the referenced items + heap-allocating QLists remain valid as long as the referenced items remain in the container. This is not true for iterators and references into a QVector and non-heap-allocating QLists. diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp index f1cf23cc6a..d008634f50 100644 --- a/src/corelib/tools/qvector.cpp +++ b/src/corelib/tools/qvector.cpp @@ -71,7 +71,7 @@ application must interface with a C API. \note Iterators into a QLinkedList and references into - heap-allocating QLists remain valid long as the referenced items + heap-allocating QLists remain valid as long as the referenced items remain in the container. This is not true for iterators and references into a QVector and non-heap-allocating QLists. diff --git a/src/sql/kernel/qsqlrecord.cpp b/src/sql/kernel/qsqlrecord.cpp index 16b9215b84..c75f24153d 100644 --- a/src/sql/kernel/qsqlrecord.cpp +++ b/src/sql/kernel/qsqlrecord.cpp @@ -88,7 +88,7 @@ QString QSqlRecordPrivate::createField(int index, const QString &prefix) const view within the database). QSqlRecord supports adding and removing fields as well as setting and retrieving field values. - The values of a record's fields' can be set by name or position + The values of a record's fields can be set by name or position with setValue(); if you want to set a field to null use setNull(). To find the position of a field by name use indexOf(), and to find the name of a field at a particular position use diff --git a/src/widgets/doc/src/model-view-programming.qdoc b/src/widgets/doc/src/model-view-programming.qdoc index 0032e77c6a..784e25b1d9 100644 --- a/src/widgets/doc/src/model-view-programming.qdoc +++ b/src/widgets/doc/src/model-view-programming.qdoc @@ -253,7 +253,7 @@ \snippet shareddirmodel/main.cpp 0 The model is set up to use data from a certain file system. The call to - \l{QFileSystemModel::}{setRootPath()} tell the model which drive on the + \l{QFileSystemModel::}{setRootPath()} tells the model which drive on the file system to expose to the views. We create two views so that we can examine the items held in the model in two @@ -304,7 +304,7 @@ signals and slots mechanism. This section describes some basic concepts that are central to the way - item of data are accessed by other components via a model class. More + items of data are accessed by other components via a model class. More advanced concepts are discussed in later sections. \section3 Model indexes @@ -1869,7 +1869,7 @@ \codeline \snippet qsortfilterproxymodel/main.cpp 1 - Since proxy models are inherit from QAbstractItemModel, they can be connected to + Since proxy models inherit from QAbstractItemModel, they can be connected to any kind of view, and can be shared between views. They can also be used to process the information obtained from other proxy models in a pipeline arrangement. diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 0f2d0873a7..0f2df1e29a 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -4943,7 +4943,7 @@ void tst_QNetworkReply::ioGetFromBuiltinHttp() const int maxRate = rate * 1024 * (100+allowedDeviation) / 100; qDebug() << minRate << "<="<< server.transferRate << "<=" << maxRate << "?"; // The test takes too long to run if sending enough data to overwhelm the - // reciever's kernel buffers. + // receiver's kernel buffers. //QEXPECT_FAIL("http+limited", "Limiting is broken right now, check QTBUG-15065", Continue); //QEXPECT_FAIL("https+limited", "Limiting is broken right now, check QTBUG-15065", Continue); //QVERIFY(server.transferRate >= minRate && server.transferRate <= maxRate); -- cgit v1.2.3