void MainWindow::chatContentsSizeChanged(const QSize &size) { // webkit is dumb ok QWebFrame* frame = this->ui->baseChatWindow->page()->mainFrame(); if (this->autoScroll) { frame->setScrollBarValue(Qt::Vertical, size.height()); } else { frame->setScrollBarValue(Qt::Vertical, this->scrollValue); } }
void QMyWebView::mouseMoveEvent ( QMouseEvent * event ){ if((event->buttons()==Qt::LeftButton)&&(page()->mainFrame())){ int disx = event->globalX()-oldX1; int disy = event->globalY()-oldY1; if((qAbs(disx)>10)/*&&(horizontalScrollBar()->isVisible())*/){ QWebFrame *frame = page()->mainFrame(); frame->setScrollBarValue(Qt::Horizontal,oldhscrollval-disx); frame->setScrollBarValue(Qt::Vertical,oldvscrollval-disy); event->accept(); return; } } QWebView::mouseMoveEvent(event); }
void QWebFrameProto::setScrollBarValue(Qt::Orientation orientation, int value) { scriptDeprecated("QWebFrame will not be available in future versions"); QWebFrame *item = qscriptvalue_cast<QWebFrame*>(thisObject()); if (item) item->setScrollBarValue(orientation, value); }
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)); }
void ChatTab::scrollToEnd () { QWebFrame *frame = Ui_.View_->page ()->mainFrame (); int scrollMax = frame->scrollBarMaximum (Qt::Vertical); frame->setScrollBarValue (Qt::Vertical, scrollMax); }