Remove the comparison operators of QFuture
These operators don't do what the user might expect and may lead to confusing results. [ChangeLog][Source-Incompatible Changes][QFuture] The comparison operators of QFuture have been removed. They were comparing the underlying d-ptrs instead of comparing the results (as the users might expect), which is not very helpful for the users point of view. Change-Id: I80a887610eac38b60329128cca52cdb5fb515207 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
parent
387f3e00a8
commit
30a1683f65
@ -101,9 +101,6 @@ public:
|
|||||||
operator T() const;
|
operator T() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool operator==(const QFuture &other) const { return (d == other.d); }
|
|
||||||
bool operator!=(const QFuture &other) const { return (d != other.d); }
|
|
||||||
|
|
||||||
void cancel() { d.cancel(); }
|
void cancel() { d.cancel(); }
|
||||||
bool isCanceled() const { return d.isCanceled(); }
|
bool isCanceled() const { return d.isCanceled(); }
|
||||||
|
|
||||||
|
@ -167,17 +167,6 @@
|
|||||||
Assigns \a other to this future and returns a reference to this future.
|
Assigns \a other to this future and returns a reference to this future.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn template <typename T> bool QFuture<T>::operator==(const QFuture &other) const
|
|
||||||
|
|
||||||
Returns \c true if \a other is a copy of this future; otherwise returns \c false.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn template <typename T> bool QFuture<T>::operator!=(const QFuture &other) const
|
|
||||||
|
|
||||||
Returns \c true if \a other is \e not a copy of this future; otherwise returns
|
|
||||||
false.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn template <typename T> void QFuture<T>::cancel()
|
/*! \fn template <typename T> void QFuture<T>::cancel()
|
||||||
|
|
||||||
Cancels the asynchronous computation represented by this future. Note that
|
Cancels the asynchronous computation represented by this future. Note that
|
||||||
|
@ -210,7 +210,7 @@ private:
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
Q_INLINE_TEMPLATE void QFutureWatcher<T>::setFuture(const QFuture<T> &_future)
|
Q_INLINE_TEMPLATE void QFutureWatcher<T>::setFuture(const QFuture<T> &_future)
|
||||||
{
|
{
|
||||||
if (_future == m_future)
|
if (_future.d == m_future.d)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
disconnectOutputInterface(true);
|
disconnectOutputInterface(true);
|
||||||
|
@ -1504,8 +1504,6 @@ void tst_QFuture::voidConversions()
|
|||||||
|
|
||||||
QFuture<void> voidFuture(intFuture);
|
QFuture<void> voidFuture(intFuture);
|
||||||
voidFuture = intFuture;
|
voidFuture = intFuture;
|
||||||
|
|
||||||
QVERIFY(voidFuture == intFuture);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -107,7 +107,7 @@ void tst_QFutureSynchronizer::futures()
|
|||||||
synchronizer.addFuture(future);
|
synchronizer.addFuture(future);
|
||||||
}
|
}
|
||||||
|
|
||||||
QCOMPARE(futures, synchronizer.futures());
|
QCOMPARE(futures.count(), synchronizer.futures().count());
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QFutureSynchronizer::setFuture()
|
void tst_QFutureSynchronizer::setFuture()
|
||||||
@ -122,7 +122,6 @@ void tst_QFutureSynchronizer::setFuture()
|
|||||||
QFuture<void> future;
|
QFuture<void> future;
|
||||||
synchronizer.setFuture(future);
|
synchronizer.setFuture(future);
|
||||||
QCOMPARE(synchronizer.futures().size(), 1);
|
QCOMPARE(synchronizer.futures().size(), 1);
|
||||||
QCOMPARE(synchronizer.futures().first(), future);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QFutureSynchronizer::waitForFinished()
|
void tst_QFutureSynchronizer::waitForFinished()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user