How to update 6000 buttons.

  • Hello All,

    I am working on a new embedded application. As per the details available to me there is one vertical scroll area. Each row has 5 buttons. And the total number of buttons that this scroll area has to show are 6000.

    So at a time only 20 buttons (5 buttons in each row X 4 rows) are visible.
    My question is:

    How QT will handle this situation? Will it only update the visible part of the scroll area or all the 6000 buttons will be updated. When i send the update command then it will only update the buttons in the visible view port or it will take care of all the buttons.

    Since this is an embedded application, drawing and updating 6000 buttons will take lot of time.
    Please tell me if there is any better widget to handle this situation?

    Please enlighten me with your ideas :)


  • Lifetime Qt Champion


    6000 ? You should maybe take a look at the QGraphicsView framework

    Why do you need that many buttons ? What will they do ?

  • Moderators

    Use MVC and QListView/ QTreeView/ etc. together with lazy object loading.

  • Dear QT Experts (SGaist and Sierdzio)
    Thanks for your reply. I will look into the solutions provided by you.

    Dear SGaist: Actually 6000 buttons are related to the contact list. Even if the contact list is empty, we still need to show all the empty 6000 buttons.

    Thanks a lot :)


  • Lifetime Qt Champion

    If you really need to keep the QPushButton design, you should rather work with much less buttons and use e.g. a small database and use e.g. QDataWidgetMapper

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.