Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. The window does not remove the data when closed
Forum Updated to NodeBB v4.3 + New Features

The window does not remove the data when closed

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 4 Posters 1.6k 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 Offline
    S Offline
    Sergei_Rack
    wrote on last edited by
    #1

    When close a dialog window box and open again the new window does not clear the last written item. I wish that the dialog text input should clean.

    S 1 Reply Last reply
    0
    • S Sergei_Rack

      When close a dialog window box and open again the new window does not clear the last written item. I wish that the dialog text input should clean.

      S Offline
      S Offline
      Sergei_Rack
      wrote on last edited by
      #2

      @Sergei_Rack More information:
      ![alt text](0_1521557425147_error not clear text.png image url)

      K A 2 Replies Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by SGaist
        #3

        Hi,

        Please don't post the same question in multiple sub-forum. One is enough.

        Duplicates

        Closed the duplicate.

        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
        1
        • S Sergei_Rack

          @Sergei_Rack More information:
          ![alt text](0_1521557425147_error not clear text.png image url)

          K Offline
          K Offline
          kenchan
          wrote on last edited by kenchan
          #4

          @Sergei_Rack As you are probably aware, an important of dialog design is how and when to initialise it. An API like Qt cannot know how you want to do this automatically so you must do it yourself in the appropriate way at the appropriate time. Such as in the constructor or an initialiser function or at the place you create it just before you call exec() or show().

          1 Reply Last reply
          1
          • S Sergei_Rack

            @Sergei_Rack More information:
            ![alt text](0_1521557425147_error not clear text.png image url)

            A Offline
            A Offline
            ambershark
            wrote on last edited by
            #5

            @Sergei_Rack 2 ways to deal with this...

            1. Clear your form widgets when you open the window. QML tends to keep "widgets" in memory so showing and hiding the window doesn't destroy it like when using QtWidgets and C++. So therefore it's more like an always allocated dialog that shows and hides. Make sure to reset everything before use.

            2. Go with a dynamically allocate window that you delete when done, then it will allocate a fresh one on next open. This should help with that:
              http://doc.qt.io/qt-5/qtqml-javascript-dynamicobjectcreation.html

            My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

            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