ソースを参照

Add more coverage to ctkTreeComboBoxTest1

Julien Finet 14 年 前
コミット
bba0c96c29
共有1 個のファイルを変更した3 個の追加2 個の削除を含む
  1. 3 2
      Libs/Widgets/Testing/Cpp/ctkTreeComboBoxTest1.cpp

+ 3 - 2
Libs/Widgets/Testing/Cpp/ctkTreeComboBoxTest1.cpp

@@ -22,6 +22,7 @@
 #include <QApplication>
 #include <QStandardItemModel>
 #include <QTimer>
+#include <QTreeView>
 
 // CTK includes
 #include "ctkTreeComboBox.h"
@@ -56,14 +57,14 @@ int ctkTreeComboBoxTest1(int argc, char * argv [] )
   bool oldEnabled = QApplication::isEffectEnabled(Qt::UI_AnimateCombo);
   QApplication::setEffectEnabled(Qt::UI_AnimateCombo, false);
   combo.showPopup();
-  combo.hidePopup();
+  combo.treeView()->setExpanded(model.item(0)->index(), true);
   QApplication::setEffectEnabled(Qt::UI_AnimateCombo, oldEnabled);
   
   if (argc < 2 || QString(argv[1]) != "-I" )
     {
     QTimer::singleShot(200, &app, SLOT(quit()));
+    QTimer::singleShot(100, &combo, SLOT(hidePopup()));
     }
-
   return app.exec();
 }