Browse Source

ctkTreeComboBox::hidePopup is not a slot

Julien Finet 14 years ago
parent
commit
7ee486ce2a
1 changed files with 12 additions and 1 deletions
  1. 12 1
      Libs/Widgets/Testing/Cpp/ctkTreeComboBoxTest1.cpp

+ 12 - 1
Libs/Widgets/Testing/Cpp/ctkTreeComboBoxTest1.cpp

@@ -51,19 +51,30 @@ int ctkTreeComboBoxTest1(int argc, char * argv [] )
     std::cerr << "No tree view" << std::endl;
     return EXIT_FAILURE;
     }
+
   combo.show();
+  QApplication::processEvents();
+
   // if the effect UI_AnimateCombo is enabled, the popup doesn't have time
   // to be visible when hidePopup() is called wich doesn't hide the popup.
   bool oldEnabled = QApplication::isEffectEnabled(Qt::UI_AnimateCombo);
   QApplication::setEffectEnabled(Qt::UI_AnimateCombo, false);
   combo.showPopup();
+  QApplication::processEvents();
+
   combo.treeView()->setExpanded(model.item(0)->index(), true);
+  QApplication::processEvents();
+
+  combo.hidePopup();
+  QApplication::processEvents();
+
   QApplication::setEffectEnabled(Qt::UI_AnimateCombo, oldEnabled);
+
+  combo.showPopup();
   
   if (argc < 2 || QString(argv[1]) != "-I" )
     {
     QTimer::singleShot(200, &app, SLOT(quit()));
-    QTimer::singleShot(100, &combo, SLOT(hidePopup()));
     }
   return app.exec();
 }