Results 1 to 4 of 4

Thread: Too many events for a QTableview ???

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    56
    Thanked 1 Time in 1 Post

    Default Too many events for a QTableview ???

    I have a simple QTableview linked wiht a custom tablemodel.
    I have 2x2 cells.
    I wanted to know what is happen inside tablemodel (how it works) and I write a debug code to make it possible.
    I have 2 logs, the first during initial visualization, the second when click o a cell.
    I think that there is many instruccions to process.
    Any idea ?

    The log I have, just only to view the Window with the QtableView.
    row count
    col count
    row count
    col count
    row count
    col count
    row count
    row count
    row count
    col count
    row count
    col count
    row count
    col count
    col count
    row count
    headerdata0 2
    headerdata0 2
    headerdata0 2
    headerdata0 2
    row count
    headerdata1 2
    headerdata1 2
    headerdata1 2
    headerdata1 2
    col count
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    col count
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    col count
    row count
    col count
    row count
    col count
    row count
    col count
    headerdata0 2
    headerdata0 2
    headerdata0 2
    headerdata0 2
    headerdata1 2
    headerdata1 2
    headerdata1 2
    headerdata1 2
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    row count
    col count
    row count
    col count
    flags0 0
    flags0 0
    row count
    row count
    row count
    col count
    flags0 0
    ask for data0 0
    ask for data0 0
    ask for data0 0
    ask for data0 0
    ask for data0 0
    ask for data0 0
    ask for data0 0
    row count
    col count
    flags0 1
    ask for data0 1
    ask for data0 1
    ask for data0 1
    ask for data0 1
    ask for data0 1
    ask for data0 1
    ask for data0 1
    row count
    col count
    flags1 0
    ask for data1 0
    ask for data1 0
    ask for data1 0
    ask for data1 0
    ask for data1 0
    ask for data1 0
    ask for data1 0
    row count
    col count
    flags1 1
    ask for data1 1
    ask for data1 1
    ask for data1 1
    ask for data1 1
    ask for data1 1
    ask for data1 1
    ask for data1 1
    headerdata0 2
    headerdata0 2
    headerdata0 2
    headerdata0 2
    headerdata0 2
    headerdata0 2
    headerdata1 2
    headerdata1 2
    headerdata1 2
    headerdata1 2
    headerdata1 2
    headerdata1 2
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata0 2
    headerdata0 2
    headerdata0 2
    headerdata0 2
    headerdata1 2
    headerdata1 2
    headerdata1 2
    headerdata1 2
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1


    This is the log I get when click on cell 0,0
    row count
    row count
    col count
    flags0 0
    ask for data 0 0
    ask for data 0 0
    ask for data 0 0
    ask for data 0 0
    ask for data 0 0
    ask for data 0 0
    ask for data 0 0
    row count
    col count
    flags0 1
    ask for data 0 1
    ask for data 0 1
    ask for data 0 1
    ask for data 0 1
    ask for data 0 1
    ask for data 0 1
    ask for data 0 1
    row count
    col count
    flags1 0
    ask for data 1 0
    ask for data 1 0
    ask for data 1 0
    ask for data 1 0
    ask for data 1 0
    ask for data 1 0
    ask for data 1 0
    row count
    col count
    flags1 1
    ask for data 1 1
    ask for data 1 1
    ask for data 1 1
    ask for data 1 1
    ask for data 1 1
    ask for data 1 1
    ask for data 1 1
    headerdata0 2
    headerdata0 2
    headerdata0 2
    headerdata0 2
    headerdata0 2
    headerdata0 2
    headerdata1 2
    headerdata1 2
    headerdata1 2
    headerdata1 2
    headerdata1 2
    headerdata1 2
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata1 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    headerdata0 1
    row count
    col count
    flags0 0
    flags0 0
    flags0 0
    flags0 0
    row count
    row count
    col count
    row count
    col count
    flags0 0
    flags0 0

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Too many events for a QTableview ???

    So what's exactly your question? "Is it normal that the model is queried so much during initialization?". If so, then yes, it's normal. And the actual count depends on the settings of the view. Especially resizing columns to contents puts a heavy impact on the model-view communication.
    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.


  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    56
    Thanked 1 Time in 1 Post

    Default Re: Too many events for a QTableview ???

    Ok, you consider it's normal, but I think that there is a lot of unuseful job.
    The only thing that is used 'normally' is the 'flag' control, it is called only a litte times, but .... I'm surprised of the 100 instrucciones I see only when click on 0x0 cell.
    It is not initialization .....

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Too many events for a QTableview ???

    Quote Originally Posted by tonnot View Post
    Ok, you consider it's normal, but I think that there is a lot of unuseful job.
    No problem - correct the code then and submit a patch to Qt.
    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. Qt...Using Events
    By Peppy in forum Qt Programming
    Replies: 5
    Last Post: 27th December 2009, 10:41
  2. Replies: 2
    Last Post: 26th November 2009, 05:45
  3. Events
    By SV in forum Qt Programming
    Replies: 0
    Last Post: 21st May 2008, 09:48
  4. QT Events
    By Sreeja in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2006, 09:25
  5. Events - how to
    By eleanor in forum Newbie
    Replies: 2
    Last Post: 13th November 2006, 08:23

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
  •  
Qt is a trademark of The Qt Company.