×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    31

    Kinetic Scrolling Problem

    Hi,

    I am not able to achieve Kinetic scrolling.
    Here is my code:

    view = new QWebView();
    view->page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
    view->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);

    vlayout=new QVBoxLayout();
    vlayout->addWidget(view);

    proxy = new QGraphicsProxyWidget(this);

    wid=new QWidget();
    wid->setFixedSize(QApplication::desktop()->screenGeometry().width(),QApplication::desktop()->screenGeometry().height());
    wid->setLayout(vlayout);
    wid->show();


    scrollArea = new QScrollArea();
    scrollArea->setWidgetResizable(true);
    scrollArea->setFixedHeight(wid->height());
    scrollArea->setFixedWidth(wid->width());
    scrollArea->horizontalScrollBar()->setHidden(true);
    scrollArea->verticalScrollBar()->setHidden(true);

    scrollArea->setWidget(wid);
    proxy->setWidget(scrollArea);

    MyKineticScroller* myScroller = new MyKineticScroller(this);
    myScroller->enableKineticScrollFor(scrollArea);

    MyKineticScroller class can be obtained from:
    http://www.developer.nokia.com/Commu...implementation

    I am able to scroll around the edges of my screen,but not able to scroll the page through middle area of the screen. i would like to apply kinetic scrolling effect.


    Thanks
    Last edited by Siddharth5; 2011-12-09 at 09:24.

  2. #2
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Kinetic Scrolling Problem

    Hi,
    I think that it doesn't work because the GraphicsView doesn't send the mouse move events to your webview.
    You can install an even filter in the graphics view and send them to the webview/kinetic scroller class.

    BTW you can simplify the things if you use a DeclarativeView (which actually is a GraphicsView) and a WebPage QML element.

  3. #3
    Registered User
    Join Date
    Sep 2010
    Posts
    31

    Re: Kinetic Scrolling Problem

    Hi gnuton,

    Can you please provide a code snippet for it.

    Thanks,
    Siddharth5

  4. #4
    Registered User
    Join Date
    Sep 2010
    Posts
    31

    Re: Kinetic Scrolling Problem

    Thanks gnuton,

    Kinetic Scrolling is working fine.But I am still getting an issue. I redirect from one webpage to another in Qwebview and then scroll the second page till end.The contents in first webpage is half the screen height and the contents in second page is more than the screen height.In second page,I have a back button.When I Click back button,it redirects me to first page but the first page takes the height of second page and I have to scroll up to get the content of first page.Is there a way to get top of the page directly when back button is clicked,so that I can get content.

    Thanks,
    Siddharth5
    Last edited by Siddharth5; 2011-12-16 at 12:58.

Similar Threads

  1. problem with qt4.6 QwebView kinetic scrolling
    By mismael in forum Nokia N9
    Replies: 13
    Last Post: 2010-05-17, 08:32
  2. Listbox and kinetic scrolling problem
    By miikkis in forum Symbian User Interface
    Replies: 4
    Last Post: 2010-04-25, 16:52
  3. How to implement kinetic scrolling?
    By svdwal in forum Symbian User Interface
    Replies: 8
    Last Post: 2010-01-28, 14:36
  4. kinetic scrolling on N97
    By xlazom00 in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-12-21, 13:06
  5. kinetic scrolling
    By stalep in forum Nokia N9
    Replies: 10
    Last Post: 2009-12-08, 12:41

Posting Permissions

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