本文整理汇总了C++中QWebEngineView::isVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ QWebEngineView::isVisible方法的具体用法?C++ QWebEngineView::isVisible怎么用?C++ QWebEngineView::isVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWebEngineView
的用法示例。
在下文中一共展示了QWebEngineView::isVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onTokenAcquired
void TitleBar::onTokenAcquired(const QString& strToken)
{
WizService::Token::instance()->disconnect(this);
#ifdef USEWEBENGINE
QWebEngineView* comments = noteView()->commentView();
#else
QWebView* comments = noteView()->commentView();
#endif
if (strToken.isEmpty()) {
comments->hide();
return;
}
QString strKbGUID = noteView()->note().strKbGUID;
QString strGUID = noteView()->note().strGUID;
m_commentsUrl = WizService::ApiEntry::commentUrl(strToken, strKbGUID, strGUID);
if (comments->isVisible()) {
// comments->load(QUrl());
comments->load(m_commentsUrl);
}
QUrl kUrl(WizService::ApiEntry::kUrlFromGuid(strToken, strKbGUID));
QString strCountUrl = WizService::ApiEntry::commentCountUrl(kUrl.host(), strToken, strKbGUID, strGUID);
WizService::AsyncApi* api = new WizService::AsyncApi(this);
connect(api, SIGNAL(getCommentsCountFinished(int)), SLOT(onGetCommentsCountFinished(int)));
api->getCommentsCount(strCountUrl);
}
示例2: onCommentsButtonClicked
void TitleBar::onCommentsButtonClicked()
{
#ifdef USEWEBENGINE
QWebEngineView* comments = noteView()->commentView();
#else
QWebView* comments = noteView()->commentView();
#endif
if (comments->isVisible()) {
comments->hide();
return;
}
if (isNetworkAccessible()) {
if (!m_commentsUrl.isEmpty()) {
comments->load(m_commentsUrl);
QSplitter* splitter = qobject_cast<QSplitter*>(comments->parentWidget());
Q_ASSERT(splitter);
QList<int> li = splitter->sizes();
Q_ASSERT(li.size() == 2);
QList<int> lin;
lin.push_back(li.value(0) - COMMENT_FRAME_WIDTH);
lin.push_back(li.value(1) + COMMENT_FRAME_WIDTH);
splitter->setSizes(lin);
comments->show();
} else {
loadErrorPage();
comments->show();
}
} else {
m_commentsBtn->setEnabled(false);
}
}