Show control and handle large rows for QTableView

  • Hi all,

    I am implement a chat application (like skype)
    I am using QTableWidget to display chat messages, but it's too slow when display many messages (because each message is a widget, so if my chat has 1000 messages, it'll create 1000 widgets and add to qtablewidget .. too slow and cost memory much :( )

    I tend to change on QTableView, I have read docs and see QTableView is very good for display large message, but it's hard to display control which I can interact.
    ex: I need display a text which I can select and button which I can click, v..v.
    but using paint is not enough, it's just ... paint pixel, not the real control and I can't select my text or click button.

    I had search and try some solution like setIndexWidget, but this way seem ... like QTableWidgets (because it will create 1000 buttons if I have 1000 message as well)

    Is anyone can suggest me some instructions :(
    Thanks you

    I had implement a sample qtable widgets can display control with reuseable widgets (base on the idea of modal-view-controller) But it's not complete +_+ Please check this for more details:

    This is what I want to do:

    I just wonder if I my way correct ? Is therer others way better ?

  • Hi,
    Before someone goes through your code, maybe add a small picture to your post. How do you need it to look, what should your GUI look like. Maybe the TableView is not the best option.

  • Thank Jeroentje,
    I just update photo

Log in to reply

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