Changeset View
Changeset View
Standalone View
Standalone View
autotests/kmessagewidgetautotest.cpp
Show All 27 Lines | |||||
28 | 28 | | |||
29 | // KMessageWidget is currently hardcoded to a 500 ms timeline and default QTimeLine 40 ms update interval | 29 | // KMessageWidget is currently hardcoded to a 500 ms timeline and default QTimeLine 40 ms update interval | ||
30 | // let's have 7 updates for now, should be save | 30 | // let's have 7 updates for now, should be save | ||
31 | const int overlappingWaitingTime = 280; | 31 | const int overlappingWaitingTime = 280; | ||
32 | 32 | | |||
33 | #define CHECK_FULLY_VISIBLE \ | 33 | #define CHECK_FULLY_VISIBLE \ | ||
34 | QVERIFY(w.isVisible()); \ | 34 | QVERIFY(w.isVisible()); \ | ||
35 | QCOMPARE(w.height(), w.sizeHint().height()); \ | 35 | QCOMPARE(w.height(), w.sizeHint().height()); \ | ||
36 | QCOMPARE(w.findChild<QWidget*>(QStringLiteral("contentWidget")) ->pos(), QPoint(0, 0)); | | |||
37 | 36 | | |||
38 | #define CHECK_FULLY_NOT_VISIBLE \ | 37 | #define CHECK_FULLY_NOT_VISIBLE \ | ||
39 | QCOMPARE(w.height(), 0); \ | 38 | QCOMPARE(w.height(), 0); \ | ||
40 | QCOMPARE(w.findChild<QWidget*>(QStringLiteral("contentWidget")) ->pos(), QPoint(0, -w.sizeHint().height())); \ | | |||
41 | QVERIFY(!w.isVisible()); | 39 | QVERIFY(!w.isVisible()); | ||
42 | 40 | | |||
43 | 41 | | |||
44 | void KMessageWidgetTest::testAnimationSignals() | 42 | void KMessageWidgetTest::testAnimationSignals() | ||
45 | { | 43 | { | ||
46 | KMessageWidget w(QStringLiteral("Hello world")); | 44 | KMessageWidget w(QStringLiteral("Hello world")); | ||
47 | 45 | | |||
48 | QSignalSpy showSignalsSpy(&w, &KMessageWidget::showAnimationFinished); | 46 | QSignalSpy showSignalsSpy(&w, &KMessageWidget::showAnimationFinished); | ||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |