Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Application gets freezed due to read huge data from SQLite database periodically

Qt Application gets freezed due to read huge data from SQLite database periodically

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtableviewqitemdelegate
5 Posts 4 Posters 1.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Sudo007S Offline
    Sudo007S Offline
    Sudo007
    wrote on last edited by
    #1

    i have issues in showing huge data in QTableView ,data read from sqlite database which is being updated dynamically .. 2k rows in 2s.
    i am using QSQLRelationModel
    let me describe the scenario in detail.

    My Qt application has a view i.e QTableView , each row has following structure:


    QPushButton|QLabel | QLabel | QLabel *


    i have created it using QItemDelegate

    each row isinserted dynamicaly , after sometime gui gets freezed.

    could anyone tell me the way to fix the issue.

    Thanks in advance.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Do I understand correctly that you are creating one widget per column for the 4 columns ? If so, it means that you are trying to create more than 8000 widgets in 2 seconds which isn't exactly efficient and performance friendly.

      What is your exact setup ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Sudo007S Offline
        Sudo007S Offline
        Sudo007
        wrote on last edited by
        #3

        hi
        I have created a class customDelegate (inherits QItemDelegate) in my Qt applicatrion and i created setEditor() function.But the delegate is not visible in the QTableView , untill i click on the row.
        How to fix the issue?

        raven-worxR 1 Reply Last reply
        0
        • Sudo007S Sudo007

          hi
          I have created a class customDelegate (inherits QItemDelegate) in my Qt applicatrion and i created setEditor() function.But the delegate is not visible in the QTableView , untill i click on the row.
          How to fix the issue?

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @Sudo007 said:

          How to fix the issue?

          caching, paging, query optimization, etc. ... but this is a rather generic answer to a generic question.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          1
          • S Offline
            S Offline
            Sam
            wrote on last edited by
            #5

            @Sudo007 said:

            hi
            I have created a class customDelegate (inherits QItemDelegate) in my Qt applicatrion and i created setEditor() function.But the delegate is not visible in the QTableView , untill i click on the row.
            How to fix the issue?

            How did you implement the paint() in your custom delegate ? As you are adding different widget in each cell, you need to paint a fake widget (QPushButton) using QApplication::style()->drawControl(QStyle::CE_PushButton, &btn,painter); where btn is QStyleOptionButton, then in createEditor() you create an instance of QPushButton.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved