49 lines
1.3 KiB
QML
49 lines
1.3 KiB
QML
import QtQuick 2.0
|
|
import QtQuick.Dialogs 1.2
|
|
import QtQuick.Controls 1.2
|
|
|
|
Item {
|
|
Rectangle{
|
|
property string photofile:"../images/Update.png"
|
|
color: "grey"
|
|
|
|
FileDialog {
|
|
id: fileDialog
|
|
title: "Please choose a file"
|
|
folder: shortcuts.pictures
|
|
selectMultiple: true
|
|
onAccepted: {
|
|
photofile=fileDialog.fileUrls[0];
|
|
console.log("You chose: " + fileDialog.fileUrls)
|
|
// img.src=file;
|
|
}
|
|
onRejected: {
|
|
console.log("Canceled")
|
|
}
|
|
}
|
|
Component.onCompleted: {fileDialog.open()}
|
|
|
|
Image {
|
|
id: photoFromFilesystem
|
|
x: 20;y:50
|
|
height: 200
|
|
fillMode: Image.PreserveAspectFit
|
|
source: photofile
|
|
|
|
onStatusChanged:{
|
|
if (photoFromFilesystem.status == Image.Ready) {
|
|
Layoutjs.showFriends(db)
|
|
}
|
|
}
|
|
Button {
|
|
text: "Upload"
|
|
onClicked:{
|
|
var login=Service.readActiveConfig(db);
|
|
Service.uploadMedia(login,photofile, function(returnvalue){print("Upload return"+returnvalue)})
|
|
}}
|
|
|
|
|
|
}
|
|
}
|
|
}
|