void NavigationBar::goForwardInNewTab() { QWebHistory* history = m_window->weView()->page()->history(); if (!history->canGoForward()) { return; } loadHistoryItemInNewTab(history->forwardItem()); }
void NavigationBar::goBackInNewTab() { QWebEngineHistory* history = m_window->weView()->page()->history(); if (!history->canGoBack()) { return; } loadHistoryItemInNewTab(history->backItem()); }
void NavigationBar::loadHistoryIndexInNewTab(int index) { if (QAction* action = qobject_cast<QAction*>(sender())) { index = action->data().toInt(); } if (index == -1) { return; } QWebHistory* history = m_window->weView()->page()->history(); loadHistoryItemInNewTab(history->itemAt(index)); }