@@ -43,6 +43,8 @@ private Q_SLOTS:
44 delete m_model;
44 delete m_model;
45 m_model = nullptr;
45 m_model = nullptr;
46+ // send deleteLaters to avoid leaks.
47+ QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
48 void testHeadOnSetHead()
50 void testHeadOnSetHead()
@@ -146,19 +148,10 @@ private Q_SLOTS:
147 m_model->removeRow(removeIndex);
149 m_model->removeRow(removeIndex);
149− waitFor([&stack, resultCount]() { return stack.count() == resultCount; }, 1000);
150 QCOMPARE(stack.count(), resultCount);
151 QCOMPARE(stack.count(), resultCount);
154− bool waitFor(std::function<bool()> functor, int ms) {
156− QElapsedTimer timer;
158− while(!functor() && timer.elapsed() < ms) { QTest::qWait(10); }
162 QVariant recuseAddMenu(int subMenuCount, int depth_remaining)
155 QVariant recuseAddMenu(int subMenuCount, int depth_remaining)
164 QVariantList rows;
157 QVariantList rows;