QEvent: Don't give DeferredDelete special treatment
After commit 9b07fd0d5cae6846f0eaccf3dc51bc9e78559a05, Qt no longer keeps the loop-level in QEvent's d-pointer. This means we no longer need to special case this event type in the QEvent copy constructor, assignment operator, and destructor. Change-Id: Iff71713d38303674f4517fdfa169cc448ed41dd4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
ccf988e510
commit
28f193ab53
@ -294,11 +294,9 @@ QEvent::QEvent(const QEvent &other)
|
|||||||
: d(other.d), t(other.t), posted(other.posted), spont(other.spont),
|
: d(other.d), t(other.t), posted(other.posted), spont(other.spont),
|
||||||
m_accept(other.m_accept)
|
m_accept(other.m_accept)
|
||||||
{
|
{
|
||||||
if (t != QEvent::DeferredDelete) {
|
|
||||||
// if QEventPrivate becomes available, make sure to implement a
|
// if QEventPrivate becomes available, make sure to implement a
|
||||||
// virtual QEventPrivate *clone() const; function so we can copy here
|
// virtual QEventPrivate *clone() const; function so we can copy here
|
||||||
Q_ASSERT_X(!d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere");
|
Q_ASSERT_X(!d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -310,11 +308,10 @@ QEvent::QEvent(const QEvent &other)
|
|||||||
*/
|
*/
|
||||||
QEvent &QEvent::operator=(const QEvent &other)
|
QEvent &QEvent::operator=(const QEvent &other)
|
||||||
{
|
{
|
||||||
if (t != QEvent::DeferredDelete) {
|
|
||||||
// if QEventPrivate becomes available, make sure to implement a
|
// if QEventPrivate becomes available, make sure to implement a
|
||||||
// virtual QEventPrivate *clone() const; function so we can copy here
|
// virtual QEventPrivate *clone() const; function so we can copy here
|
||||||
Q_ASSERT_X(!other.d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere");
|
Q_ASSERT_X(!other.d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere");
|
||||||
}
|
|
||||||
t = other.t;
|
t = other.t;
|
||||||
posted = other.posted;
|
posted = other.posted;
|
||||||
spont = other.spont;
|
spont = other.spont;
|
||||||
@ -331,7 +328,6 @@ QEvent::~QEvent()
|
|||||||
{
|
{
|
||||||
if (posted && QCoreApplication::instance())
|
if (posted && QCoreApplication::instance())
|
||||||
QCoreApplicationPrivate::removePostedEvent(this);
|
QCoreApplicationPrivate::removePostedEvent(this);
|
||||||
if (t != QEvent::DeferredDelete)
|
|
||||||
Q_ASSERT_X(!d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere");
|
Q_ASSERT_X(!d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user