Hi everyone,
I want to instanciate as far as I want QWidget to push into QTabWidget.
QJsonArray jsonArray = jsonObject.value("Channel").toArray();
for(int indexchannel(0); indexchannel < jsonArray.size(); indexchannel++){
QString channel
= jsonArray
[indexchannel
].
toString();
// m_console.push_back(new Console(channel));
m_console.append(new Console(channel));
onglet->setObjectName(QStringLiteral(channel));
tab->addTab(console, console->channelName() );
}
// for (int widgetIndexChannel(0) ; widgetIndexChannel <m_console.size(); widgetIndexChannel++ ){
// tab->addTab(m_console.at(widgetIndexChannel), m_console.at(widgetIndexChannel)->channelName());
// }
tab
->addTab
(new QWidget,
"testttt");
verticalLayout->addWidget(tab);
this->setCentralWidget(centralWidget);
QJsonArray jsonArray = jsonObject.value("Channel").toArray();
for(int indexchannel(0); indexchannel < jsonArray.size(); indexchannel++){
QString channel = jsonArray[indexchannel].toString();
// m_console.push_back(new Console(channel));
tab->addTab(new QWidget, channel);
m_console.append(new Console(channel));
onglet->setObjectName(QStringLiteral(channel));
tab->addTab(console, console->channelName() );
}
// for (int widgetIndexChannel(0) ; widgetIndexChannel <m_console.size(); widgetIndexChannel++ ){
// tab->addTab(m_console.at(widgetIndexChannel), m_console.at(widgetIndexChannel)->channelName());
// }
tab->addTab(new QWidget, "testttt");
verticalLayout->addWidget(tab);
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.
Bookmarks