本文整理汇总了C++中QWebHistory::canGoForward方法的典型用法代码示例。如果您正苦于以下问题:C++ QWebHistory::canGoForward方法的具体用法?C++ QWebHistory::canGoForward怎么用?C++ QWebHistory::canGoForward使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWebHistory
的用法示例。
在下文中一共展示了QWebHistory::canGoForward方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openNext
void MainWindow::openNext(Qt::MouseButtons mouseButtons, Qt::KeyboardModifiers keyboardModifiers)
{
QWebHistory *history = currentTab()->view()->history();
QWebHistoryItem *item = 0;
if (currentTab()->view()->page()->isOnRekonqPage())
{
item = new QWebHistoryItem(history->currentItem());
}
else
{
if (history->canGoForward())
{
item = new QWebHistoryItem(history->forwardItem());
}
}
if(!item)
return;
if (mouseButtons == Qt::MidButton || keyboardModifiers == Qt::ControlModifier)
{
Application::instance()->loadUrl(item->url(), Rekonq::NewTab);
}
else
{
history->goToItem(*item);
}
updateActions();
}
示例2: goForwardInNewTab
void NavigationBar::goForwardInNewTab()
{
QWebHistory* history = m_window->weView()->page()->history();
if (!history->canGoForward()) {
return;
}
loadHistoryItemInNewTab(history->forwardItem());
}
示例3: refreshHistory
void NavigationBar::refreshHistory()
{
if (mApp->isClosing() || !m_window->weView()) {
return;
}
QWebHistory* history = m_window->weView()->page()->history();
m_buttonBack->setEnabled(history->canGoBack());
m_buttonForward->setEnabled(history->canGoForward());
}
示例4: refreshHistory
void NavigationBar::refreshHistory()
{
if (mApp->isClosing() || p_QupZilla->isClosing()) {
return;
}
QWebHistory* history = p_QupZilla->weView()->page()->history();
m_buttonBack->setEnabled(history->canGoBack());
m_buttonNext->setEnabled(history->canGoForward());
}
示例5: goForwardInNewTab
void NavigationBar::goForwardInNewTab()
{
QWebHistory* history = p_QupZilla->weView()->page()->history();
if (!history->canGoForward()) {
return;
}
int itemIndex = WebHistoryWrapper::indexOfItem(history->items(), history->forwardItem());
if (itemIndex == -1) {
return;
}
goAtHistoryIndexInNewTab(itemIndex);
}
示例6: moveContent
void MyTextBrowser::moveContent(int pos)
{
if(pos >= '\t' || pos < 0)
{
activateWindow();
char text[16];
text[0] = pos & 0x0ff;
text[1] = '\0';
int modifiers = pos & 0x07fffff00;
int key = pos & 0x0ff;
if ((pos & 0x0ff) == '\t') key = Qt::Key_Tab;
else if((pos & 0x0ff) == 0x0d) key = Qt::Key_Return;
QKeyEvent pressEvent( QEvent::KeyPress, (Qt::Key) key, (Qt::KeyboardModifiers) modifiers, text);
QKeyEvent releaseEvent(QEvent::KeyRelease, (Qt::Key) key, (Qt::KeyboardModifiers) modifiers, text);
if((pos & 0x0ff) == '\t') QWidget::setFocus(Qt::TabFocusReason);
keyPressEvent(&pressEvent);
keyReleaseEvent(&releaseEvent);
return;
}
#ifdef NO_WEBKIT
char buf[MAX_PRINTF_LENGTH];
QString myurl;
if(opt.arg_debug) printf("moveContent(%d)\n", pos);
if (pos == 0 && homeIsSet)
{
myurl = home;
setSource(QUrl(home));
}
else if(pos == 1)
{
forward();
myurl = source().path();
}
else if(pos == 2)
{
backward();
myurl = source().path();
}
else if(pos == 3)
{
reload();
myurl = source().path();
}
#else
char buf[MAX_PRINTF_LENGTH];
QString myurl;
QWebHistory *hist;
if(opt.arg_debug) printf("moveContent(%d)\n", pos);
if (pos == 0 && homeIsSet)
{
myurl = home;
load(home);
}
else if(pos == 1)
{
hist = history();
if(hist != NULL && hist->canGoForward()) myurl = hist->forwardItem().url().toString();
forward();
}
else if(pos == 2)
{
hist = history();
if(hist != NULL && hist->canGoBack()) myurl = hist->backItem().url().toString();
back();
}
else if(pos == 3)
{
hist = history();
if(hist != NULL) myurl = hist->currentItem().url().toString();
reload();
}
#endif
if(myurl.isEmpty()) return;
if(opt.arg_debug) printf("moveContent(%s)\n", (const char *) myurl.toUtf8());
if(myurl.length()+40 > MAX_PRINTF_LENGTH) return;
sprintf(buf,"text(%d,\"%s\")\n", id,decode(myurl));
tcp_send(s,buf,strlen(buf));
}