Results 1 to 7 of 7

Thread: Slow problem QTableView

  1. #1
    Join Date
    Oct 2007
    Posts
    65
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Slow problem QTableView

    Hello,
    i have created one pyqt app we are using in my company, it is warehouse application, any fast workers seems to be faster that application because of fast bar code scanners, they are introducing items in a QTableView with an internal QAbstractTableModel subclass and using QItemDelegate, i have made many profiling and fix all the bottlenecks, when they read too fast it is like the return keypress after read the bar code doesnt works, i can see in the lineedit of the cell many ean13 codes ( although after every read the bar code scanner send a return) toguether and it fails to load because it doesnt exist. To me it seems like a qt problem because it doesnt close the editor when receive a return keypressevent and read the next code in the same editor, i have been to get 4 ean13 in the same lineEdit if i try very fast, the machine where i am using the application is a pentium4 1.8 so it should be sufficient to use the app correctly, the cpu usage goes on 40% to the app, 20% to Xorg, anyone has any idea to accelerate this?

  2. #2
    Join Date
    Oct 2007
    Posts
    65
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Slow problem QTableView

    no one can help me on this? any way to accelerate qlineedit inside qitemdelegate? or what can be the problem?

  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: Slow problem QTableView

    Could you try to describe your problem again? And remember we don't know what your application does, so try to focus on the technical side.

  4. #4
    Join Date
    Oct 2007
    Posts
    65
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Slow problem QTableView

    well i have a QTableView with 5 columns, the first it is editable, i write the item number id inside the first column and the other are loaded by a sql query inside the model, the problem it is that to write the item number i am using a bar code reader so i can read 2~4 every second, the bar code reader send an return code after every read, i cant load the app now but i will attach some screenshot this night, the bar code are ean13 for example read this in column 1:

    6361324116001 <--- complete ean13, return code it is send automatically

    load the complete line and create new line and edit the first column other time to load other item. The problem i have it is that when you read too fast you will give anything like this in the qitemdelete qlineedit.

    636132411600163613241160016361324116001

    it is like the return code has not been sent and where the model execute the query this code does not exist (evidently), i have thought catch every 13 characters and do the work of create the new lines inside the model but i dont like the idea. I am using PyQt but i have profiled the application code and dont seem to be the problem, the problem seems to be in the qlineedit or QitemDelegate, and i am using the direct qt c++ class QItemDelegate without subclass it. When the application fails the cpu usage it is not over 60~75% (40~50 the app, 20~25 Xorg).

  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: Slow problem QTableView

    You might want to reimplement the delegate (especially its createEditor method) and apply some extra code on the line edit before you return it, so that it does what you want. For instance you might make sure that when a complete code is read the editor closes itself and jumps to the next row. I can't suggest more now... I'm not sure I understand exactly what you do there (especially that SQL part).

  6. #6
    Join Date
    Oct 2007
    Posts
    65
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Slow problem QTableView

    the sql loads the item columns in a struct with qvariants that it is viewed via data model method, so it loads the table but it is really fast because we have not too much items and are indexed, i could reimplemente delegate and close the editor when 13 characters are set, i can try to do that but i will have to use a checkbox when they need to do manual insert because they have modifiers to units like this:

    2*6361324116001

    2 units of 6361324116001 item.
    when they are doing manual insert they use this modifiers, but with bar code reader if they need to insert two times the same item, they read two times (its faster) so with manual insert i should change the delegate.i will try it.

  7. #7
    Join Date
    Oct 2007
    Posts
    65
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Slow problem QTableView

    this is a image of the application, the column "CODIGO" it is where the bar code reader inserts the codes.
    Attached Images Attached Images

Similar Threads

  1. QTableView selection problem
    By aiprober in forum Qt Programming
    Replies: 12
    Last Post: 9th June 2008, 11:55
  2. Problem with QTableView
    By BoneCollector in forum Qt Programming
    Replies: 5
    Last Post: 12th March 2008, 12:30
  3. problem in printing QTableView
    By miguel_mark in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2008, 08:19
  4. Problem: QThead and QTableview
    By ederbs in forum Qt Programming
    Replies: 5
    Last Post: 9th November 2007, 10:17
  5. QTableView Performance Problem on Windows
    By umitoz in forum Qt Programming
    Replies: 1
    Last Post: 31st August 2007, 16:47

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.