×

Discussion Board

Results 1 to 8 of 8

Hybrid View

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    8

    Move in QWebView

    Hello,

    I would like move in QWebView, I disable scrolling vertical and horizontal and I want to use my finger to scroll QWebView same browser on touch device.

    kinetic finger scrolling on ? enable ?

    Someone can help me ?

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

  3. #3
    Registered User
    Join Date
    Feb 2011
    Posts
    8

    Re: Move in QWebView

    thanks @divanov, i go to read it

  4. #4
    Registered User
    Join Date
    Feb 2011
    Posts
    8

    Re: Move in QWebView

    I'm back,

    I see that @remy_david did in the exemple.

    How do i implement the code in mine? I followed the tutorial "Porting WRT To Qt Applications"

    wrtwidgetwindow.cpp :


    #include "wrtwidgetwindow.h"

    #include <QtGui/QFrame>
    #include <QtGui/QVBoxLayout>
    #include <QtWebKit/QWebView>
    #include <QApplication>
    #include <QtWebKit/QWebFrame>
    #include <QtWebKit/QWebSettings>

    WRTWidgetWindow::WRTWidgetWindow(QWidget *parent)
    : QMainWindow(parent)
    {
    setupUI();
    }

    WRTWidgetWindow::~WRTWidgetWindow()
    {
    webView->deleteLater();
    }

    void WRTWidgetWindow::setupUI()
    {
    QFrame* cw = new QFrame(this);
    setCentralWidget(cw);

    QVBoxLayout* layout = new QVBoxLayout(cw);
    cw->setLayout(layout);

    webView = createWebView();
    layout->addWidget(webView);
    }

    void WRTWidgetWindow::close()
    {
    QApplication::exit();
    }

    void WRTWidgetWindow::addJavaScriptObject()
    {
    this->webView->page()->mainFrame()->addToJavaScriptWindowObject("clientApp",this);
    }

    QWebView* WRTWidgetWindow::createWebView()
    {
    QWebView* view = new QWebView(this);

    view->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
    view->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
    view->page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);

    view->mouseMoveEvent();

    connect(view->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()),this, SLOT(addJavaScriptObject()));
    view->load(QUrl("qrc:/html/index.html"));

    return view;
    }

  5. #5
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Move in QWebView

    I believe the code in other thread is re-usable without any modifications.

  6. #6
    Registered User
    Join Date
    Feb 2011
    Posts
    8

    Re: Move in QWebView

    so I must use

    void MyListView::mouseReleaseEvent(QMouseEvent * mouseEvent)
    {
    isPressed = false;
    if( !isMoving )
    emit(selected(indexAt(lastPressPoint)));
    }

    ... but what's MyListView ?

    I'm sorry if I'm bad
    I'm only web developer.

    I trie to migrate in development web mobile, I create application with WRT but it's very slow.

  7. #7
    Registered User
    Join Date
    Feb 2011
    Posts
    8

    Re: Move in QWebView

    I have a video where application with QWebView use kinetic scrolling

    http://www.izlesene.com/video/nokia-...ebview/3015927

  8. #8
    Registered User
    Join Date
    Apr 2010
    Location
    Rosario, Santa Fe - Argentina
    Posts
    6

    Re: Move in QWebView

    Was anyone able to do the scrolling in the video ?
    vruno

Similar Threads

  1. External Javascript in QWebView
    By AS.Sri in forum Qt
    Replies: 1
    Last Post: 2010-12-07, 12:59

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×