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
Forum Updated to NodeBB v4.3 + New Features

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 2 Watching
  • 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.
  • S Offline
    S Offline
    Sudo007
    wrote on 9 Jul 2016, 18:18 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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 9 Jul 2016, 22:17 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
      • S Offline
        S Offline
        Sudo007
        wrote on 12 Jul 2016, 07:52 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?

        R 1 Reply Last reply 12 Jul 2016, 08:06
        0
        • S Sudo007
          12 Jul 2016, 07:52

          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?

          R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 12 Jul 2016, 08:06 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 12 Jul 2016, 10:40 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

            5/5

            12 Jul 2016, 10:40

            • Login

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