Hi everyone,

I want to instanciate as far as I want QWidget to push into QTabWidget.
Qt Code:
  1. QJsonArray jsonArray = jsonObject.value("Channel").toArray();
  2.  
  3. for(int indexchannel(0); indexchannel < jsonArray.size(); indexchannel++){
  4. QString channel = jsonArray[indexchannel].toString();
  5. // m_console.push_back(new Console(channel));
  6. tab->addTab(new QWidget, channel);
  7. m_console.append(new Console(channel));
  8. onglet->setObjectName(QStringLiteral(channel));
  9. tab->addTab(console, console->channelName() );
  10. }
  11. // for (int widgetIndexChannel(0) ; widgetIndexChannel <m_console.size(); widgetIndexChannel++ ){
  12. // tab->addTab(m_console.at(widgetIndexChannel), m_console.at(widgetIndexChannel)->channelName());
  13. // }
  14. tab->addTab(new QWidget, "testttt");
  15. verticalLayout->addWidget(tab);
  16. this->setCentralWidget(centralWidget);
To copy to clipboard, switch view to plain text mode 

according to a json file I populate my view. But I'm doing this in loop and nothing append. I feel like the addTab doesn't work in loop even though doesn't it use like that does it ?
Sorry for my poor question.