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. TextEdit on ListView don't keep text after scrolling.
Forum Updated to NodeBB v4.3 + New Features

TextEdit on ListView don't keep text after scrolling.

Scheduled Pinned Locked Moved QML and Qt Quick
15 Posts 4 Posters 4.1k 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.
  • M Offline
    M Offline
    MathArtist
    wrote on last edited by
    #6

    I added a "video":https://www.youtube.com/watch?v=1sHKnNZLzhs of the problem.
    I also tried on macosx and get the same behavior.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dasRicardo
      wrote on last edited by
      #7

      Hmmm, sounds like a bug i havn't test it so massivly. Whats your goal for this construct? What's your ui idea behind this?

      **Sorry for my english :)

      PLEASE ADD [SOLVED] TO YOUR THREAD TITLE IF IT'S SOLVED.**

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MathArtist
        wrote on last edited by
        #8

        I added a video of the problem in the first post of this thread.
        I also tried on macosx and get the same behavior.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dasRicardo
          wrote on last edited by
          #9

          Can't reproduce this sorry, maybe graphics driver bug?

          **Sorry for my english :)

          PLEASE ADD [SOLVED] TO YOUR THREAD TITLE IF IT'S SOLVED.**

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MathArtist
            wrote on last edited by
            #10

            [quote author="dasRicardo" date="1412026473"]Hmmm, sounds like a bug i havn't test it so massivly. Whats your goal for this construct? What's your ui idea behind this?[/quote]

            My goal is to make a survey app. so you define some questions. the list say question and have some space for input the data.
            Like name, last name, age, address, opinion... etc etc

            the real app is more complex but for the forum I just make a simple test code with the minimal elements to reproduce the problem.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              MathArtist
              wrote on last edited by
              #11

              [quote author="dasRicardo" date="1412026795"]Can't reproduce this sorry, maybe graphics driver bug?[/quote]

              I think this is not a graphic driver issue, because I have same result on Mac with Nvidia graphics, suse linux with intel graphics, and various android phones and tablet from different vendors.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                dasRicardo
                wrote on last edited by
                #12

                Hmm, but i think a list is the wrong component for you. Have you try to simply add some input into a flickable container and test if it produce the same result?

                **Sorry for my english :)

                PLEASE ADD [SOLVED] TO YOUR THREAD TITLE IF IT'S SOLVED.**

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  hmuelner
                  wrote on last edited by
                  #13

                  From the documentation of ListView ("http://qt-project.org/doc/qt-5/qml-qtquick-listview.html#delegate-prop":http://qt-project.org/doc/qt-5/qml-qtquick-listview.html#delegate-prop):

                  Note: Delegates are instantiated as needed and may be destroyed at any time. They are parented to ListView's contentItem, not to the view itself. State should never be stored in a delegate.

                  You should map the text of your TextEdit to a property of the ListElements in your ListModel.

                  Helmut Mülner

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    Torgeir
                    wrote on last edited by
                    #14

                    The bug is in your delegate. Documentation for ListView says:

                    bq. Delegates are instantiated as needed and may be destroyed at any time. They are parented to ListView's contentItem, not to the view itself. State should never be stored in a delegate.

                    When your delegate contains a TextEdit and you don't store the edited text somewhere, it will be lost when the delegate is destroyed/recreated.

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      MathArtist
                      wrote on last edited by
                      #15

                      Thanks, for the info.

                      What can be a good workarround or a proper workflow for my app?

                      Suggestions are welcome.

                      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