Ubuntu sdk filedialog

时间:2015-02-04 00:17:06

标签: ubuntu qml

I have tried to make a video playback with qml and the Ubuntu Linux SDK application and this is the code I have got so far:
import QtQuick 2.0
import QtMultimedia 5.0
import Ubuntu.Components 1.1
import QtQuick.Dialogs 1.0
Video {
    FileDialog {
        id: fileDialog
        title: "Please choose a file(.mp4)"



        Component.onCompleted: visible = true
    }
    id: video
    width : units.gu(120)
    height : units.gu(90)
    source : fileDialog.fileUrl
    MouseArea {
        Text
        {
            text : "click to play,space for stop,left and right to seek position in video"
        }
        anchors.fill: parent
        onClicked: {
            video.play()
        }
    }
    focus: true
    Keys.onSpacePressed: video.playbackState == MediaPlayer.PlayingState ? video.pause() : video.play()
    Keys.onLeftPressed: video.seek(video.position - 5000)
    Keys.onRightPressed: video.seek(video.position + 5000)
}

代码在我的IDE中运行得非常好,但是当我在我的笔记本电脑上使用unity 8安装在我的Ubuntu 15.04上时,应用程序就崩溃了。我猜QtQuick.Dialogs 1.0可能不是平台的一部分?那么我如何将它打包在我的.click中呢?或者是否有替代方案是平台的一部分?

0 个答案:

没有答案