Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.0
- import Sailfish.Silica 1.0
- import io.thp.pyotherside 1.4
- Page {
- id: page
- // To enable PullDownMenu, place our content in a SilicaFlickable
- SilicaFlickable {
- anchors.fill: parent
- // PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView
- PullDownMenu {
- MenuItem {
- text: qsTr("Show Page 2")
- onClicked: pageStack.push(Qt.resolvedUrl("SecondPage.qml"))
- }
- }
- // Tell SilicaFlickable the height of its content.
- contentHeight: column.height
- // Place our content in a Column. The PageHeader is always placed at the top
- // of the page, followed by our content.
- Column {
- id: column
- width: page.width
- spacing: Theme.paddingLarge
- PageHeader {
- title: qsTr("Python Image provider")
- }
- Label {
- x: Theme.paddingLarge
- text: qsTr("Hello Sailors")
- color: Theme.secondaryHighlightColor
- font.pixelSize: Theme.fontSizeExtraLarge
- }
- Image {
- id: image
- width: 500
- height: 500
- Python {
- Component.onCompleted: {
- // Add the directory of this .qml file to the search path
- addImportPath(Qt.resolvedUrl('.'));
- importModule('image_provider', function () {
- image.source = "image://python/http://i.4cdn.org/hr/1443801118614.png";
- });
- }
- onError: console.log('Python error: ' + traceback)
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement