Results 1 to 6 of 6

Thread: How to deactivate horizontal scrolling in QScrollArea?

  1. #1
    Join Date
    Jan 2012
    Posts
    15
    Thanks
    4
    Qt products
    Qt4

    Default How to deactivate horizontal scrolling in QScrollArea?

    Hi i got a problem with a QScrollArea. I want to deactivate horizontal scrolling. On windows systems i just use ->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ) this is sufficient for me. But on mac systems the user can scroll using the 2 finger scroll. How to block this?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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: How to deactivate horizontal scrolling in QScrollArea?

    Why do you want to deactivate scrolling?
    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
    Jan 2012
    Posts
    15
    Thanks
    4
    Qt products
    Qt4

    Default Re: How to deactivate horizontal scrolling in QScrollArea?

    Because right now it is possible to scroll outside of the area wich contains the content (im override paintEvent to paint my own content). So i just want to stop the scrollbar in the scrollArea to change its value.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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: How to deactivate horizontal scrolling in QScrollArea?

    If it possible to scroll outside the area with the content, it is because you made it so. Did you subclass QAbstractScrollArea or QScrollArea?
    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 2012
    Posts
    15
    Thanks
    4
    Qt products
    Qt4

    Default Re: How to deactivate horizontal scrolling in QScrollArea?

    I subclassed QScrollArea.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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: How to deactivate horizontal scrolling in QScrollArea?

    And why not QAbstractScrollArea?
    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.


  7. The following user says thank you to wysota for this useful post:


Similar Threads

  1. Scrolling Contents in QScrollArea
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 6
    Last Post: 2nd February 2011, 11:11
  2. Replies: 4
    Last Post: 2nd January 2011, 07:46
  3. Horizontal Scrolling QListWidget
    By bl1nk in forum Qt Programming
    Replies: 1
    Last Post: 17th July 2010, 08:44
  4. QScrollArea scrolling down not up
    By ntp in forum Qt Programming
    Replies: 5
    Last Post: 20th August 2008, 17:23
  5. Replies: 2
    Last Post: 10th March 2008, 20:16

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.