×

Discussion Board

Results 1 to 15 of 15

Hybrid View

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    15

    Fingerscrolling in QGraphicsView framework

    Hi!

    I have an application with following elements/ownership:

    QApplication->QMainWindow->QGraphicsView->QGraphicsScene->multiple QGraphicsItems

    The scene is bigger than the screen in N900, so I would like to enable FingerScrollable, but I don't seem to find the right place/way. I'm compiling in scratchbox with 4.6.0 18122009 version and have the same version on N900 as well. Hence there are no usable scrollbars (only the notification tiny ones) and scrolling with arrow keys work but fingerscrolling not. I have tried to put 'setProperty("FingerScrollable", true)' to QMainWindow class as well as to view and scene but with no luck.

    I know it works on certain other widgets, but how to enable it in QGraphicsView framework?

    >> Johannes <<

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

    Re: Fingerscrolling in QGraphicsView framework

    Reference implementation:
    Code:
    #include <QApplication>
    #include <QGraphicsView>
    #include <QGraphicsScene>
    #include <QVariant>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QGraphicsScene scene;
        scene.setSceneRect(0.0, 0.0, 1000.0, 1000.0);
        scene.addLine(0.0, 0.0, 1000.0, 1000.0);
        scene.addLine(1000.0, 0.0, 0.0, 1000.0);
    
        QGraphicsView view(&scene);
        if (!view.setProperty("FingerScrollable", true))
            qDebug("Setting FingerScrollable property failed");
        view.show();
    
        return app.exec();
    }
    FingerScrollable is property of QAbstractScrollArea area and it makes sense to set it only for objects of classes derived from QAbstractScrollArea.

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    15

    Re: Fingerscrolling in QGraphicsView framework

    Quote Originally Posted by divanov View Post
    Reference implementation:
    FingerScrollable is property of QAbstractScrollArea area and it makes sense to set it only for objects of classes derived from QAbstractScrollArea.
    I thought so myself, however your reference code did not work any better. Setting the property fails. Did it work for you? If so, what Qt version did you compile and run it on? Mine is currently 4.6.0-git20091218-0maemo1.

    >> Johannes <<

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

    Re: Fingerscrolling in QGraphicsView framework

    Quote Originally Posted by kleimola View Post
    I thought so myself, however your reference code did not work any better. Setting the property fails. Did it work for you? If so, what Qt version did you compile and run it on? Mine is currently 4.6.0-git20091218-0maemo1.
    In fact that was for Qt 4.5.3. In Qt 4.6 FingerScrollable is true by default. Unfortunately I cannot try it with 4.6 right now. If it doesn't work then it's probably a bug in Qt 4.6.

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

    Re: Fingerscrolling in QGraphicsView framework

    It would be nice to get an output of this application with Qt 4.6.
    Code:
    #include <QApplication>
    #include <QGraphicsView>
    #include <QGraphicsScene>
    #include <QVariant>
    #include <QDebug>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QGraphicsScene scene;
        scene.setSceneRect(0.0, 0.0, 1000.0, 1000.0);
        scene.addLine(0.0, 0.0, 1000.0, 1000.0);
        scene.addLine(1000.0, 0.0, 0.0, 1000.0);
    
        QGraphicsView view(&scene);
    
        QVariant scrollable = view.property("FingerScrollable");
        if (scrollable.isValid()) {
            if (scrollable.toBool())
                qDebug("FingerScrollable property is set to true");
            else if (view.setProperty("FingerScrollable", true))
                qDebug("Setting FingerScrollable property succeed");
            else
                qDebug("Setting FingerScrollable property failed");
        } else
            qDebug("No FingerScrollable property found");
    
        view.show();
    
        return app.exec();
    }

  6. #6
    Registered User
    Join Date
    Nov 2008
    Posts
    15

    Re: Fingerscrolling in QGraphicsView framework

    Quote Originally Posted by divanov View Post
    It would be nice to get an output of this application with Qt 4.6.
    [/CODE]
    ~ $ run-standalone.sh ./FingerTest
    No FingerScrollable property found
    ~ $

    ...on the N900 device. I wonder if I'm missing some specific library i should know about or should the property be included in the libqt4-maemo5-gui?

    >> Johannes <<

Similar Threads

  1. Serialization Framework for CLDC
    By phibo in forum Mobile Java General
    Replies: 1
    Last Post: 2006-11-08, 20:02
  2. Help required inusage of HTTP over TLS framework in series 60 SDK
    By nkhanna1979 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-11-27, 05:57
  3. Issue in using HTTP client framework on series 60 SDK
    By nkhanna1979 in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2005-11-25, 06:33
  4. regarding connectivity framework
    By flicker82 in forum Bluetooth Technology
    Replies: 7
    Last Post: 2004-10-27, 08:01

Posting Permissions

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