Пример #1
0
void NavigationBar::refreshHistory()
{
    if (mApp->isClosing() || !m_window->weView()) {
        return;
    }

    QWebEngineHistory* history = m_window->weView()->page()->history();
    m_buttonBack->setEnabled(history->canGoBack());
    m_buttonForward->setEnabled(history->canGoForward());
}
Пример #2
0
void NavigationBar::goForwardInNewTab()
{
    QWebEngineHistory* history = m_window->weView()->page()->history();

    if (!history->canGoForward()) {
        return;
    }

    loadHistoryItemInNewTab(history->forwardItem());
}
Пример #3
0
void WebView::forward()
{
    QWebEngineHistory* history = page()->history();

    if (history->canGoForward()) {
        history->forward();

        emit urlChanged(url());
    }
}
Пример #4
0
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void DREAM3DUserManualDialog::updateButtons(bool ok)
{
  QWebEngineHistory* history = m_WebView->history();

  // Check forwards navigation
  if (history->canGoForward() == false)
  {
    forwardBtn->setDisabled(true);
  }
  else
  {
    forwardBtn->setEnabled(true);
  }

  // Check backwards navigation
  if (history->canGoBack() == false || history->backItem().url().toDisplayString() == "about:blank")
  {
    backBtn->setDisabled(true);
  }
  else
  {
    backBtn->setEnabled(true);
  }
}