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. Difference between hide, close and show in qt
Qt 6.11 is out! See what's new in the release blog

Difference between hide, close and show in qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.0k 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.
  • mit_cruzeM Offline
    mit_cruzeM Offline
    mit_cruze
    wrote on last edited by
    #1

    What is the difference between hide,close and show of pushbutton or any widget in terms of memory?

    Which is better if I don't want to use widget again?

    raven-worxR 1 Reply Last reply
    0
    • mit_cruzeM mit_cruze

      What is the difference between hide,close and show of pushbutton or any widget in terms of memory?

      Which is better if I don't want to use widget again?

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

      @mit_cruze said in Difference between hide, close and show in qt:

      What is the difference between hide,close and show of pushbutton or any widget in terms of memory?

      in terms of memory? nothing, since it just marks it at visible/hidden.
      Of course the process of painting (objects used for drawing, style, ...) in case it is visible needs resources. Actually like any other operation the application does.

      Which is better if I don't want to use widget again?

      when you do not need it again, you should delete it and release all resources.

      --- 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

      VRoninV 1 Reply Last reply
      2
      • raven-worxR raven-worx

        @mit_cruze said in Difference between hide, close and show in qt:

        What is the difference between hide,close and show of pushbutton or any widget in terms of memory?

        in terms of memory? nothing, since it just marks it at visible/hidden.
        Of course the process of painting (objects used for drawing, style, ...) in case it is visible needs resources. Actually like any other operation the application does.

        Which is better if I don't want to use widget again?

        when you do not need it again, you should delete it and release all resources.

        VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by
        #3

        @raven-worx said in Difference between hide, close and show in qt:

        when you do not need it again, you should delete it and release all resources.

        to make it clear, this means calling deleteLater().

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        2
        • mit_cruzeM Offline
          mit_cruzeM Offline
          mit_cruze
          wrote on last edited by
          #4

          thanks @raven-worx

          1 Reply Last reply
          0
          • mit_cruzeM Offline
            mit_cruzeM Offline
            mit_cruze
            wrote on last edited by
            #5

            thanks @VRonin

            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