tests/auto/qwidgetaction/tst_qwidgetaction.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
   185     QComboBox *combo = new QComboBox(0);
   185     QComboBox *combo = new QComboBox(0);
   186     QWidgetAction *action = new QWidgetAction(0);
   186     QWidgetAction *action = new QWidgetAction(0);
   187     action->setDefaultWidget(combo);
   187     action->setDefaultWidget(combo);
   188 
   188 
   189     tb.addAction(action);
   189     tb.addAction(action);
   190     qApp->processEvents(); //the call to show is delayed by the toolbar layout
   190     //the call to show is delayed by the toolbar layout
   191     QVERIFY(combo->isVisible());
   191     QTRY_VERIFY(combo->isVisible());
   192     QVERIFY(action->isVisible());
   192     QVERIFY(action->isVisible());
   193 
   193 
   194     action->setVisible(false);
   194     action->setVisible(false);
   195     qApp->processEvents(); //the call to hide is delayed by the toolbar layout
   195     //the call to hide is delayed by the toolbar layout
   196     QTRY_VERIFY(!combo->isVisible());
   196     QTRY_VERIFY(!combo->isVisible());
   197 
   197 
   198     delete action;
   198     delete action;
   199     // action also deletes combo
   199     // action also deletes combo
   200 }
   200 }