Results 1 to 5 of 5

Thread: Scrollbar code

  1. #1
    Join Date
    Oct 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Scrollbar code

    Has anyone coded a scrollbar in QML like the ones used in desktop apps?
    I looked at the scrollbar example but that only reacts to the flickable image. I would like something similar but instead of flicking the image you could use the scrollbar to move the image, you know, like a scrollbar...

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Scrollbar code

    You can use the ScrollBar element from the example. It's just the way you use it that needs to be changed. The position of the image needs to be bound to the value of the scroll bar, not the other way round. You'll just need to add a mouse area to the scroll bar to handle position changes.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Scrollbar code

    Thanks. I knew that but was unsure how exactly to make it happen. I just started using QML yesterday. Any source code would be appreciated.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Scrollbar code

    Well then you are one day ahead of me I only managed to write a simple "hello world" app a couple of weeks ago. Take a look at the MouseArea example.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2006
    Posts
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Scrollbar code

    Might be a bit late but I have implemented a dynamic ScrollArea with native desktop scrollbars here: https://qt.gitorious.org/qt-components

Similar Threads

  1. How to add scrollbar...?
    By jojanpm in forum Qt Programming
    Replies: 4
    Last Post: 25th October 2010, 19:51
  2. ScrollBar
    By damodharan in forum Qt Programming
    Replies: 1
    Last Post: 11th February 2010, 15:50
  3. Scrollbar
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 31st October 2007, 08:33
  4. Pasting code from code tag in emacs
    By Gopala Krishna in forum General Discussion
    Replies: 0
    Last Post: 16th February 2007, 06:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.