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. How to Grab Image and Show in next Slide?

How to Grab Image and Show in next Slide?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 430 Views
  • 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.
  • I Offline
    I Offline
    isan
    wrote on last edited by
    #1

    I want to take a screenshot and show it in next stack view slide, I do this the image is save but not showing in other page, How can I fix it?

    SecondPage.qml:

    Button {
               id: button
               x: 613
               y: 628
               text: qsTr("click me!")
               background: Rectangle {
                   radius: 20
                   color: "red"
               }
               onClicked:{
                   chartPage.grabToImage(function(result)
                   {
                       screenshoot.source = result.url;
                       result.saveToFile("test.png");
                       console.log("file has been saved");
                   }, Qt.size(chartPage.width, chartPage.height));
                   stackView.push(["qrc:/ThirdPage.qml"])
               }
           }
    

    ThirdPage.qml:

    Page {
        width: Screen.width
        height: Screen.height
        visible: true
        property alias screenshoot: screenshoot
        Image {
            id: screenshoot
        }
    }
    
    1 Reply Last reply
    0
    • L Offline
      L Offline
      lemons
      wrote on last edited by
      #2

      try something like this:

      Page {
          property alias url: screenshoot.source
          Image {
              id: screenshoot
              Component.onCompleted: console.debug("my source is:", source)
          }
      }
      
      // pass url als property to the pushed view
      stackView.push( "qrc:/ThirdPage.qml",  {"url" : "your/image/url"} )
      
      I 2 Replies Last reply
      1
      • L lemons

        try something like this:

        Page {
            property alias url: screenshoot.source
            Image {
                id: screenshoot
                Component.onCompleted: console.debug("my source is:", source)
            }
        }
        
        // pass url als property to the pushed view
        stackView.push( "qrc:/ThirdPage.qml",  {"url" : "your/image/url"} )
        
        I Offline
        I Offline
        isan
        wrote on last edited by
        #3

        @lemons It's work
        thanks

        1 Reply Last reply
        0
        • L lemons

          try something like this:

          Page {
              property alias url: screenshoot.source
              Image {
                  id: screenshoot
                  Component.onCompleted: console.debug("my source is:", source)
              }
          }
          
          // pass url als property to the pushed view
          stackView.push( "qrc:/ThirdPage.qml",  {"url" : "your/image/url"} )
          
          I Offline
          I Offline
          isan
          wrote on last edited by
          #4
          This post is deleted!
          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