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. Exception triggered error while going down in Tableview?
Forum Updated to NodeBB v4.3 + New Features

Exception triggered error while going down in Tableview?

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 467 Views 1 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.
  • MucipM Offline
    MucipM Offline
    Mucip
    wrote on last edited by
    #1

    Hi,
    I use Qt 5.13.2 and PostgreSQL12 on windows platform.
    I get the sql query and send it as model to tableview. When I push down arrow button continiously I get error and program crush?!

    67a882b6-3305-447a-8693-560e45e6f9fb-resim.png

    I run it via debugger and there is nothing detailed about error?!...

    Regards,
    Mucip:)

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #5

      Please remove the processEvents() stuff - it's not needed at all. Please also show us the backtrace when it still happens.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      MucipM 2 Replies Last reply
      1
      • MucipM Offline
        MucipM Offline
        Mucip
        wrote on last edited by
        #2

        Hi,
        I think I found the problem but I son't know the reason?

        I use hourglass icon while the view process is working

        this->setCursor(Qt::WaitCursor);
        QApplication::processEvents();
        .
        .
        //Process
        .
        .
        this->setCursor(Qt::ArrowCursor);
        QApplication::processEvents();
        
        
        

        When I close these lines than no problem...

        Regards,
        Mucip:)

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #3

          What happens inside this block and why do you call QCoreApplication::processEvents()?

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          MucipM 1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            What happens inside this block and why do you call QCoreApplication::processEvents()?

            MucipM Offline
            MucipM Offline
            Mucip
            wrote on last edited by Mucip
            #4

            Hi @Christian-Ehrlicher ,
            Some SQL process. I want to show hourglass while retrieving data from PostgreSQL.

            Code is below,

            modelTableAgac->setQuery("SELECT is_emri_detay.sn, is_emri_detay.stok_kod, stok_kart.stok_ad, "
                                         "is_emri_detay.recete_birim, is_emri_detay.recete_miktar, is_emri_detay.aciklama "
                                         "FROM is_emri_detay LEFT JOIN stok_kart ON stok_kart.stok_kod = is_emri_detay.stok_kod "
                                         "WHERE kaynak_sn = " +
                                         index.sibling(index.row(), 0).data().toString() +" ORDER BY is_emri_detay.sn;", baglanti::mdb());
            
                ui->tVurunAgaci->setModel(modelTableAgac);
            
                ui->tVurunAgaci->resizeColumnsToContents();
                ui->tVurunAgaci->horizontalHeader()->setSectionResizeMode(5, QHeaderView::Stretch);
            
            
            
            
                modelTableoperasyon->setQuery("SELECT sn, operasyon_sira_no, tezgah_kod, sure_dk, adam_adet, aciklama "
                                              "FROM is_emri_operasyon WHERE kaynak_sn = " +
                                         index.sibling(index.row(), 0).data().toString() +" ORDER BY operasyon_sira_no, sn;", baglanti::mdb());
            
                ui->tVOperasyon->setModel(modelTableoperasyon);
            
                ui->tVOperasyon->resizeColumnsToContents();
                ui->tVOperasyon->horizontalHeader()->setSectionResizeMode(5, QHeaderView::Stretch);
            

            By the way I ussed it to inform operating system that pointer has changed.
            And now I commented it and tred again. Same error happened...

            Regards,
            Mucip:)

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #5

              Please remove the processEvents() stuff - it's not needed at all. Please also show us the backtrace when it still happens.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              MucipM 2 Replies Last reply
              1
              • Christian EhrlicherC Christian Ehrlicher

                Please remove the processEvents() stuff - it's not needed at all. Please also show us the backtrace when it still happens.

                MucipM Offline
                MucipM Offline
                Mucip
                wrote on last edited by Mucip
                #6

                Hi @Christian-Ehrlicher ,
                I am so sorry. I have been changing another part of the code. :)

                I removed ProcessEvents() and now it's OK... :)

                Regards,
                Mucip:)

                1 Reply Last reply
                0
                • Christian EhrlicherC Christian Ehrlicher

                  Please remove the processEvents() stuff - it's not needed at all. Please also show us the backtrace when it still happens.

                  MucipM Offline
                  MucipM Offline
                  Mucip
                  wrote on last edited by
                  #7

                  @Christian-Ehrlicher ,
                  By the way, what is the problem with ProcessEvents()???

                  Regards,
                  Mucip:)

                  1 Reply Last reply
                  0
                  • Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #8

                    processEvents spins a new eventloop - this means events in the queue are processed which may interfere with your stuff.

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    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