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

Qt Application Slowing Down

Scheduled Pinned Locked Moved Solved General and Desktop
47 Posts 7 Posters 6.5k Views 3 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 swansorter

    @mrjj i used breakpoints on distructor
    if i use close()...they are not freed
    only if remove close()....they get cleared

    mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by
    #41

    @swansorter

    Im not sure in what context.

    if using something like

    void class::insomefunc() {
    mainSortDialog ms;
    this->close();//closes the setting screen
    ms->exec();
    }

    MS should always be deleted. the this->close() should have no effect.

    If you use new for other classes make sure it still has WA_DeleteOnClose.

    S 1 Reply Last reply
    1
    • mrjjM mrjj

      @swansorter

      Im not sure in what context.

      if using something like

      void class::insomefunc() {
      mainSortDialog ms;
      this->close();//closes the setting screen
      ms->exec();
      }

      MS should always be deleted. the this->close() should have no effect.

      If you use new for other classes make sure it still has WA_DeleteOnClose.

      S Offline
      S Offline
      swansorter
      wrote on last edited by
      #42

      @mrjj
      am using this one move to main sort
      void class::insomefunc() {
      mainSortDialog ms;
      ms->exec();
      }
      and back to main screen by using just "hide();" in back button
      this is work for me even the memory leakage.
      but if use close(); its not working
      void class::insomefunc() {
      mainSortDialog ms;
      this->close();//closes the setting screen
      ms->exec();
      }

      1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #43

        hi
        in what way "not working" ?

        S 1 Reply Last reply
        0
        • mrjjM mrjj

          hi
          in what way "not working" ?

          S Offline
          S Offline
          swansorter
          wrote on last edited by swansorter
          #44

          @mrjj
          1.i used breakpoints on distructor of each screen.
          2.am moving to main sort using
          void class::insomefunc() {
          mainSortDialog ms;
          this->close();//closes the setting screen
          ms->exec();
          }
          3.and moving back to the home page
          void class::insomefunc() {
          homeDialog h;
          this->close();//closes the setting screen
          h->exec();
          }
          at this point it is not moving to destructor
          only if i move to mainwindow it moving to destructor mainsort page

          mrjjM 1 Reply Last reply
          0
          • S swansorter

            @mrjj
            1.i used breakpoints on distructor of each screen.
            2.am moving to main sort using
            void class::insomefunc() {
            mainSortDialog ms;
            this->close();//closes the setting screen
            ms->exec();
            }
            3.and moving back to the home page
            void class::insomefunc() {
            homeDialog h;
            this->close();//closes the setting screen
            h->exec();
            }
            at this point it is not moving to destructor
            only if i move to mainwindow it moving to destructor mainsort page

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #45

            @swansorter
            Hi
            Really?
            but they are local variables. they will be destroyed.
            I can't see anyway, they could avoid that.

            jsulmJ 1 Reply Last reply
            0
            • mrjjM mrjj

              @swansorter
              Hi
              Really?
              but they are local variables. they will be destroyed.
              I can't see anyway, they could avoid that.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #46

              @mrjj said in Qt Application Slowing Down:

              will be destroyed

              Yes, but only when exec() finishes I guess :-)

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              mrjjM 1 Reply Last reply
              0
              • jsulmJ jsulm

                @mrjj said in Qt Application Slowing Down:

                will be destroyed

                Yes, but only when exec() finishes I guess :-)

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by mrjj
                #47

                @jsulm
                Indeed :)
                I also wondered if this->close() would kill the containing class but
                i dont see the local dialogs dtor being skipped.

                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