WebInspector is based on web. You will need to get first and only child of inspector, it will be QWebView.
Like that:
QList<QWidget*> list = inspector.findChildren<QWidget *>();
QWebView* wv =(QWebView*) list.at(0);
Then connect to javaScriptWindowObjectCleared signal of this view, and in the connected slot execute javascript. You will need object to handle this. I called it someObject, for example
QObject::connect(
wv->page()->mainFrame(),
SIGNAL(javaScriptWindowObjectCleared()),
someObject,
SLOT(openNetworkTab())
);
add slot to someObject's class:
void openNetworkTab(){
wv->page()->mainFrame()->evaluateJavaScript("document.addEventListener('DOMContentLoaded',function(){setTimeout(function(){document.querySelector('.toolbar-item.network').click()},200);});");
}
Delay 200 just to wait for all event bindings initialization before make click
Here list of all inspector tab classes, just in case: .elements, .resources, .network, .scripts, .timeline, .profiles, .audits, .console