本文整理汇总了C++中WebTab::isPageLoading方法的典型用法代码示例。如果您正苦于以下问题:C++ WebTab::isPageLoading方法的具体用法?C++ WebTab::isPageLoading怎么用?C++ WebTab::isPageLoading使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebTab
的用法示例。
在下文中一共展示了WebTab::isPageLoading方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showTabPreview
void TabBar::showTabPreview()
{
if (m_isFirstTimeOnTab)
m_isFirstTimeOnTab = false;
//delete previous tab preview
delete m_previewPopup.data();
m_previewPopup.clear();
MainView *mv = qobject_cast<MainView *>(parent());
WebTab *indexedTab = mv->webTab(m_currentTabPreviewIndex);
WebTab *currentTab = mv->webTab(currentIndex());
// check if view && currentView exist before using them :)
if (!currentTab || !indexedTab)
return;
// no previews during load
if (indexedTab->isPageLoading())
return;
// Make sure the hovered webtab match the current size
// Only the active one is updated by window resize events
indexedTab->resize(currentTab->size());
m_previewPopup = new TabPreviewPopup(indexedTab , this);
int tabWidth = tabSizeHint(m_currentTabPreviewIndex).width();
int tabBarWidth = mv->size().width();
int leftIndex = tabRect(m_currentTabPreviewIndex).x() + (tabRect(m_currentTabPreviewIndex).width() - tabWidth) / 2;
int popupWidth = m_previewPopup.data()->thumbnailSize().width();
// Center the popup if the tab width is bigger or smaller
leftIndex += (tabWidth - popupWidth) / 2;
if (leftIndex < 0)
{
leftIndex = 0;
}
else if (leftIndex + tabWidth > tabBarWidth)
{
leftIndex = tabBarWidth - tabWidth;
}
QPoint pos(leftIndex, tabRect(m_currentTabPreviewIndex).y() + tabRect(m_currentTabPreviewIndex).height());
m_previewPopup.data()->show(mapToGlobal(pos));
}
示例2: showTabPreview
void TabBar::showTabPreview()
{
//delete previous tab preview
delete m_previewPopup.data();
m_previewPopup.clear();
MainView *mv = qobject_cast<MainView *>(parent());
WebTab *indexedTab = mv->webTab(m_currentTabPreviewIndex);
WebTab *currentTab = mv->webTab(currentIndex());
// check if view && currentView exist before using them :)
if (!currentTab || !indexedTab)
return;
// no previews during load
if (indexedTab->isPageLoading())
return;
int w = tabSizeHint(m_currentTabPreviewIndex).width();
int h = w * ((0.0 + currentTab->height()) / currentTab->width());
m_previewPopup = new KPassivePopup(this);
m_previewPopup.data()->setFrameShape(QFrame::StyledPanel);
m_previewPopup.data()->setFrameShadow(QFrame::Plain);
m_previewPopup.data()->setFixedSize(w, h);
QLabel *l = new QLabel();
l->setPixmap( WebSnap::renderTabPreview(*indexedTab->page(), w, h) );
m_previewPopup.data()->setView(l);
m_previewPopup.data()->layout()->setAlignment(Qt::AlignTop);
m_previewPopup.data()->layout()->setMargin(0);
QPoint pos(tabRect(m_currentTabPreviewIndex).x() , tabRect(m_currentTabPreviewIndex).y() + tabRect(m_currentTabPreviewIndex).height());
m_previewPopup.data()->show(mapToGlobal(pos));
}