Results 1 to 5 of 5

Thread: Resizing instead of scrolling of a QListWidget: is it possible?

  1. #1
    Join Date
    Jan 2006
    Posts
    52
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Resizing instead of scrolling of a QListWidget: is it possible?

    I have a couple of QListWidgets in a QScrollArea.

    Their behavior right now is that if the user add more items than there is space the QListWidget will show scroll bars for scrolling around. What I want the QListWidget to do is to resize itself to fit since the QScrollArea will already take care of the scroll bars. My question is: is it possible?


    Thanks
    Dave
    Last edited by dave; 8th May 2010 at 23:02.

  2. #2
    Join Date
    Jan 2006
    Posts
    52
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Resizing instead of scrolling of a QListWidget: is it possible?

    Anything? Surely somebody somewhere must have some idea.

  3. #3
    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: Resizing instead of scrolling of a QListWidget: is it possible?

    Yes, this is possible but you have to calculate the new size yourself and set it manually on the widget.
    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.


  4. #4
    Join Date
    Jan 2006
    Posts
    52
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Resizing instead of scrolling of a QListWidget: is it possible?

    Quote Originally Posted by wysota View Post
    Yes, this is possible but you have to calculate the new size yourself and set it manually on the widget.
    yes. but in reply to what. What signal/???? should I catch to know I have to recalculate the size?

  5. #5
    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: Resizing instead of scrolling of a QListWidget: is it possible?

    QListWidget doesn't seem to have an appropriate signal but there is no chance items are added to it behind your back so you should know yourself when items are added. If you were using the model-based approach you could have used signals from the model.
    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.


Similar Threads

  1. QItemDelegate and Scrolling
    By SElsner in forum Newbie
    Replies: 4
    Last Post: 8th March 2010, 12:08
  2. Replies: 3
    Last Post: 2nd March 2010, 20:58
  3. Kinetic scrolling in QListWidget
    By jimiq in forum Qt Programming
    Replies: 2
    Last Post: 16th September 2009, 09:43
  4. Scrolling QTextEdit
    By Dayton in forum Qt Programming
    Replies: 2
    Last Post: 3rd June 2009, 21:11
  5. Replies: 18
    Last Post: 23rd July 2007, 05:58

Tags for this Thread

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.