qt5.2 - kinetic support for scrollable widgets with flickcharm

77 views
Skip to first unread message

Paul-Henri FERME

unread,
Apr 13, 2014, 2:09:19 PM4/13/14
to andro...@googlegroups.com
As reported on this group if you are looking for kinetic scolling with qt widget, you cannot compile flickcharm example as provided by
and
Reason is in Qt5.2 stable QWebView is not ported to android yet.

However if you are just interested about kinetic support for widget using  QAbstractScollArea (like for example QTextEdit) you can just comment out the QWebView support in the code (see below)
This work quite nicely.....

Hope this is helpfull!


PHF



fickcharm.cpp
============


//#include <QWebFrame>
//#include <QWebView>
../..
void FlickCharm::activateOn(QWidget *widget)
../..
//    QWebView *webView = qobject_cast<QWebView*>(widget);
//    if (webView) {
//        QWebFrame *frame = webView->page()->mainFrame();
//        frame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
//        frame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);

//        webView->installEventFilter(this);

//        d->flickData.remove(webView);
//        d->flickData[webView] = new FlickData;
//        d->flickData[webView]->widget = webView;
//        d->flickData[webView]->state = FlickData::Steady;

//        return;
//    }

    qWarning() << "FlickCharm only works on QAbstractScrollArea (and derived classes)";
 //   qWarning() << "or QWebView (and derived classes)";
../..
void FlickCharm::deactivateFrom(QWidget *widget)
../..
//    QWebView *webView = qobject_cast<QWebView*>(widget);
//    if (webView) {
//        webView->removeEventFilter(this);

//        delete d->flickData[webView];
//        d->flickData.remove(webView);

//        return;
//    }

Reply all
Reply to author
Forward
0 new messages