Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QsKineticScroller

QsKineticScroller

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 3 Posters 5.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    joe1
    wrote on last edited by
    #1

    Is it possible to add kinetic scrolling to a project like the one provided by Nokia Qt SDK => "Creating a mobile application with Nokia Qt SDK"?
    The applications base class is QDialog.
    Following the QsKineticScroller article http://blog.codeimproved.net/2010/12/kinetic-scrolling-with-qt-the-what-and-the-how/ I've tried within the constructor:

    @QsKineticScroller *scroller = new QsKineticScroller(this);
    QAbstractScrollArea *area = new QAbstractScrollArea(this);
    area->setViewport(parent);
    scroller->enableKineticScrollFor(area);
    @

    But nothing happened. What's wrong here?
    Thanks.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Line 3 looks very suspicious. Setting the parent as the contents of a child? That doesn't sound right...

      1 Reply Last reply
      0
      • J Offline
        J Offline
        joe1
        wrote on last edited by
        #3

        OK - so how to set the QAbstractScrollArea to the parent widget?
        Thank you!

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Errr... perhaps you should explain to us what you want to achieve. You are not making much sense. A parent widget can not be "set to" (?) a widget that is a child of that same parent. Makes at little sense as claiming that your grandmother is your child.

          1 Reply Last reply
          0
          • J Offline
            J Offline
            joe1
            wrote on last edited by
            #5

            I would like to get a scrollable dialog that contains multiple line edits, progress bars and other display widgets.

            I wonder if it's possible to define a QAbstractScrollArea that covers the whole dialog (designed by the designer of Qt Creator). If yes this area should be given to enableKineticScrollFor().

            Is this approach possible?
            If not - what would be the right way?
            Thank you!

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              Yes. It is.
              Simply do exactly as you describe above: create a Qt form class in designer, put a big scroll area on it (not QAbstractScrollArea, "abstract" classes are not meant for direct use but for subclassing), and put the widgets you want on that. Give the scroll area a name like "scrollArea" Should work like a charm.

              Now, in code, add a few lines to the constructor of your class (the one where'll find the setupUi call), and simply add:

              @
              QsKineticScroller *scroller = new QsKineticScroller(this);
              scroller->enableKineticScrollFor(ui->scrollArea);
              @

              1 Reply Last reply
              0
              • J Offline
                J Offline
                joe1
                wrote on last edited by
                #7

                Great - it works fine.
                Hoever - I had to disable "widgetResizable" for the scrollArea to get scrolling.
                Is this ok?

                Thank you for your help!

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  jessfortress
                  wrote on last edited by
                  #8

                  I try to put webView widget on the scrollArea but seems like it doesn't work.. should it be working on webView or not?

                  Thanks in advance,
                  -=J=-

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved