本文整理汇总了C++中QWebFrame::scrollBarMaximum方法的典型用法代码示例。如果您正苦于以下问题:C++ QWebFrame::scrollBarMaximum方法的具体用法?C++ QWebFrame::scrollBarMaximum怎么用?C++ QWebFrame::scrollBarMaximum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWebFrame
的用法示例。
在下文中一共展示了QWebFrame::scrollBarMaximum方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onMessage
void MainWindow::onMessage(IrcPrivateMessage *message) {
auto messages = read.getMessages(message->target());
int messageCount = 150; // Subject to change via settings, currently set as twitch default
PattyIrcMessage* pattyMsg = PattyIrcMessage::fromMessage(message);
messages->append(pattyMsg);
if (message->target() == this->currentChannel) {
QString html;
QWebFrame* frame = this->ui->baseChatWindow->page()->mainFrame();
this->scrollValue = frame->scrollBarValue(Qt::Vertical);
this->autoScroll = (this->scrollValue >= frame->scrollBarMaximum(Qt::Vertical));
if (this->autoScroll) {
while (messages->count() > messageCount) {
delete messages->takeFirst();
QWebElement message = frame->findFirstElement("div.message");
message.removeFromDocument();
}
}
addMessage(pattyMsg);
} else {
if (messages->count() > messageCount) {
delete messages->takeFirst();
}
}
}
示例2: showLastRdfTriple
void CellmlAnnotationViewMetadataNormalViewDetailsWidget::showLastRdfTriple()
{
// Show our last RDF triple by scrolling to the end of the page
QWebFrame *outputFrame = mOutputOntologicalTerms->page()->mainFrame();
outputFrame->setScrollBarValue(Qt::Vertical, outputFrame->scrollBarMaximum(Qt::Vertical));
}
示例3: scrollBarMaximum
int QWebFrameProto::scrollBarMaximum(Qt::Orientation orientation) const
{
scriptDeprecated("QWebFrame will not be available in future versions");
QWebFrame *item = qscriptvalue_cast<QWebFrame*>(thisObject());
if (item)
return item->scrollBarMaximum(orientation);
return 0;
}
示例4: AppendMessage
void ChatTab::AppendMessage (Plugins::IMessage *msg)
{
Plugins::ICLEntry *other = qobject_cast<Plugins::ICLEntry*> (msg->OtherPart ());
if (!other && msg->OtherPart ())
{
qWarning () << Q_FUNC_INFO
<< "message's other part doesn't implement ICLEntry"
<< msg->GetObject ()
<< msg->OtherPart ();
return;
}
if (msg->GetDirection () == Plugins::IMessage::DOut &&
other->GetEntryType () == Plugins::ICLEntry::ETMUC)
return;
QWebFrame *frame = Ui_.View_->page ()->mainFrame ();
bool shouldScrollFurther = (frame->scrollBarMaximum (Qt::Vertical) ==
frame->scrollBarValue (Qt::Vertical));
QString body = FormatBody (msg->GetBody (), msg);
QString string = QString ("%1 ")
.arg (FormatDate (msg->GetDateTime (), msg));
string.append (' ');
switch (msg->GetDirection ())
{
case Plugins::IMessage::DIn:
{
switch (msg->GetMessageType ())
{
case Plugins::IMessage::MTChatMessage:
case Plugins::IMessage::MTMUCMessage:
{
QString entryName = Qt::escape (other->GetEntryName ());
entryName = FormatNickname (entryName, msg);
if (body.startsWith ("/me "))
{
body = body.mid (3);
string.append ("*** ");
string.append (entryName);
string.append (' ');
}
else
{
string.append (entryName);
string.append (": ");
}
break;
}
case Plugins::IMessage::MTEventMessage:
string.append ("! ");
break;
}
break;
}
case Plugins::IMessage::DOut:
string.append (FormatNickname ("R", msg));
string.append (": ");
break;
}
string.append (body);
QWebElement elem = frame->findFirstElement ("body");
elem.appendInside (QString ("<div>%1</div").arg (string));
if (shouldScrollFurther)
QTimer::singleShot (100,
this,
SLOT (scrollToEnd ()));
}
示例5: scrollToEnd
void ChatTab::scrollToEnd ()
{
QWebFrame *frame = Ui_.View_->page ()->mainFrame ();
int scrollMax = frame->scrollBarMaximum (Qt::Vertical);
frame->setScrollBarValue (Qt::Vertical, scrollMax);
}