summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/3rdparty/atspi2/xml/Cache.xml4
-rw-r--r--src/corelib/global/qglobal.cpp2
-rw-r--r--src/corelib/global/qnamespace.qdoc13
-rw-r--r--src/corelib/kernel/qfunctions_winrt.h8
-rw-r--r--src/corelib/tools/qlist.cpp2
-rw-r--r--src/corelib/tools/qvector.cpp2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm2
-rw-r--r--src/plugins/platforms/xcb/qxcbclipboard.cpp12
-rw-r--r--src/plugins/platforms/xcb/qxcbclipboard.h2
-rw-r--r--src/sql/kernel/qsqlrecord.cpp2
-rw-r--r--src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp38
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp4
-rw-r--r--src/widgets/doc/src/model-view-programming.qdoc6
-rw-r--r--src/widgets/styles/qdrawutil.cpp1
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp2
-rw-r--r--tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp4
-rw-r--r--tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp11
-rw-r--r--tests/auto/widgets/util/qundostack/tst_qundostack.cpp53
18 files changed, 85 insertions, 83 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 @@
<signal name="AddAccessible">
<arg name="nodeAdded" type="((so)(so)a(so)assusau)"/>
- <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QSpiAccessibleCacheItem"/>
+ <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QSpiAccessibleCacheItem"/>
</signal>
<signal name="RemoveAccessible">
<arg name="nodeRemoved" type="(so)"/>
- <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QSpiObjectReference"/>
+ <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QSpiObjectReference"/>
</signal>
</interface>
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index c14f774bd6..bc93b1f477 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -3458,7 +3458,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 86c38839d2..4156040471 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1756,17 +1756,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()
*/
@@ -2299,7 +2288,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/kernel/qfunctions_winrt.h b/src/corelib/kernel/qfunctions_winrt.h
index e0777b8df8..9b33f8b120 100644
--- a/src/corelib/kernel/qfunctions_winrt.h
+++ b/src/corelib/kernel/qfunctions_winrt.h
@@ -180,7 +180,7 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &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;
@@ -188,7 +188,7 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &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;
@@ -198,7 +198,7 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &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;
@@ -206,7 +206,7 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, Awai
break;
}
- if (FAILED(hr) || status != Completed) {
+ if (FAILED(hr) || status != AsyncStatus::Completed) {
HRESULT ec;
hr = asyncInfo->get_ErrorCode(&ec);
if (FAILED(hr))
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 1762da2c8f..5f26e704c4 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -370,7 +370,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 ef1c9c17b0..0ea47b1a1a 100644
--- a/src/corelib/tools/qvector.cpp
+++ b/src/corelib/tools/qvector.cpp
@@ -77,7 +77,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/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
index 5f54110777..5c27cf8059 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
@@ -348,7 +348,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();
diff --git a/src/plugins/platforms/xcb/qxcbclipboard.cpp b/src/plugins/platforms/xcb/qxcbclipboard.cpp
index b95ad4b5c9..f9c32cd0a4 100644
--- a/src/plugins/platforms/xcb/qxcbclipboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp
@@ -275,8 +275,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;
@@ -329,6 +327,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)
@@ -378,9 +380,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();
}
}
@@ -730,7 +732,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 58c7f32c4c..ffd565c56f 100644
--- a/src/plugins/platforms/xcb/qxcbclipboard.h
+++ b/src/plugins/platforms/xcb/qxcbclipboard.h
@@ -98,7 +98,7 @@ private:
QClipboard::Mode modeForAtom(xcb_atom_t atom) const;
// Selection and Clipboard
- QXcbClipboardMime *m_xClipboard[2];
+ QScopedPointer<QXcbClipboardMime> m_xClipboard[2];
QMimeData *m_clientClipboard[2];
xcb_timestamp_t m_timestamp[2];
diff --git a/src/sql/kernel/qsqlrecord.cpp b/src/sql/kernel/qsqlrecord.cpp
index ef60cd4cf5..d5adff67a4 100644
--- a/src/sql/kernel/qsqlrecord.cpp
+++ b/src/sql/kernel/qsqlrecord.cpp
@@ -94,7 +94,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/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
index e58f194b72..518b7984b0 100644
--- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
+++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
@@ -203,7 +203,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) {
@@ -220,9 +223,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 <annotation name=\"%s\" value=\"<type>\"/> 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 <annotation name=\"%s\" value=\"<type>\"/> to the XML description\n",
+ qPrintable(annotationName));
+ }
+
+ if (isSignal)
+ return qtTypeName(signature, annotations, paramId, "In", isSignal);
+
exit(1);
}
@@ -322,6 +331,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"));
@@ -636,7 +662,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
}
@@ -980,7 +1006,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
}
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index 7fc51f4262..a75c14117d 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -903,15 +903,13 @@ 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;
- 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;
diff --git a/src/widgets/doc/src/model-view-programming.qdoc b/src/widgets/doc/src/model-view-programming.qdoc
index f172679d04..6a4aaa489a 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/src/widgets/styles/qdrawutil.cpp b/src/widgets/styles/qdrawutil.cpp
index a8f58eabb3..fa80a7a6ca 100644
--- a/src/widgets/styles/qdrawutil.cpp
+++ b/src/widgets/styles/qdrawutil.cpp
@@ -769,7 +769,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 <qdrawutil.h>
\since 4.6
- \overload
\brief The qDrawBorderPixmap function is for drawing a pixmap into
the margins of a rectangle.
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 93bdbdd6a5..b75b6d5df0 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -4952,7 +4952,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);
diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
index ff71a6d56b..50e11611f2 100644
--- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
@@ -1223,7 +1223,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);
@@ -1330,7 +1330,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 02ed912323..99d067b7d7 100644
--- a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
+++ b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
@@ -377,8 +377,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<QAction> undo_action(group.createUndoAction(0, QString("foo")));
+ const QScopedPointer<QAction> 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)));
@@ -590,9 +590,6 @@ void tst_QUndoGroup::checkSignals()
true, // indexChanged
true, // undoChanged
true) // redoChanged
-
- delete undo_action;
- delete redo_action;
}
void tst_QUndoGroup::addStackAndDie()
@@ -629,8 +626,8 @@ void tst_QUndoGroup::commandTextFormat()
qApp->installTranslator(&translator);
QUndoGroup group;
- QAction *undo_action = group.createUndoAction(0);
- QAction *redo_action = group.createRedoAction(0);
+ const QScopedPointer<QAction> undo_action(group.createUndoAction(0));
+ const QScopedPointer<QAction> 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 f21780c2c2..8573cea35f 100644
--- a/tests/auto/widgets/util/qundostack/tst_qundostack.cpp
+++ b/tests/auto/widgets/util/qundostack/tst_qundostack.cpp
@@ -257,8 +257,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<QAction> &redoAction,
+ const QScopedPointer<QAction> &undoAction,
QSignalSpy &canUndoChangedSpy,
QSignalSpy &cleanChangedSpy,
QSignalSpy &indexChangedSpy,
@@ -327,8 +327,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<QAction> undoAction(stack.createUndoAction(0, QString("foo")));
+ const QScopedPointer<QAction> redoAction(stack.createRedoAction(0, QString("bar")));
QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int)));
QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool)));
QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool)));
@@ -688,8 +688,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<QAction> undoAction(stack.createUndoAction(0, QString("foo")));
+ const QScopedPointer<QAction> redoAction(stack.createRedoAction(0, QString("bar")));
QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int)));
QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool)));
QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool)));
@@ -952,8 +952,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<QAction> undoAction(stack.createUndoAction(0, QString("foo")));
+ const QScopedPointer<QAction> redoAction(stack.createRedoAction(0, QString("bar")));
QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int)));
QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool)));
QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool)));
@@ -1205,8 +1205,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<QAction> undoAction(stack.createUndoAction(0, QString("foo")));
+ const QScopedPointer<QAction> redoAction(stack.createRedoAction(0, QString("bar")));
QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int)));
QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool)));
QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool)));
@@ -1403,8 +1403,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<QAction> undoAction(stack.createUndoAction(0, QString("foo")));
+ const QScopedPointer<QAction> redoAction(stack.createRedoAction(0, QString("bar")));
QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int)));
QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool)));
QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool)));
@@ -1508,16 +1508,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<QAction> undoAction(stack.createUndoAction(0, QString("foo")));
+ const QScopedPointer<QAction> redoAction(stack.createRedoAction(0, QString("bar")));
QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int)));
QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool)));
QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool)));
@@ -1978,16 +1975,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<QAction> undoAction(stack.createUndoAction(0, QString("foo")));
+ const QScopedPointer<QAction> redoAction(stack.createRedoAction(0, QString("bar")));
QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int)));
QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool)));
QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool)));
@@ -2423,16 +2417,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<QAction> undoAction(stack.createUndoAction(0, QString("foo")));
+ const QScopedPointer<QAction> redoAction(stack.createRedoAction(0, QString("bar")));
QSignalSpy indexChangedSpy(&stack, SIGNAL(indexChanged(int)));
QSignalSpy cleanChangedSpy(&stack, SIGNAL(cleanChanged(bool)));
QSignalSpy canUndoChangedSpy(&stack, SIGNAL(canUndoChanged(bool)));
@@ -2972,8 +2963,8 @@ void tst_QUndoStack::commandTextFormat()
qApp->installTranslator(&translator);
QUndoStack stack;
- QAction *undo_action = stack.createUndoAction(0);
- QAction *redo_action = stack.createRedoAction(0);
+ const QScopedPointer<QAction> undo_action(stack.createUndoAction(0));
+ const QScopedPointer<QAction> redo_action(stack.createRedoAction(0));
QCOMPARE(undo_action->text(), QString("Undo-default-text"));
QCOMPARE(redo_action->text(), QString("Redo-default-text"));
@@ -3000,8 +2991,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<QAction> undo_action(stack.createUndoAction(0));
+ const QScopedPointer<QAction> redo_action(stack.createRedoAction(0));
QUndoCommand *command1 = new IdleCommand();
QUndoCommand *command2 = new IdleCommand();