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. Is there a way to change front/back properties in a Flipable?
Forum Updated to NodeBB v4.3 + New Features

Is there a way to change front/back properties in a Flipable?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 997 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.
  • B Offline
    B Offline
    Beriol
    wrote on last edited by
    #1

    The Flipable element can easily offer nice transitions. But is there a way to change the back and/or front once they're set?

    For example, if I do this:

    @
    Flipable {
    id: flipable
    front: Image { source: "someImage.jpg" }
    back: Image { source: "anotherImage.jpg" }

    Image {
        id: img
        source: "yetAnotherImage"
    }
    

    Component.onCompleted: flipable.front = img
    }
    @

    It gives me this error:

    QML Flipable: front is a write-once property

    So, are there any workarounds to this? I tried a few things, but couldn't come up with a solution.
    By the way, why is there even there this limitation?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Change the source of the image, not the object. Or use a Loader.

      (Z(:^

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Beriol
        wrote on last edited by
        #3

        [quote author="sierdzio" date="1400221623"]Change the source of the image, not the object. Or use a Loader.[/quote]

        Well, yesterday I tried something like that (not with an Image), but it gave me an error saying that I couldn't modify read-only properties; I figured since the front/back were write-only, they're children properties were read-only. Now I just tried changing the source of the Image and it worked just fine. I don't know what I was doing wrong yesterday.

        But the Image was just an example. What I really need is a way to change insert a view created and istantiated from C++ into the front/back properties.

        I was messing with the the Loader a few moments ago, and it might look the thing I need, except that I can't load the new view created from C++ with that because the component is actually instantiated in the C++ side...

        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