Results 1 to 3 of 3

Thread: QScrollArea stay down

  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default QScrollArea stay down

    Is there a way to force QScrollArea to stay down ?

    Like an instant messenger conversation.

    I tried with the following implementation, but it makes the view flickers:

    Qt Code:
    1. void ZeScrollAreaWidget::onRangeChanged(int min, int max)
    2. {
    3. if (isStayDown() == true)
    4. {
    5. if (verticalScrollBar()->sliderPosition() == mOldMax
    6. ||
    7. mOldMax == -1)
    8. {
    9. verticalScrollBar()->setSliderPosition(max);
    10. }
    11. }
    12.  
    13. mOldMax = max;
    14. }
    To copy to clipboard, switch view to plain text mode 

    Is there a way to avoid this hack? Or do I have to reimplement QAbstractScrollArea

    Thanks.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QScrollArea stay down

    You want that the slider autmatically scrolls down as the chat is in progress ??
    Have a look at
    QScrollArea::ensureWidgetVisible and

    QScrollArea::ensureVisible
    Hope it helps

  3. The following user says thank you to aamer4yu for this useful post:

    bunjee (3rd June 2008)

  4. #3
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: QScrollArea stay down

    Thanks,

    It works, but when calling it in a resizeEvent : flickering persist.

    I think I have to come up with my onw QScrollArea .

Similar Threads

  1. Replies: 2
    Last Post: 10th March 2008, 20:16
  2. QScrollArea
    By sabeesh in forum Qt Programming
    Replies: 7
    Last Post: 2nd November 2007, 10:33
  3. QScrollArea and resizing
    By rarefluid in forum Qt Programming
    Replies: 8
    Last Post: 22nd July 2007, 14:18
  4. Replies: 2
    Last Post: 8th October 2006, 20:14
  5. QScrollArea problem positioning a QWidget inside
    By Spectator in forum Qt Programming
    Replies: 4
    Last Post: 20th February 2006, 22:59

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.