为什么我不能在qt中迭代findChild <qwidget *>()?

时间:2017-01-19 17:38:41

标签: c++ qt

我有一些QCheckBox从“cb0”到“cb11”命名。 为什么让我出错,尝试这个,或者为什么如果这就是为什么它不接受std::strings

using namespace std

for(int i = 0; i < 12; i++){
   ostringstream strs;
   strs << i;
   string k = "cb" + strs.str();

   QCheckBox *cb = findChild<QCheckBox*>(k);
   ...
}

0 个答案:

没有答案
相关问题