0 Replies
      Latest reply on Jan 24, 2020 2:29 PM by ManManage
      ManManage Level 1 Level 1 (0 points)

        Hello, I'm write application for iOS. I get image path via QML FileDialog ("file:assets-library://asset/asset.JPG%3Fid=C6E6...77E9&ext=JPG")) and send to C++, I get message "Image not load". what I do wrong ?

        qml:

        FileDialog {
            
        id: fileDialog
            
        title: "Please choose a file"
            
        folder:StandardPaths.standardLocations(StandardPaths.PicturesLocation)[2]//shortcuts.home
            
        selectExisting: true
            
        onAccepted: {
                
        //console.log(file)
                
        imageProcessor.processImage_file(fileDialog.file)
                
        fileDialog.close()
            
        }
            
        onRejected: {
                
        console.log("Canceled")
                
        fileDialog.close()
            
        }
        
        }
        
        

        C++:

        void ImageProcessor::processImage_file(const QString &path)
        {
            QString assetsPath=path;
            QImage myImage;
            QUrl url(assetsPath);
            assetsPath = url.toLocalFile();
            myImage.load(assetsPath);
            if( !myImage.isNull()) 
            {
                      //........
            }
            else qDebug()<<"Image not load";
        }