Results 1 to 3 of 3

Thread: Use QScrollArea, QListView or QScrollBar?

  1. #1
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    21
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Use QScrollArea, QListView or QScrollBar?

    I'm currently working on an application that looks like the attaced screenshot.
    As allready posted here: http://www.qtcentre.org/forum/f-newb...html#post16024 i have speed problems, so would like to ask how could i do this best.

    My ideas:
    - a QScrollArea with all widgets in it (my current solution, kind of slow when adding/removing widgets)
    - QListView based (but i have no idea what to do with the graph)
    - create only the Widgets that are visible. Using a QScrollBar I would have to implement my own scrolling-code (especially the "smoth-scrolling" like the QScrollArea provides sounds hard to me!)

    please help me on this,
    thanks, niko
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Use QScrollArea, QListView or QScrollBar?

    Try simply decreasing the number of widgets to the minimum. I have sometimes noticed some slow downs when using large sets and/or deep hierarchies of widgets. Even a dummy and simple widget eats resources. What can I say, I have mostly succeeded in optimizing by just dropping out unnecessary widgets. With unnecessary widgets I mean something like labels which stand there just for showing some text and so on. You can use for example existent widget's content margins to draw some text instead of allocating them all as individual label widgets. It is hard, if not impossible, to give any "real" advices just by having looked at the attached picture...
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    21
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Use QScrollArea, QListView or QScrollBar?

    thanks for that tipp!
    i will rewrite the application and only create the absolute necessary widgets... a bit more complicated than the QScrollArea

    niko

Similar Threads

  1. Key Events for QListView
    By bmesing in forum Qt Programming
    Replies: 2
    Last Post: 4th April 2006, 09:29
  2. QScrollArea problem positioning a QWidget inside
    By Spectator in forum Qt Programming
    Replies: 4
    Last Post: 20th February 2006, 22:59
  3. Problem with QScrollArea updating from 4.0.1 to 4.1.0
    By SkripT in forum Qt Programming
    Replies: 8
    Last Post: 28th January 2006, 22:35
  4. drawContents in QScrollArea (Qt4)
    By SkripT in forum Qt Programming
    Replies: 15
    Last Post: 14th January 2006, 10:54
  5. Keeping focus at bottom of QListView
    By jakamph in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2006, 14:45

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.