import QtQuick 2.3
import QtQuick.Controls 1.3

Item {
    id: root

    property var model: []

    property color background: palette.window

    property alias count: view.count

    property int delegateHeight: 0

    signal itemSelected(int index, string name)

    SystemPalette{
        id: palette
        colorGroup: SystemPalette.Active
    }

    Rectangle {
        id: background
        anchors.fill: parent
        color: root.background
    }

    ListView {
        id: view
        anchors.fill: parent
        snapMode: ListView.SnapToItem
        model: root.model
        delegate: Item {
            width: view.width
            height: placemarkName.height + 20

            Rectangle {
                id: delegateBackground
                anchors.fill: parent
                color: mouseArea.pressed ? palette.highlight : root.background
            }

            Text {
                id: placemarkName
                anchors.left: parent.left
                anchors.leftMargin: 10
                anchors.verticalCenter: parent.verticalCenter
                font.pointSize: 18
                color: palette.text
                text: name
            }

            MouseArea {
                id: mouseArea
                anchors.fill: parent
                onClicked: {
                    root.itemSelected(index, name);
                }
            }

            Component.onCompleted: {
                if( root.delegateHeight != height ) {
                    root.delegateHeight = height;
                }
            }
        }
    }
}

Add icons to search results in Marble Maps.

import QtQuick 2.3
import QtQuick.Controls 1.3

Item {
    id: root

    property var model: []

    property color background: palette.window

    property alias count: view.count

    property int delegateHeight: 0

    signal itemSelected(int index, string name)

    SystemPalette{
        id: palette
        colorGroup: SystemPalette.Active
    }

    Rectangle {
        id: background
        anchors.fill: parent
        color: root.background
    }

    ListView {
        id: view
        anchors.fill: parent
        snapMode: ListView.SnapToItem
        model: root.model
        delegate: Item {
            width: view.width
            height: placemarkName.height + 20

            Rectangle {
                id: delegateBackground
                anchors.fill: parent
                color: mouseArea.pressed ? palette.highlight : root.background
            }

            Image {
                id: icon
                anchors.left: parent.left
                anchors.leftMargin: 10
                anchors.verticalCenter: parent.verticalCenter
                width: height
                height: placemarkName.height
                source: iconPath
                fillMode: Image.Pad
            }

            Text {
                id: placemarkName
                anchors.left: icon.right
                anchors.verticalCenter: parent.verticalCenter
                font.pointSize: 18
                color: palette.text
                text: name
            }

            MouseArea {
                id: mouseArea
                anchors.fill: parent
                onClicked: {
                    root.itemSelected(index, name);
                }
            }

            Component.onCompleted: {
                if( root.delegateHeight != height ) {
                    root.delegateHeight = height;
                }
            }
        }
    }
}


import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4

import BSComponents 1.0

ApplicationWindow { id: main
    color: "transparent"

        Item { id: env

        }
        property string sourceFileName: "MainUI.qml"
        property string menuFileName: "MainMenu.qml"
        property string toolBarFileName: "MainToolBar.qml"

        property alias backgroundColor: blur.backgroundColor

        visible: true

        menuBar: mainMenuLoader.item
        toolBar: toolBarLoader.item

        Connections {
                target: quiver
                onPendingConnectionRequestChanged: {
                        mainLoader.source = ""
                        mainLoader.source = sourceFileName
                }
        }

        Loader { id: mainLoader
                source: sourceFileName
                anchors.fill: parent
                focus: true
        }

        Loader { id: mainMenuLoader
                source: menuFileName
        }

        Loader { id: toolBarLoader
                source: toolBarFileName
        }

        WindowBackgroundBlur {
            id: blur
            window: root
            radius: 25
            backgroundColor: "#a0f7fafc"
        }
}

Correct spelling. Still won't build. Fail.

import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4

import BSComponents 1.0

ApplicationWindow { id: main
    color: "transparent"

        Item { id: env

        }
        property string sourceFileName: "MainUI.qml"
        property string menuFileName: "MainMenu.qml"
        property string toolBarFileName: "MainToolBar.qml"

        property alias backgroundColor: blur.backgroundColor

        visible: true

        menuBar: mainMenuLoader.item
        toolBar: toolBarLoader.item

        Connections {
                target: quiver
                onPendingConnectionRequestChanged: {
                        mainLoader.source = ""
                        mainLoader.source = sourceFileName
                }
        }

        Loader { id: mainLoader
                source: sourceFileName
                anchors.fill: parent
                focus: true
        }

        Loader { id: mainMenuLoader
                source: menuFileName
        }

        Loader { id: toolBarLoader
                source: toolBarFileName
        }

        MacWindowBlur {
            id: blur
            window: root
            radius: 25
            backgroundColor: "#a0f7fafc"
        }
}


import QtQuick 2.0

Image {
    property int currentView
    property alias image: img.source
    property bool verticalLaser: false

    source: "../../resources/icons/box.png"

    Image {
        id: img
        anchors.centerIn: parent
        fillMode: Image.PreserveAspectFit
        width: 200
        height: 200
    }

    Image {
        source: "../../resources/icons/box_bg.png"
        anchors.centerIn: parent
        z: parent.z - 1
    }

    Image {
        anchors.fill: parent
        source: verticalLaser ? "../../resources/icons/notches_vert.png" : "../../resources/icons/notches_oriz.png"
    }
}

Adjust the notches in the side images as in the mockup.

import QtQuick 2.0

Image {
    property int currentView
    property alias image: img.source
    property bool verticalLaser: false

    source: "../../resources/icons/box.png"

    Image {
        id: img
        anchors.centerIn: parent
        fillMode: Image.PreserveAspectFit
        width: 200
        height: 200
    }

    Image {
        source: "../../resources/icons/box_bg.png"
        anchors.centerIn: parent
        z: parent.z - 1
    }

    BorderImage {
        border.left: 6
        border.right: 6
        border.bottom: 6
        border.top: 6
        width: 208
        height: 208
        anchors.centerIn: parent
        source: verticalLaser ? "../../resources/icons/notches_vert.png" : "../../resources/icons/notches_oriz.png"
    }
}


import qbs

Product {
    type: "staticlibrary"
    name:"QtSsh"
    Depends { name: "cpp" }
    Depends { name: "Qt.core" }
    Depends { name: "Qt.network" }
    Depends { name: "libssh2" }

    files: [
        "qtssh/sshtunnelout.h",
        "qtssh/sshtunnelin.h",
        "qtssh/sshprocess.h",
        "qtssh/sshchannel.h",
        "qtssh/sshclient.h",
        "qtssh/sshtunneloutsrv.h",
        "qtssh/sshscpsend.h",
        "qtssh/sshsftp.h",
        "qtssh/sshfilesystemmodel.h",
        "qtssh/sshfilesystemnode.h",
        "qtssh/async_libssh2.h",
        "qtssh/sshkey.h",
        "qtssh/sshtunnelout.cpp",
        "qtssh/sshtunnelin.cpp",
        "qtssh/sshprocess.cpp",
        "qtssh/sshchannel.cpp",
        "qtssh/sshclient.cpp",
        "qtssh/sshtunneloutsrv.cpp",
        "qtssh/sshscpsend.cpp",
        "qtssh/sshsftp.cpp",
        "qtssh/sshfilesystemmodel.cpp",
        "qtssh/sshfilesystemnode.cpp",
        "qtssh/sshkey.cpp"
    ]

    Export {
        Depends { name: "cpp" }
        cpp.includePaths: [
            product.sourceDirectory + "/qtssh"
        ]
    }
}


import Qt 4.6

QGraphicsWidget {
    size: "250x250"
}

Add import Qt.widgets 4.6 to loader auto test using graphics widgets

import Qt 4.6
import Qt.widgets 4.6

QGraphicsWidget {
    size: "250x250"
}


import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Dialogs 1.3

Item {
    id: root

    property string name
    property Setting setting

    implicitHeight: item.implicitHeight

    SettingItem {
        id: item

        name: root.name
        subtitle: setting.value
        anchors.fill: parent

        onClicked: dialog.open()

        FileDialog {
            id: dialog

            title: qsTr("Please choose a directory")
            folder: "file:///" + backend.toLocalFile(setting.value)
            selectFolder: true

            onAccepted: setting.setValue(backend.toLocalFile(dialog.fileUrl.toString()))
        }
    }
}

Stop trimming the 'file:///' prefix

import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Dialogs 1.3

Item {
    id: root

    property string name
    property Setting setting

    implicitHeight: item.implicitHeight

    SettingItem {
        id: item

        name: root.name
        subtitle: backend.toLocalFile(setting.value)
        anchors.fill: parent

        onClicked: dialog.open()

        FileDialog {
            id: dialog

            title: qsTr("Please choose a directory")
            folder: setting.value
            selectFolder: true

            onAccepted: setting.setValue(dialog.fileUrl.toString())
        }
    }
}


import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.Components.ListItems 0.1 as ListItem

Page {
    id: page

    ListView {
        id: listView
        anchors.fill: parent
        model: gamesModel
        delegate: statsDelegate
    }

    Component {
        id: statsDelegate

        Column {
            property int nrWins: getStats(dbName)["won"]
            property int nrLost: getStats(dbName)["lost"]
            property bool _visible: nrWins>0 || nrLost>0
            width: parent.width

            ListItem.Header {
                text: gamesRepeater.itemAt(index).title
                width: parent.width
                visible: _visible
            }

            ListItem.Standard {
                text: nrWins+i18n.tr(" win"," wins",nrWins)
                visible: _visible
            }

            ListItem.Standard {
                text: nrLost+i18n.tr(" los"," losses",nrLost)
                visible: _visible
            }
        }
    }
}

Fix translations with single and plurial values

import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.Components.ListItems 0.1 as ListItem

Page {
    id: page

    ListView {
        id: listView
        anchors.fill: parent
        model: gamesModel
        delegate: statsDelegate
    }

    Component {
        id: statsDelegate

        Column {
            property int nrWins: getStats(dbName)["won"]
            property int nrLost: getStats(dbName)["lost"]
            property bool _visible: nrWins>0 || nrLost>0
            width: parent.width

            ListItem.Header {
                text: gamesRepeater.itemAt(index).title
                width: parent.width
                visible: _visible
            }

            ListItem.Standard {
                text: i18n.tr("%1 win","%1 wins",nrWins).arg(nrWins)
                visible: _visible
            }

            ListItem.Standard {
                text: i18n.tr("%1 los","%1 losses",nrLost).arg(nrLost)
                visible: _visible
            }
        }
    }
}


/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd.
** Contact: Raine Makelainen <raine.makelainen@jollamobile.com>
**
****************************************************************************/

import QtQuick 2.0
import Sailfish.Silica 1.0

Dialog {
    id: dialog
    property alias acceptText: header.acceptText
    default property alias defaultContent: promptContent.children

    Flickable {
        id: flickable
        anchors.fill: parent
        contentHeight: contentColumn.height

        Column {
            id: contentColumn
            width: parent.width

            DialogHeader {
                id: header
            }

            Item {
                id: promptContent
                width: dialog.width

                // So that anchoring works in user prompt dialog implementations
                // and dialog looks visually good. This leaves annoying binding loop which happens
                // when keyboard is opened as keyboard opening reduces dialog height.
                height: Math.max(childrenRect.height, dialog.height - header.height) - Theme.paddingLarge * 2
            }
        }
    }
}

Use SilicaFlickable instead of Flickable in password dialog

/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd.
** Contact: Raine Makelainen <raine.makelainen@jollamobile.com>
**
****************************************************************************/

import QtQuick 2.0
import Sailfish.Silica 1.0

Dialog {
    id: dialog
    property alias acceptText: header.acceptText
    default property alias defaultContent: promptContent.children

    SilicaFlickable {
        id: flickable
        anchors.fill: parent
        contentHeight: contentColumn.height

        Column {
            id: contentColumn
            width: parent.width

            DialogHeader {
                id: header
            }

            Item {
                id: promptContent
                width: dialog.width

                // So that anchoring works in user prompt dialog implementations
                // and dialog looks visually good. This leaves annoying binding loop which happens
                // when keyboard is opened as keyboard opening reduces dialog height.
                height: Math.max(childrenRect.height, dialog.height - header.height) - Theme.paddingLarge * 2
            }
        }
    }
}


/*
 * This file is part of Clockwork.
 *
 * Copyright (c) 2013-2016 Jeremy Othieno.
 *
 * The MIT License (MIT)
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
import QtQuick 2.4
import Material 0.2
import Material.ListItems 0.1 as ListItem
import Material.Extras 0.1

Page {
	title: qsTr("About Clockwork")
	Flickable {
		anchors.fill: parent
		contentWidth: parent.width
		contentHeight: parent.height
		boundsBehavior: Flickable.StopAtBounds
		Column {
			anchors.fill: parent
			ListItem.Subtitled {
				text: qsTr("Build version")
				subText: application.applicationVersion
			}
			ListItem.Divider {}
			ListItem.Subtitled {
				text: qsTr("Source code repository")
				subText: application.applicationRepository
				onClicked: Qt.openUrlExternally(subText)
			}
			ListItem.Divider {}
			ListItem.Subtitled {
				text: qsTr("Source code license")
				subText: qsTr("The MIT License (MIT).")
				onClicked: pageStack.push("qrc:/view/MITLicense")
			}
			ListItem.Divider {}
			ListItem.Subtitled {
				text: qsTr("Documentation license")
				subText: qsTr("Creative Commons License (CC BY-NC-SA).")
				onClicked: pageStack.push("qrc:/view/CreativeCommonsLicense")
			}
			ListItem.Divider {}
			ListItem.Subtitled {
				text: qsTr("Copyright notice")
				subText: qsTr("Copyright (c) 2013 - 2016, Jeremy Othieno.")
			}
		}
	}
}


import QtQuick 2.8
import QtQuick.Controls 2.2
import QtGraphicalEffects 1.0

Item {
    height: 32
    width: height
    property alias image: img
    property bool animateLoad: false
    Image {
        id: img
        sourceSize.height: parent.height
        sourceSize.width: parent.width
        opacity: .8
        layer.enabled: true
        layer.effect: DropShadow {
            transparentBorder: true
            horizontalOffset: 2
            verticalOffset: 2
            color: "#80000000"
        }

        NumberAnimation on opacity {
            id: load
            to: 1
            duration: 400
        }
        onStatusChanged: {
            if (animateLoad)
                if (status === Image.Ready) //source.toString() !== "" &&
                {
                    opacity = 0
                    load.start()
                }
        }
    }

}

Watch status, set to default image on error (not found from MCWS)

import QtQuick 2.8
import QtQuick.Controls 2.2
import QtGraphicalEffects 1.0

Item {
    height: 32
    width: height
    property alias image: img
    property bool animateLoad: false
    Image {
        id: img
        sourceSize.height: parent.height
        sourceSize.width: parent.width
        opacity: .8
        layer.enabled: true
        layer.effect: DropShadow {
            transparentBorder: true
            horizontalOffset: 2
            verticalOffset: 2
            color: "#80000000"
        }

        NumberAnimation on opacity {
            id: load
            to: 1
            duration: 400
        }
        onStatusChanged: {
            if (status === Image.Error)
                source = "default.png"
            if (animateLoad)
                if (status === Image.Ready) //source.toString() !== "" &&
                {
                    opacity = 0
                    load.start()
                }
        }
    }

}


import QtQuick 2.7
import QtQuick.Controls.Material 2.0

Item {
    id: intro_form
    width: 640
    height: 480
    anchors.fill: parent

    Text {
        id: title
        x: 254
        y: 27
        text: qsTr("The Pinkie Restaurant")
        anchors.horizontalCenter: parent.horizontalCenter
        verticalAlignment: Text.AlignVCenter
        horizontalAlignment: Text.AlignHCenter
        visible: true
        font.pixelSize: 12
    }
}

Add Horizontal Layout and two empty rectangles

import QtQuick 2.7
import QtQuick.Layouts 1.3

Item {
    id: intro_form
    width: 640
    height: 480
    anchors.fill: parent

    Text {
        id: title
        y: 27
        text: qsTr("The Pinkie Restaurant")
        z: 1
        anchors.horizontalCenter: parent.horizontalCenter
        verticalAlignment: Text.AlignVCenter
        horizontalAlignment: Text.AlignHCenter
        visible: true
        font.pixelSize: 12
    }

    RowLayout {
        id: buttons_layout
        anchors.fill: parent
        spacing: 0

        Rectangle {
            color: 'teal'
            Layout.preferredWidth: parent.width/2
            Layout.fillHeight: true
        }

        Rectangle {
            color: 'plum'
            Layout.preferredWidth: parent.width/2
            Layout.fillHeight: true
        }
    }
}


// Copyright (c) 2016 Ultimaker B.V.
// Cura is released under the terms of the AGPLv3 or higher.

import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1

import UM 1.2 as UM
import Cura 1.0 as Cura

Cura.MachineAction
{
    anchors.fill: parent;
    Item
    {
        id: upgradeSelectionMachineAction
        anchors.fill: parent

        Label
        {
            id: pageTitle
            width: parent.width
            text: catalog.i18nc("@title", "Check Printer")
            wrapMode: Text.WordWrap
            font.pointSize: 18;
        }

        Label
        {
            id: pageDescription
            anchors.top: pageTitle.bottom
            anchors.topMargin: UM.Theme.getSize("default_margin").height
            width: parent.width
            wrapMode: Text.WordWrap
            text: catalog.i18nc("@label","Please select any upgrades made to this Ultimaker Original");
        }

        CheckBox
        {
            anchors.top: pageDescription.bottom
            anchors.topMargin: UM.Theme.getSize("default_margin").height

            text: catalog.i18nc("@label", "Self-built heated bed")
            checked: manager.hasHeatedBed
            onClicked: manager.hasHeatedBed ? manager.removeHeatedBed() : manager.addHeatedBed()
        }

        UM.I18nCatalog { id: catalog; name: "cura"; }
    }
}

Update wording to reflect the official HBK is also supported

// Copyright (c) 2016 Ultimaker B.V.
// Cura is released under the terms of the AGPLv3 or higher.

import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1

import UM 1.2 as UM
import Cura 1.0 as Cura

Cura.MachineAction
{
    anchors.fill: parent;
    Item
    {
        id: upgradeSelectionMachineAction
        anchors.fill: parent

        Label
        {
            id: pageTitle
            width: parent.width
            text: catalog.i18nc("@title", "Check Printer")
            wrapMode: Text.WordWrap
            font.pointSize: 18;
        }

        Label
        {
            id: pageDescription
            anchors.top: pageTitle.bottom
            anchors.topMargin: UM.Theme.getSize("default_margin").height
            width: parent.width
            wrapMode: Text.WordWrap
            text: catalog.i18nc("@label","Please select any upgrades made to this Ultimaker Original");
        }

        CheckBox
        {
            anchors.top: pageDescription.bottom
            anchors.topMargin: UM.Theme.getSize("default_margin").height

            text: catalog.i18nc("@label", "Heated bed (official kit or self-built)")
            checked: manager.hasHeatedBed
            onClicked: manager.hasHeatedBed ? manager.removeHeatedBed() : manager.addHeatedBed()
        }

        UM.I18nCatalog { id: catalog; name: "cura"; }
    }
}


import QtQuick 2.0
import Sailfish.Silica 1.0
ApplicationWindow{
    property bool inPortrait : _setOrientation(deviceOrientation)

    onDeviceOrientationChanged : {
        _setOrientation(deviceOrientation)
    }

    cover : null

    /*
    cover: CoverBackground {
        CoverPlaceholder {
            text: "modRana"
        }
    }*/

    // this property is provided for API compatibility
    // as the Silica UC backend uses the Silica built-in
    // element sizing
    property int hiDPI : 0

    function _setOrientation(dOrient) {
        if (dOrient == Orientation.Portrait ||
            dOrient == Orientation.PortraitInverted) {
            inPortrait = true
        } else {
            inPortrait = false
        }

        console.log("device orientation changed: " + deviceOrientation)

        /* BTW, other orientations are:
        Orientation.Landscape
        Orientation.LandscapeInverted
        */
    }

    // the Silica ApplicationWindow
    // does not inherit the Window element,
    // so we need to add some properties
    // for a common API with Controls
    property string title
    property var visibility : 5

    function pushPage(pageInstance, pageProperties, animate) {
        var animateFlag
        if (animate) {
            animateFlag = PageStackAction.Animated
        } else {
            animateFlag = PageStackAction.Immediate
        }
        pageStack.push(pageInstance, pageProperties, animateFlag)
        return pageInstance
    }
}

Remove a leftover modRana reference

import QtQuick 2.0
import Sailfish.Silica 1.0
ApplicationWindow{
    property bool inPortrait : _setOrientation(deviceOrientation)

    onDeviceOrientationChanged : {
        _setOrientation(deviceOrientation)
    }

    cover : null

    // this property is provided for API compatibility
    // as the Silica UC backend uses the Silica built-in
    // element sizing
    property int hiDPI : 0

    function _setOrientation(dOrient) {
        if (dOrient == Orientation.Portrait ||
            dOrient == Orientation.PortraitInverted) {
            inPortrait = true
        } else {
            inPortrait = false
        }

        console.log("device orientation changed: " + deviceOrientation)

        /* BTW, other orientations are:
        Orientation.Landscape
        Orientation.LandscapeInverted
        */
    }

    // the Silica ApplicationWindow
    // does not inherit the Window element,
    // so we need to add some properties
    // for a common API with Controls
    property string title
    property var visibility : 5

    function pushPage(pageInstance, pageProperties, animate) {
        var animateFlag
        if (animate) {
            animateFlag = PageStackAction.Animated
        } else {
            animateFlag = PageStackAction.Immediate
        }
        pageStack.push(pageInstance, pageProperties, animateFlag)
        return pageInstance
    }
}


/*
 * Copyright (C) 2015 Dan Leinir Turthra Jensen <admin@leinir.dk>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) version 3, or any
 * later version accepted by the membership of KDE e.V. (or its
 * successor approved by the membership of KDE e.V.), which shall
 * act as a proxy defined in Section 6 of version 3 of the license.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

import QtQuick 2.2
import org.kde.newstuff 1.0 as NewStuff

NewStuff.NewStuffList {
    anchors.fill: parent;
    configFile: peruseConfig.newstuffLocation;
    onMessage: console.log("KNS Message: " + message);
    onIdleMessage: console.log("KNS Idle: " + message);
    onBusyMessage: console.log("KNS Busy: " + message);
    onErrorMessage: console.log("KNS Error: " + message);
}

Remove unneeded size setting from the loaded component

/*
 * Copyright (C) 2015 Dan Leinir Turthra Jensen <admin@leinir.dk>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) version 3, or any
 * later version accepted by the membership of KDE e.V. (or its
 * successor approved by the membership of KDE e.V.), which shall
 * act as a proxy defined in Section 6 of version 3 of the license.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

import QtQuick 2.2
import org.kde.newstuff 1.0 as NewStuff

NewStuff.NewStuffList {
    configFile: peruseConfig.newstuffLocation;
    onMessage: console.log("KNS Message: " + message);
    onIdleMessage: console.log("KNS Idle: " + message);
    onBusyMessage: console.log("KNS Busy: " + message);
    onErrorMessage: console.log("KNS Error: " + message);
}


// -*- qml -*-
import QtQuick 1.1
import com.nokia.meego 1.1
import QtCamera 1.0

Selector {
        id: button

        property alias value: evComp.value

        iconSource: evComp.value == 0 ? "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-manual-exposure.png" : ""
        text: evComp.value == 0 ? "" : evComp.value.toFixed(1);
        timerConstraints: slider.pressed

        EvComp {
                id: evComp
                camera: cam

                // TODO: hardcoding
                value: slider.value
                onValueChanged: console.log(value);
        }

        widget: Slider {
                id: slider
                orientation: Qt.Horizontal
                minimumValue: evComp.minimum
                maximumValue: evComp.maximum
                value: evComp.value
                stepSize: 0.1
                Component.onCompleted: { slider.value = evComp.value; }
        }
}

Adjust the font size to fit the text

// -*- qml -*-
import QtQuick 1.1
import com.nokia.meego 1.1
import QtCamera 1.0

Selector {
        id: button

        property alias value: evComp.value

        iconSource: evComp.value == 0 ? "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-manual-exposure.png" : ""
        text: evComp.value == 0 ? "" : evComp.value.toFixed(1);
        font.pixelSize: 23
        timerConstraints: slider.pressed

        EvComp {
                id: evComp
                camera: cam

                // TODO: hardcoding
                value: slider.value
                onValueChanged: console.log(value);
        }

        widget: Slider {
                id: slider
                orientation: Qt.Horizontal
                minimumValue: evComp.minimum
                maximumValue: evComp.maximum
                value: evComp.value
                stepSize: 0.1
                Component.onCompleted: { slider.value = evComp.value; }
        }
}


import Qt 4.6

Item {
    width: 480; height: 320

    Loader {
        y: 320; rotation: -90
        source: "flickr-mobile.qml"
    }
}


import VPlay 1.0
import QtQuick 1.1

import "manager"

GameWindow {
  id: window
  width: 960
  height: 640

  minimizeable: true
  maximizeable:  true

  // this would disable the fps label both for QML & cocos renderer - if only qml renderer should be disabled use fpsTextItem.visible: false
  displayFpsEnabled: developerBuild

  // in the developer version, the fps are displayed
  property bool developerBuild: !system.publishBuild

  // forward events always to the controller of the loaded active scene
  Keys.forwardTo: activeScene.controllerOfScene

  // sceneLoader and managers should be available in every scene
  property alias window: window
  property alias audioManager: audioManager
  property alias settingsManager: settingsManager
  property alias sceneLoader: sceneLoader
  property alias fontHUD: fontHUD

  // Custom font loading of ttf fonts
  FontLoader {
    id: fontHUD
    source: "fonts/04B_03__.ttf"
  }

  FontLoader {
    id: fontLetterHUD
    source: "fonts/propaganda.ttf"
  }

  // all content is loaded dynamically by the sceneLoader element.
  SceneLoader {
    id: sceneLoader
  }

  // global music and sound management
  AudioManager {
    id: audioManager
  }

  // settings can be stored directly by the settings manager
  SettingsManager {
    id: settingsManager
  }
}

Change default size to small.

import VPlay 1.0
import QtQuick 1.1

import "manager"

GameWindow {
  id: window
  width: 480
  height: 320

  minimizeable: true
  maximizeable:  true

  // this would disable the fps label both for QML & cocos renderer - if only qml renderer should be disabled use fpsTextItem.visible: false
  displayFpsEnabled: developerBuild

  // in the developer version, the fps are displayed
  property bool developerBuild: !system.publishBuild

  // forward events always to the controller of the loaded active scene
  Keys.forwardTo: activeScene.controllerOfScene

  // sceneLoader and managers should be available in every scene
  property alias window: window
  property alias audioManager: audioManager
  property alias settingsManager: settingsManager
  property alias sceneLoader: sceneLoader
  property alias fontHUD: fontHUD

  // Custom font loading of ttf fonts
  FontLoader {
    id: fontHUD
    source: "fonts/04B_03__.ttf"
  }

  FontLoader {
    id: fontLetterHUD
    source: "fonts/propaganda.ttf"
  }

  // all content is loaded dynamically by the sceneLoader element.
  SceneLoader {
    id: sceneLoader
  }

  // global music and sound management
  AudioManager {
    id: audioManager
  }

  // settings can be stored directly by the settings manager
  SettingsManager {
    id: settingsManager
  }
}


Add form for the workflow/modeller metadata

import QtQuick 2.2;
import QtQuick.Controls 1.1;
import QtQuick.Layouts 1.1;

Column {
    property string formresult : "safasdf";
    property string outputfield_0;
    x:5;
    width : parent.width - 5;
    height : parent.height;
    spacing : 10;
//    ExclusiveGroup {
//        id : sourceFilterGroup;
//        onCurrentChanged: {}
//    }
    Rectangle {
        id: nameItem
        height : 22
        width : parent.width
        color : background1;
        Text {
            id : modelNameLabel
            height : 20
            text : qsTr("Name");
            width : modelDescriptionLabel.width
            wrapMode:Text.Wrap
        }
        TextField {
            id : modelNameText
            anchors.left: modelNameLabel.right
            height : 20
            width : parent.width - modelNameLabel.width - 9
        }
    }
    Rectangle {
        id: descriptionItem
        height : 22
        width : parent.width
        color : background1;
        Text {
            id : modelDescriptionLabel
            height : 20
            text : qsTr("Description");
            wrapMode:Text.Wrap
        }
        TextArea {
            id: modelDescriptionText
            anchors.left: modelDescriptionLabel.right
            height : 60
            width : parent.width - modelDescriptionLabel.width  - 9
        }
    }
}


Item {
	signal entered;
	signal exited;
	signal clicked;
	signal canceled;
	signal wheelEvent;

	property bool hoverEnabled;
	property bool containsMouse;
	property real mouseX;
	property real mouseY;
	property bool pressed;
	property string cursorUrl: "res/mouse.png";

	onContainsMouseChanged: {
		if (value) {
			this.element.css('cursor', 'url("' + this.cursorUrl + '"), auto' );
			this.entered()
		} else {
			this.element.css('cursor', 'default');
			this.exited()
		}
	}

	onRecursiveVisibleChanged: {
		if (!value)
			this.containsMouse = false
	}
}

Use 'pointer' cursor if url is undefined.

Item {
	signal entered;
	signal exited;
	signal clicked;
	signal canceled;
	signal wheelEvent;

	property bool hoverEnabled;
	property bool containsMouse;
	property real mouseX;
	property real mouseY;
	property bool pressed;
	property string cursorUrl: "res/mouse.png";

	onContainsMouseChanged: {
		if (value) {
			if (this.cursorUrl)
				this.element.css('cursor', 'url("' + this.cursorUrl + '"), auto' );
			else
				this.element.css('cursor', 'pointer');
			this.entered()
		} else {
			this.element.css('cursor', 'default');
			this.exited()
		}
	}

	onRecursiveVisibleChanged: {
		if (!value)
			this.containsMouse = false
	}
}


ListModel {
	property int begin;
	property int end;
	property Object parentModel;

	onCompleted: {
		var letters = this.parentModel.letters;
		var last = letters.length > this.end ? this.end : letters.length;
		for (var i = this.begin; i < last; ++i)
			this.append({ text: letters[i] });

		if (last == this.end - 4) {
			this.append({ icon: "res/back.png", contextColor: "#f33", widthScale: 2 });
			this.append({ text: " ", icon: "res/back.png", contextColor: "#33f", widthScale: 2 });
		} else if (this.end > letters.length) {
			this.append({ text: "@", widthScale: 2 });
			this.append({ text: ".com", widthScale: 3 });
			this.append({ text: ".ru", widthScale: 2 });
		}
	}
}

Add new icons and use it in keyboard.w

ListModel {
	property int begin;
	property int end;
	property Object parentModel;

	onCompleted: {
		var letters = this.parentModel.letters;
		var last = letters.length > this.end ? this.end : letters.length;
		for (var i = this.begin; i < last; ++i)
			this.append({ text: letters[i] });

		if (last == this.end - 4) {
			this.append({ icon: "res/backspace.png", contextColor: "#f33", widthScale: 2 });
			this.append({ text: " ", icon: "res/space.png", contextColor: "#33f", widthScale: 2 });
		} else if (this.end > letters.length) {
			this.append({ text: "@", widthScale: 2 });
			this.append({ text: ".com", widthScale: 3 });
			this.append({ text: ".ru", widthScale: 2 });
		}
	}
}


Protocol {
	property string data;

	onUrlChanged: {
		var self = this
		this.request(value, function(data) { self.data = data })
	}
}

Use actual protocol interface in resource.

Protocol {
	property string data;

	onUrlChanged: {
		var self = this
		this.requestXHR({
			"url": value,
			"callback": function(data) { self.data = data.target.responseText }
		})
	}
}


import QtQuick 1.1

ListView {
    id: root
    focus: true

    SystemPalette {
        id: palette
        colorGroup: SystemPalette.Active
    }

    anchors.fill: parent
    model: skinManager.skinsModel

    delegate: Rectangle {
        id: delegate
        width: ListView.view.width
        height: text.implicitHeight
        color: ListView.isCurrentItem ? palette.highlight : "transparent"

        Text {
            id: text
            anchors.fill: parent
            text: model.modelData.name
            color: delegate.ListView.view.isCurrentItem ? palette.highlightedText : palette.text
        }

        MouseArea {
            id: mouseArea
            anchors.fill: parent
            onClicked: delegate.ListView.view.currentIndex = index
            onDoubleClicked: window.setSkin(model.modelData.name)
        }

        Keys.onEnterPressed: window.setSkin(model.modelData.name)
        Keys.onReturnPressed: window.setSkin(model.modelData.name)
    }
}

Use skin.manifest to display skin meta information

import QtQuick 1.1

ListView {
    id: root
    focus: true

    SystemPalette {
        id: palette
        colorGroup: SystemPalette.Active
    }

    anchors.fill: parent
    model: skinManager.skinsModel

    delegate: Rectangle {
        id: delegate
        width: ListView.view.width
        height: Math.max(column.height, screenshot.height)
        color: ListView.isCurrentItem ? palette.highlight : "transparent"

        Image {
            id: screenshot
            width: 75
            height: 50
            fillMode: Image.PreserveAspectFit
            smooth: true
        }

        Column {
            id: column
            anchors {
                topMargin: 5
                bottomMargin: 5
                leftMargin: 10
                left: screenshot.right
            }
            spacing: 3
            Text {
                id: skinName
                font.bold: true
                text: model.modelData.name
                color: delegate.ListView.view.isCurrentItem ? palette.highlightedText : palette.text
            }

            Text {
                id: skinAuthors
                font.pointSize: skinName.font.pointSize - 4
            }

            Text {
                id: website
                font.pointSize: skinName.font.pointSize - 4
            }
        }

        MouseArea {
            id: mouseArea
            anchors.fill: parent

            onClicked: delegate.ListView.view.currentIndex = index
            onDoubleClicked: window.setSkin(model.modelData.name)
        }

        Keys.onEnterPressed: window.setSkin(model.modelData.name)
        Keys.onReturnPressed: window.setSkin(model.modelData.name)

        Component.onCompleted: {
            var doc = new XMLHttpRequest()
            doc.onreadystatechange = function() {
                if (doc.readyState == XMLHttpRequest.DONE && doc.responseText) {
                    var manifest = eval('(' + doc.responseText + ')')
                    if (manifest.screenshot)
                        screenshot.source = "file://" + model.modelData.path + "/" + manifest.screenshot
                    var authors = []
                    for (var i = 0; i < manifest.authors.length; i++) {
                        authors.push(manifest.authors[i].name)
                    }
                    skinAuthors.text = "By " + authors.join(", ")
                    website.text = manifest.website
                }
            }
            doc.open("GET", "file://" + model.modelData.path + "/skin.manifest")
            doc.send()
        }
    }
}


import qbs

CppApplication {
    Depends { name: "Qt.widgets" }
    files: [
        "main.cpp",
        "mainwindow.cpp",
        "mainwindow.h",
        "mainwindow.ui"
    ]
}

Fix autotest on Windows and OS X.

import qbs

CppApplication {
    Depends { name: "Qt.widgets" }
    consoleApplication: true
    cpp.debugInformation: false
    cpp.separateDebugInformation: false
    files: [
        "main.cpp",
        "mainwindow.cpp",
        "mainwindow.h",
        "mainwindow.ui"
    ]
}


import qbs

Project {
    minimumQbsVersion: "1.9.0"
    references: [
        "examples/examples.qbs",
        "others.qbs",
        "src/log4qt/log4qt.qbs",
        "tests/tests.qbs",
    ]

    Product {
        name: "qmake project files"
        Group {
            name: "files"
            files: ["**/*.pr[io]"]
        }
    }
}

Change qbs qmake files product name

import qbs

Project {
    minimumQbsVersion: "1.9.0"
    references: [
        "examples/examples.qbs",
        "others.qbs",
        "src/log4qt/log4qt.qbs",
        "tests/tests.qbs",
    ]

    Product {
        name: "qmake project files (log4qt)"
        Group {
            name: "files"
            files: ["**/*.pr[io]"]
        }
    }
}


import qbs

Project {
    minimumQbsVersion: "1.9.0"
    references: [
        "examples/examples.qbs",
        "others.qbs",
        "src/log4qt/log4qt.qbs",
        "tests/tests.qbs",
    ]

    Product {
        name: "qmake project files(log4qt)"
        Group {
            name: "files"
            files: ["**/*.pr[io]"]
        }
    }
}

Add cmake files to qbs project

import qbs

Project {
    minimumQbsVersion: "1.9.0"
    references: [
        "examples/examples.qbs",
        "others.qbs",
        "src/log4qt/log4qt.qbs",
        "tests/tests.qbs",
    ]

    Product {
        name: "qmake project files(log4qt)"
        Group {
            name: "files"
            files: ["**/*.pr[io]"]
        }
    }

    Product {
        name: "cmake project files(log4qt)"
        Group {
            name: "files"
            files: ["**/CMakeLists.txt", "cmake/*"]
        }
    }
}


import Qt 4.7

Item {
    id: mainArea
    width: parent.width
    height: label.height + 20

    property alias text: label.text

    signal clicked()

    Component.onCompleted: {
        var textWidth = label.width + 2 * label.anchors.leftMargin;

        if (textWidth > mainArea.parent.width) {
            mainArea.parent.width = textWidth;
        }
    }

    BorderImage {
        id: activeBackground
        anchors.fill: parent
        border.left: 5
        border.right: 5
        border.top: 5
        border.bottom: 5

        source: "image://meegotheme/widgets/common/menu/menu-item-active"
        visible: mouseArea.pressed
    }

    Text {
        id: label
        anchors.verticalCenter: parent.verticalCenter
        anchors.leftMargin: 10
        anchors.left: parent.left
        color: mouseArea.pressed ? theme_fontColorSelected :
                                   theme_contextMenuFontColor
        font.pixelSize: theme_contextMenuFontPixelSize
    }

    MouseArea {
        id: mouseArea
        anchors.fill: parent

        onClicked: {
            mainArea.clicked();
        }
    }
}

Add elide to menu items

import Qt 4.7

Item {
    id: mainArea
    width: parent.width
    height: label.height + 20

    property alias text: label.text

    signal clicked()

    Component.onCompleted: {
        var textWidth = label.width + 2 * label.anchors.leftMargin;

        if (textWidth > mainArea.parent.width) {
            mainArea.parent.width = textWidth;
        }
    }

    BorderImage {
        id: activeBackground
        anchors.fill: parent
        border.left: 5
        border.right: 5
        border.top: 5
        border.bottom: 5

        source: "image://meegotheme/widgets/common/menu/menu-item-active"
        visible: mouseArea.pressed
    }

    Text {
        id: label
        anchors.verticalCenter: parent.verticalCenter
        anchors.leftMargin: 10
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.rightMargin: 10
        color: mouseArea.pressed ? theme_fontColorSelected :
                                   theme_contextMenuFontColor
        font.pixelSize: theme_contextMenuFontPixelSize
        elide: Text.ElideRight
    }

    MouseArea {
        id: mouseArea
        anchors.fill: parent

        onClicked: {
            mainArea.clicked();
        }
    }
}


import QtQuick 2.0
import QtQuick.Layouts 1.0

Rectangle {
    width: 700
    height: 100

    GridLayout {
        id: grid
        columns: 2
        anchors.left: parent.left
        anchors.right: parent.right

        Text {
            id: passwordText
            Layout.fillHeight: true
            Layout.preferredWidth: passwordText.width
            text: qsTr("Password: ")
        }
        TextInput {
            id: password
            Layout.fillHeight: true
            Layout.fillWidth: true
            echoMode: TextInput.Password
            focus: true

            onAccepted: {
                result.text = "Result: " + hash.Do(password.text, page.text)
                page.focus = true
            }
        }

        Text {
            id: pageText
            Layout.fillHeight: true
            Layout.preferredWidth: passwordText.width
            text: qsTr("Page: ")
        }
        TextInput {
            id: page
            Layout.fillHeight: true
            Layout.fillWidth: true

            onAccepted: {
                result.text = "Result: " + hash.Do(password.text, page.text)
            }
        }
    }

    ListView {
        anchors.top: grid.bottom
        anchors.bottom: result.top
        anchors.left: parent.left
        anchors.right: parent.right
        clip: true
        model: myModel

        delegate: Text {
            text: modelData

            MouseArea {
                anchors.fill: parent

                onClicked: {
                    page.text = parent.text
                    page.onAccepted()
                }

                onPressAndHold: {
                    hash.Remove(parent.text)
                }
            }
        }
    }

    Text {
        id: result
        anchors.bottom: parent.bottom
        text: qsTr("Result: -")
    }
}

Use anchors instead of grid layout

import QtQuick 2.0

Rectangle {
    width: 700
    height: 100

    Text {
        id: passwordText
        text: qsTr("Password: ")
    }
    TextInput {
        id: password
        anchors.left: passwordText.right
        anchors.right: parent.right
        echoMode: TextInput.Password
        focus: true

        onAccepted: {
            result.text = "Result: " + hash.Do(password.text, page.text)
            page.focus = true
        }
    }

    Text {
        id: pageText
        anchors.top: passwordText.bottom
        text: qsTr("Page: ")
    }
    TextInput {
        id: page
        anchors.left: passwordText.right
        anchors.right: parent.right
        anchors.top: password.bottom

        onAccepted: {
            result.text = "Result: " + hash.Do(password.text, page.text)
        }
    }

    ListView {
        anchors.top: pageText.bottom
        anchors.bottom: result.top
        anchors.left: parent.left
        anchors.right: parent.right
        clip: true
        model: myModel

        delegate: Text {
            text: modelData

            MouseArea {
                anchors.fill: parent

                onClicked: {
                    page.text = parent.text
                    page.onAccepted()
                }

                onPressAndHold: {
                    hash.Remove(parent.text)
                }
            }
        }
    }

    Text {
        id: result
        anchors.bottom: parent.bottom
        text: qsTr("Result: -")
    }
}


import bb.cascades 1.0
import bb.system 1.0
import bb.platform 1.0

import "prettyDate.js" as PrettyDate

NavigationPane {
	id: navigationPane
	property bool shouldNotify: false

	onCreationCompleted: {
		/* Init UI */

		conversations.append([
			{lastMessage: "Well, that's how it goes.", fn: "Jesse Rogers", updated: new Date()},
			{fn: "Christopher Vollick", lastMessage: "Hello", updated: new Date(2013,05,01,9,9,9,9)},
			{fn: "Jim Murphy", lastMessage: "Lunch?", updated: new Date(2013,05,12,9,9,9,9)}
		]);
	}

	Page {
		Container {
			ListView {
				dataModel: ArrayDataModel {
					id: conversations
				}

				// Use a ListItemComponent to determine which property in the
				// data model is displayed for each list item
				listItemComponents: [
					ListItemComponent {
						type: ""

						StandardListItem {
							title: ListItemData.fn
							description: ListItemData.lastMessage
							status: PrettyDate.format(ListItemData.updated)
						}
					}
				]

			}
		}
	}

	attachedObjects: [
	]
}

Update conversation view on new message

import bb.cascades 1.0
import bb.system 1.0
import bb.platform 1.0

import "prettyDate.js" as PrettyDate

NavigationPane {
	id: navigationPane
	property bool shouldNotify: false

	onCreationCompleted: {
		/* Init UI */

		app.ChatMessage.connect(function(otherSide, threadID, fromJid, stanzaID, subject, body) {
			// TODO: think about what happens with a very long list
			for(var i = 0; i < conversations.size(); i++) {
				var val = conversations.value(i);
				if(val.threadID == threadID && val.otherSide == otherSide) {
					conversations.removeAt(i);
					break;
				}
			}

			conversations.insert(0, [{lastMessage: body, fn: fromJid, updated: new Date(), threadID: threadID, otherSide: otherSide}]);
		});
	}

	Page {
		Container {
			ListView {
				dataModel: ArrayDataModel {
					id: conversations
				}

				// Use a ListItemComponent to determine which property in the
				// data model is displayed for each list item
				listItemComponents: [
					ListItemComponent {
						type: ""

						StandardListItem {
							title: ListItemData.fn
							description: ListItemData.lastMessage
							status: PrettyDate.format(ListItemData.updated)
						}
					}
				]

			}
		}
	}

	attachedObjects: [
	]
}


import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1

import UM 1.0 as UM

Rectangle {
    id: base;

    width: UM.Theme.sizes.tooltip.width;
    height: label.height + UM.Theme.sizes.tooltip_margins.height * 2;
    color: UM.Theme.colors.tooltip;

    opacity: 0;
    Behavior on opacity { NumberAnimation { duration: 100; } }

    property alias text: label.text;

    function show(position) {
        x = position.x;
        y = position.y;
        base.opacity = 1;
    }

    function hide() {
        base.opacity = 0;
    }

    Label {
        id: label;
        anchors {
            top: parent.top;
            topMargin: UM.Theme.sizes.tooltip_margins.height;
            left: parent.left;
            leftMargin: UM.Theme.sizes.tooltip_margins.width;
            right: parent.right;
            rightMargin: UM.Theme.sizes.tooltip_margins.width;
        }

//         horizontalAlignment: Qt.AlignJustify;
        wrapMode: Text.Wrap;
    }
}

Make sure the description tooltip is not cutoff at the bottom of the window

import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1

import UM 1.0 as UM

Rectangle {
    id: base;

    width: UM.Theme.sizes.tooltip.width;
    height: label.height + UM.Theme.sizes.tooltip_margins.height * 2;
    color: UM.Theme.colors.tooltip;

    opacity: 0;
    Behavior on opacity { NumberAnimation { duration: 100; } }

    property alias text: label.text;

    function show(position) {
        if(position.y + base.height > parent.height) {
            x = position.x;
            y = parent.height - base.height;
        } else {
            x = position.x;
            y = position.y;
        }
        base.opacity = 1;
    }

    function hide() {
        base.opacity = 0;
    }

    Label {
        id: label;
        anchors {
            top: parent.top;
            topMargin: UM.Theme.sizes.tooltip_margins.height;
            left: parent.left;
            leftMargin: UM.Theme.sizes.tooltip_margins.width;
            right: parent.right;
            rightMargin: UM.Theme.sizes.tooltip_margins.width;
        }
        wrapMode: Text.Wrap;
        font: UM.Theme.fonts.default;
    }
}


import QtQuick 2.0
import Sailfish.Silica 1.0

Item {
    property alias label: labelComp.text
    property alias value: valueComp.text

    anchors.left: parent.left
    anchors.right: parent.right
    height: valueComp.height

    Label {
        id: labelComp
        text: "<missing label binding>"
        color: Theme.secondaryHighlightColor
        font.pixelSize: Theme.fontSizeTiny
        anchors.left: parent.left
        anchors.right: parent.right
    }
    Label {
        id: valueComp
        text: "<missing value binding>"
        font.pixelSize: Theme.fontSizeExtraSmall
        horizontalAlignment: Text.AlignRight
        anchors.left: parent.left
        anchors.right: parent.right
    }
}

Change property label color for better readability

import QtQuick 2.0
import Sailfish.Silica 1.0

Item {
    property alias label: labelComp.text
    property alias value: valueComp.text

    anchors.left: parent.left
    anchors.right: parent.right
    height: valueComp.height

    Label {
        id: labelComp
        text: "<missing label binding>"
        color: Theme.highlightColor
        font.pixelSize: Theme.fontSizeTiny
        anchors.left: parent.left
        anchors.right: parent.right
    }
    Label {
        id: valueComp
        text: "<missing value binding>"
        font.pixelSize: Theme.fontSizeExtraSmall
        horizontalAlignment: Text.AlignRight
        anchors.left: parent.left
        anchors.right: parent.right
    }
}


import qbs 1.0

Product {
    name: "SharedContent"

    Group {
        name: "Unconditional"
        qbs.install: true
        qbs.installDir: project.ide_data_path
        qbs.installSourceBase: "qtcreator"
        prefix: "qtcreator/"
        files: [
            "debugger/**/*",
            "designer/**/*",
            "generic-highlighter/**/*",
            "glsl/**/*",
            "qml/**/*",
            "qmldesigner/**/*",
            "qmlicons/**/*",
            "qml-type-descriptions/**/*",
            "schemes/**/*",
            "snippets/**/*",
            "styles/**/*",
            "templates/**/*",
            "themes/**/*",
            "welcomescreen/**/*"
        ]
    }

    Group {
        name: "Conditional"
        qbs.install: true
        qbs.installDir: project.ide_data_path + "/externaltools"
        prefix: project.ide_source_tree + "/src/share/qtcreator/externaltools/"
        files: {
            var list = [
                "lrelease.xml",
                "lupdate.xml",
                "qmlscene.xml",
                "qmlviewer.xml",
                "sort.xml",
            ]
            if (qbs.targetOS.contains("windows"))
                list.push("notepad_win.xml");
            else if (qbs.targetOS.contains("osx"))
                list.push("vi_mac.xml");
            else
                list.push("vi.xml");
            return list;
        }
    }
}

Install run-time resources also with qbs build.

import qbs 1.0

Product {
    name: "SharedContent"

    Group {
        name: "Unconditional"
        qbs.install: true
        qbs.installDir: project.ide_data_path
        qbs.installSourceBase: "qtcreator"
        prefix: "qtcreator/"
        files: [
            "cplusplus/**/*",
            "debugger/**/*",
            "designer/**/*",
            "generic-highlighter/**/*",
            "glsl/**/*",
            "qml/**/*",
            "qmldesigner/**/*",
            "qmlicons/**/*",
            "qml-type-descriptions/**/*",
            "schemes/**/*",
            "snippets/**/*",
            "styles/**/*",
            "templates/**/*",
            "themes/**/*",
            "welcomescreen/**/*"
        ]
    }

    Group {
        name: "Conditional"
        qbs.install: true
        qbs.installDir: project.ide_data_path + "/externaltools"
        prefix: project.ide_source_tree + "/src/share/qtcreator/externaltools/"
        files: {
            var list = [
                "lrelease.xml",
                "lupdate.xml",
                "qmlscene.xml",
                "qmlviewer.xml",
                "sort.xml",
            ]
            if (qbs.targetOS.contains("windows"))
                list.push("notepad_win.xml");
            else if (qbs.targetOS.contains("osx"))
                list.push("vi_mac.xml");
            else
                list.push("vi.xml");
            return list;
        }
    }
}


import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1

import UM 1.0 as UM

UM.Dialog {
    id: base

    //: Add Printer dialog title
    title: qsTr("Add Printer");

    ColumnLayout {
        anchors.fill: parent;
        anchors.margins: UM.Styles.defaultMargin;

        Label {
            text: qsTr("Add Printer");
            font.pointSize: 18;
        }

        Label {
            text: qsTr("Please select the type of printer:");
        }

        ScrollView {
            Layout.fillWidth: true;

            ListView {
                id: machineList;
                model: UM.Models.availableMachinesModel
                delegate: RadioButton { exclusiveGroup: printerGroup; text: model.name; onClicked: ListView.view.currentIndex = index; }
            }
        }

        Label {
            text: qsTr("Printer Name:");
        }

        TextField { id: machineName; Layout.fillWidth: true; text: machineList.model.getItem(machineList.currentIndex).name }

        Item { Layout.fillWidth: true; Layout.fillHeight: true; }

        ExclusiveGroup { id: printerGroup; }
    }

    rightButtons: [
        Button {
            text: qsTr("Next");
            onClicked: {
                if(machineList.currentIndex != -1) {
                    UM.Models.availableMachinesModel.createMachine(machineList.currentIndex, machineName.text)
                    base.visible = false
                }
            }
        },
        Button {
            text: qsTr("Cancel");
            onClicked: base.visible = false;
        }
    ]
}

Remove unnecessary margin that was set from a removed file

import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1

import UM 1.0 as UM

UM.Dialog {
    id: base

    //: Add Printer dialog title
    title: qsTr("Add Printer");

    ColumnLayout {
        anchors.fill: parent;

        Label {
            text: qsTr("Add Printer");
            font.pointSize: 18;
        }

        Label {
            text: qsTr("Please select the type of printer:");
        }

        ScrollView {
            Layout.fillWidth: true;

            ListView {
                id: machineList;
                model: UM.Models.availableMachinesModel
                delegate: RadioButton { exclusiveGroup: printerGroup; text: model.name; onClicked: ListView.view.currentIndex = index; }
            }
        }

        Label {
            text: qsTr("Printer Name:");
        }

        TextField { id: machineName; Layout.fillWidth: true; text: machineList.model.getItem(machineList.currentIndex).name }

        Item { Layout.fillWidth: true; Layout.fillHeight: true; }

        ExclusiveGroup { id: printerGroup; }
    }

    rightButtons: [
        Button {
            text: qsTr("Next");
            onClicked: {
                if(machineList.currentIndex != -1) {
                    UM.Models.availableMachinesModel.createMachine(machineList.currentIndex, machineName.text)
                    base.visible = false
                }
            }
        },
        Button {
            text: qsTr("Cancel");
            onClicked: base.visible = false;
        }
    ]
}


// Copyright (c) 2016 Ultimaker B.V.
// Cura is released under the terms of the AGPLv3 or higher.

import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1

import UM 1.2 as UM
import Cura 1.0 as Cura

Cura.MachineAction
{
    anchors.fill: parent;
    Item
    {
        id: bedLevelMachineAction
        anchors.fill: parent;

        UM.I18nCatalog { id: catalog; name: "cura"; }
        Column
        {
            anchors.fill: parent;
            Label
            {
                width: parent.width
                wrapMode: Text.WordWrap
                text: catalog.i18nc("@label","Please select any upgrades made to this ultimaker original");
            }
            CheckBox
            {
                text: catalog.i18nc("@label", "Self-built heated bed")
                checked: manager.hasHeatedBed
                onClicked: manager.hasHeatedBed ? manager.removeHeatedBed() : manager.addHeatedBed()
            }
        }
    }
}

Make Select Upgrades page look like the other pages

// Copyright (c) 2016 Ultimaker B.V.
// Cura is released under the terms of the AGPLv3 or higher.

import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1

import UM 1.2 as UM
import Cura 1.0 as Cura

Cura.MachineAction
{
    anchors.fill: parent;
    Item
    {
        id: upgradeSelectionMachineAction
        anchors.fill: parent

        Label
        {
            id: pageTitle
            width: parent.width
            text: catalog.i18nc("@title", "Check Printer")
            wrapMode: Text.WordWrap
            font.pointSize: 18;
        }

        Label
        {
            id: pageDescription
            anchors.top: pageTitle.bottom
            anchors.topMargin: UM.Theme.getSize("default_margin").height
            width: parent.width
            wrapMode: Text.WordWrap
            text: catalog.i18nc("@label","Please select any upgrades made to this Ultimaker Original");
        }

        CheckBox
        {
            anchors.top: pageDescription.bottom
            anchors.topMargin: UM.Theme.getSize("default_margin").height

            text: catalog.i18nc("@label", "Self-built heated bed")
            checked: manager.hasHeatedBed
            onClicked: manager.hasHeatedBed ? manager.removeHeatedBed() : manager.addHeatedBed()
        }

        UM.I18nCatalog { id: catalog; name: "cura"; }
    }
}


import qbs 1.0

Project {
    StaticLibrary {
        name : "testa"
        files : [ "testa.s" ]
        Depends { name: "cpp" }
        condition: qbs.toolchain.contains("gcc")
    }
    StaticLibrary {
        name : "testb"
        files : [ "testb.S" ]
        Depends { name: "cpp" }
        condition: qbs.toolchain.contains("gcc")
    }
    StaticLibrary {
        name : "testc"
        files : [ "testc.sx" ]
        Depends { name: "cpp" }
        condition: qbs.toolchain.contains("gcc")
    }
    StaticLibrary {
        name : "testd"
        files : [ "testd_" + qbs.architecture + ".asm" ]
        Depends { name: "cpp" }
        condition: qbs.toolchain.contains("msvc")
                   && (qbs.architecture === "x86" || qbs.architecture === "x86_64")
    }
}

Fix testAssembly blackbox test on all non-Intel architectures.

import qbs 1.0

Project {
    StaticLibrary {
        name : "testa"
        files : [ "testa.s" ]
        Depends { name: "cpp" }
        condition: qbs.toolchain.contains("gcc")
    }
    StaticLibrary {
        name : "testb"
        files : [ "testb.S" ]
        Depends { name: "cpp" }
        condition: qbs.toolchain.contains("gcc")
    }
    StaticLibrary {
        name : "testc"
        files : [ "testc.sx" ]
        Depends { name: "cpp" }
        condition: qbs.toolchain.contains("gcc")
    }
    StaticLibrary {
        name: "testd"
        Group {
            condition: product.condition
            files: ["testd_" + qbs.architecture + ".asm"]
        }
        Depends { name: "cpp" }
        condition: qbs.toolchain.contains("msvc")
                   && (qbs.architecture === "x86" || qbs.architecture === "x86_64")
    }
}


import QtQuick 1.0

Rectangle {
    id: dialog
    property int animationSpeed: 500
    property bool autoClose: false

    signal opened
    signal closed

    function show(text) {
        dialog.opened();
        dialogText.text = text;
        dialog.opacity = 1;
    }

    function maybeClose() {
        if (dialog.visible && dialog.autoClose) {
            closeTimer.start();
        }
    }

    function forceClose() {
        if (dialog.opacity == 0) {
            return; //already closed
        }
        dialog.closed();
        dialog.opacity = 0;
    }

    Timer {
        id: closeTimer
        interval: dialog.animationSpeed; running: false; repeat: false;
        onTriggered: { dialog.forceClose(); }
    }

    width: dialogText.width + 20; height: dialogText.height + 20
    color: "white"
    border.width: 1
    radius: 5
    opacity: 0
    visible: opacity > 0

    Behavior on opacity {
        SequentialAnimation {
            NumberAnimation { duration: animationSpeed }
            ScriptAction { script: dialog.maybeClose(); }
        }
    }

    Text { id: dialogText; anchors.centerIn: parent; text: "Hello!" }

    MouseArea { anchors.fill: parent; onClicked: forceClose(); }
}

Use default font size in dialog

import QtQuick 1.0
import "uiconstants.js" as UI

Rectangle {
    id: dialog
    property int animationSpeed: 500
    property bool autoClose: false

    signal opened
    signal closed

    function show(text) {
        dialog.opened();
        dialogText.text = text;
        dialog.opacity = 1;
    }

    function maybeClose() {
        if (dialog.visible && dialog.autoClose) {
            closeTimer.start();
        }
    }

    function forceClose() {
        if (dialog.opacity == 0) {
            return; //already closed
        }
        dialog.closed();
        dialog.opacity = 0;
    }

    Timer {
        id: closeTimer
        interval: dialog.animationSpeed; running: false; repeat: false;
        onTriggered: { dialog.forceClose(); }
    }

    width: dialogText.width + 20; height: dialogText.height + 20
    color: "white"
    border.width: 1
    radius: 5
    opacity: 0
    visible: opacity > 0

    Behavior on opacity {
        SequentialAnimation {
            NumberAnimation { duration: animationSpeed }
            ScriptAction { script: dialog.maybeClose(); }
        }
    }

    Text {
        id: dialogText
        anchors.centerIn: parent
        text: "Hello!"
        font.pixelSize: UI.FONT_DEFAULT
    }

    MouseArea { anchors.fill: parent; onClicked: forceClose(); }
}


/*
 * Copyright 2011 Intel Corporation.
 *
 * This program is licensed under the terms and conditions of the
 * Apache License, version 2.0.  The full text of the Apache License is at
 * http://www.apache.org/licenses/LICENSE-2.0
 */

import Qt 4.7

Item {
    id: avatar

    property bool active: true
    property alias source: avatarImage.source
    property alias noAvatarImage: noAvatar.source

    width: childrenRect.width
    height:  parent.height

    Image {
        id: avatarImage

        anchors.fill: avatarItem

        fillMode: Image.PreserveAspectFit

        visible: (source != ""? true : false)
        onStatusChanged: {
            if (status == Image.Error) {
                avatarImage.visible = false;
            } else if (status == Image.Ready) {
                avatarImage.visible = true;
            }
        }
    }

    Item {
        id: avatarItem
        anchors.top: parent.top
        anchors.bottom: parent.bottom
        anchors.left: parent.left
        anchors.margins: 2
        width: height
    }

    BorderImage {
        id: avatarBorder

        anchors.fill: avatarImage

        visible: avatarImage.visible

        source: (active ?
                     "image://themedimage/widgets/common/avatar/avatar-shadow" :
                     "image://themedimage/widgets/common/avatar/avatar-inactive-overlay")
    }

    BorderImage {
        id: noAvatar
        anchors.fill: avatarImage
        source: "image://themedimage/widgets/common/avatar/avatar-default"
        visible: !avatarImage.visible
    }
}

Change the visibility of the avatar according to image status

/*
 * Copyright 2011 Intel Corporation.
 *
 * This program is licensed under the terms and conditions of the
 * Apache License, version 2.0.  The full text of the Apache License is at
 * http://www.apache.org/licenses/LICENSE-2.0
 */

import Qt 4.7

Item {
    id: avatar

    property bool active: true
    property alias source: avatarImage.source
    property alias noAvatarImage: noAvatar.source

    width: childrenRect.width
    height:  parent.height

    Image {
        id: avatarImage

        anchors.fill: avatarItem

        fillMode: Image.PreserveAspectFit

        visible: (source != "" && status == Image.Ready? true : false)
    }

    Item {
        id: avatarItem
        anchors.top: parent.top
        anchors.bottom: parent.bottom
        anchors.left: parent.left
        anchors.margins: 2
        width: height
    }

    BorderImage {
        id: avatarBorder

        anchors.fill: avatarImage

        visible: avatarImage.visible

        source: (active ?
                     "image://themedimage/widgets/common/avatar/avatar-shadow" :
                     "image://themedimage/widgets/common/avatar/avatar-inactive-overlay")
    }

    BorderImage {
        id: noAvatar
        anchors.fill: avatarImage
        source: "image://themedimage/widgets/common/avatar/avatar-default"
        visible: !avatarImage.visible
    }
}


import QtQuick 2.4
import QtQuick.Controls 1.1

ListView {
    id: view

    anchors.margins: 2

    Rectangle {
        id: background

        anchors.fill: parent
        radius: 5
        z: -3
        clip: true

        color: "white"
        border.width: 2
        border.color: "gray"
    }

    Item {
        id: reparent
        states: State {
            name: "reparent"
            ParentChange {
                target: view.contentItem
                parent: background
            }
        }
        Component.onCompleted: state = "reparent"
    }

    highlight: Rectangle {
        x: view.anchors.margins + 2
        color: "lightsteelblue";
        radius: 5;
        width: totalWidth

        onWidthChanged: width = Qt.binding(function() { return totalWidth; })
    }

    property variant widthList: []
    property int totalWidth: 0
    property bool __complete: false

    function columnWidth(col, width) {
        if (widthList[col] >= width)
            return;

        var cur = widthList[col] === undefined ? 0 : widthList[col];
        widthList[col] = width;
        totalWidth += width - cur;

        if (__complete) {
            view.widthListChanged();
            view.totalWidthChanged();
        }
    }

    Component.onCompleted: {
        __complete = true;
        view.widthListChanged();
        view.totalWidthChanged();
    }
}

Fix custom list view to clip content before the border

import QtQuick 2.4
import QtQuick.Controls 1.1

ListView {
    id: view

    anchors.margins: 2

    Rectangle {
        id: backgroundBorder

        anchors.fill: parent
        radius: 5
        z: -3

        color: "white"
        border.width: 2
        border.color: "gray"
        Rectangle {
            id: backgroundDraw
            clip: true
            radius: 5
            anchors.margins: 2
            anchors.fill: parent
            color: "white"
            Item {
                id: background
                anchors.margins: -2
                anchors.fill: parent
            }
        }
    }

    Item {
        id: reparent
        states: State {
            name: "reparent"
            ParentChange {
                target: view.contentItem
                parent: background
            }
        }
        Component.onCompleted: state = "reparent"
    }

    highlight: Rectangle {
        x: view.anchors.margins + 2
        color: "lightsteelblue";
        radius: 5;
        width: totalWidth

        onWidthChanged: width = Qt.binding(function() { return totalWidth; })
    }

    property variant widthList: []
    property int totalWidth: 0
    property bool __complete: false

    function columnWidth(col, width) {
        if (widthList[col] >= width)
            return;

        var cur = widthList[col] === undefined ? 0 : widthList[col];
        widthList[col] = width;
        totalWidth += width - cur;

        if (__complete) {
            view.widthListChanged();
            view.totalWidthChanged();
        }
    }

    Component.onCompleted: {
        __complete = true;
        view.widthListChanged();
        view.totalWidthChanged();
    }
}


/*
 * Copyright 2011 Intel Corporation.
 *
 * This program is licensed under the terms and conditions of the
 * Apache License, version 2.0.  The full text of the Apache License is at
 * http://www.apache.org/licenses/LICENSE-2.0
 */

import Qt 4.7
import MeeGo.Components 0.1

TileItem {
    id: container
    separatorVisible: true
    width: parent ? parent.width : 0

    property string text: ""

    signal clicked()

    contents: Item {
        height: button.height + 2*panelSize.contentTopMargin
        Button {
            id: button
            active: true
            text: container.text
            font.family: panelSize.fontFamily
            font.pixelSize: panelSize.tileFontSize //THEME - VERIFY
            maxWidth: parent.width
            anchors.bottomMargin: panelSize.contentTopMargin
            anchors.topMargin: panelSize.contentTopMargin
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.verticalCenter: parent.verticalCenter
            onClicked: {
                container.clicked()
            }
        }
    }
}

Make panel button always the same width

/*
 * Copyright 2011 Intel Corporation.
 *
 * This program is licensed under the terms and conditions of the
 * Apache License, version 2.0.  The full text of the Apache License is at
 * http://www.apache.org/licenses/LICENSE-2.0
 */

import Qt 4.7
import MeeGo.Components 0.1

TileItem {
    id: container
    separatorVisible: true
    width: parent ? parent.width : 0

    property string text: ""

    signal clicked()

    contents: Item {
        height: button.height + 2*panelSize.contentTopMargin
        Button {
            id: button
            active: true
            text: container.text
            font.family: panelSize.fontFamily
            font.pixelSize: panelSize.tileFontSize //THEME - VERIFY
            width: parent.width - 2*panelSize.contentSideMargin
            maxWidth: width
            anchors.bottomMargin: panelSize.contentTopMargin
            anchors.topMargin: panelSize.contentTopMargin
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.verticalCenter: parent.verticalCenter
            onClicked: {
                container.clicked()
            }
        }
    }
}


Protocol {
	property string data;

	onUrlChanged: {
		var self = this
		this.requestXHR({
			"url": value,
			"callback": function(data) { self.data = data.target.responseText }
		})
	}
}

Add 'url' property bacause it was removed from the Protocol.

Protocol {
	property string url;
	property string data;

	onUrlChanged: {
		var self = this
		this.requestXHR({
			"url": value,
			"callback": function(data) { self.data = data.target.responseText }
		})
	}
}


import QtQuick 2.12

Item {
    id: root

    property string key
    property var def
    property var obj: settings

    property var value: root.obj ? root.obj.value(root.key, root.def) : null

    function setValue(val) {
        root.obj.setValue(root.key, val, root.def)
        root.value = val
    }
}

Fix default setting value cast

import QtQuick 2.12

Item {
    id: root

    property string key
    property var def
    property var obj: settings

    property var value: root.obj
        ? root.obj.value(root.key, root.def)
        : (typeof def === "boolean" ? false : (typeof def === "number" ? 0 : ""))

    function setValue(val) {
        root.obj.setValue(root.key, val, root.def)
        root.value = val
    }
}


import Qt 4.6

Item {
    id: Container

    property var flickableArea

    Rectangle {
        radius: 5
        color: "black"
        opacity: 0.3
        border.color: "white"
        border.width: 2
        x: 0
        y: flickableArea.pageYPosition * Container.height
        width: parent.width
        height: flickableArea.pageHeight * Container.height
    }
    states: [
        State {
            name: "show"
            when: flickableArea.moving
            PropertyChanges {
                target: Container
                opacity: 1
            }
        }
    ]
    transitions: [
        Transition {
            from: "*"
            to: "*"
            NumberAnimation {
                target: Container
                properties: "opacity"
                duration: 400
            }
        }
    ]
}

Fix scrollbar after API changes.

import Qt 4.6

Item {
    id: Container

    property var flickableArea

    Rectangle {
        radius: 5
        color: "black"
        opacity: 0.3
        border.color: "white"
        border.width: 2
        x: 0
        y: flickableArea.visibleArea.yPosition * Container.height
        width: parent.width
        height: flickableArea.visibleArea.heightRatio * Container.height
    }
    states: [
        State {
            name: "show"
            when: flickableArea.moving
            PropertyChanges {
                target: Container
                opacity: 1
            }
        }
    ]
    transitions: [
        Transition {
            from: "*"
            to: "*"
            NumberAnimation {
                target: Container
                properties: "opacity"
                duration: 400
            }
        }
    ]
}


import QtQuick 2.0

Rectangle {
    property var paletteModel
    anchors.fill: parent
    Column {
        Text {
            text: paletteModel.name
        }

        Row {
            Repeater {
                model: paletteModel.colors
                delegate: Rectangle {
                    width: 30
                    height: 30
                    color: modelData
                }
            }
        }
    }
}

Remove filling so that palette will be more reusable

import QtQuick 2.0

Rectangle {
    property var paletteModel

    Column {
        Text {
            text: paletteModel.name
        }

        Row {
            Repeater {
                model: paletteModel.colors
                delegate: Rectangle {
                    width: 30
                    height: 30
                    color: modelData
                }
            }
        }
    }
}


import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1

import Cura 1.0 as Cura

Cura.DefaultWindow {
    title: "Cura"
}

Move QML files over to QtQuick 2.1 instead of 2.2

import QtQuick 2.1
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1

import Cura 1.0 as Cura

Cura.DefaultWindow {
    title: "Cura"
}


import QtQuick 2.5
import QtQuick.Controls 1.4

DefaultDialog {

    id: aboutPage
    title: qsTr("About YubiKey Manager")

    Label {
        text: qsTr("YubiKey Manager")
        font.bold: true
    }

    Label {
        text: qsTr("Version: ") + appVersion
    }

    Label {
        text: qsTr("Copyright © 2017, Yubico Inc. All rights reserved.")
    }

    Label {
        text: qsTr("Need help?")
        font.bold: true
    }

    Label {
        text: qsTr("Visit Yubico Knowledge Base")
        onLinkActivated: Qt.openUrlExternally(link)

        MouseArea {
           anchors.fill: parent
           acceptedButtons: Qt.NoButton
           cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
        }
    }
}

Update the year in the About dialog

import QtQuick 2.5
import QtQuick.Controls 1.4

DefaultDialog {

    id: aboutPage
    title: qsTr("About YubiKey Manager")

    Label {
        text: qsTr("YubiKey Manager")
        font.bold: true
    }

    Label {
        text: qsTr("Version: ") + appVersion
    }

    Label {
        text: qsTr("Copyright © 2018, Yubico Inc. All rights reserved.")
    }

    Label {
        text: qsTr("Need help?")
        font.bold: true
    }

    Label {
        text: qsTr("Visit Yubico Knowledge Base")
        onLinkActivated: Qt.openUrlExternally(link)

        MouseArea {
           anchors.fill: parent
           acceptedButtons: Qt.NoButton
           cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
        }
    }
}


/*
 * steamlink-qml-example
 * Copyright (c) 2016 Mackenzie Straight. See LICENSE for license details.
 */
import QtQuick 2.0
import org.e7m.steamlink 1.0

Rectangle {
    id: page
    width: 320; height: 480
    color: "lightgray"

    Text {
        id: helloText
        text: "Hello world!"
        y: 30
        anchors.horizontalCenter: page.horizontalCenter
        font.pointSize: 24; font.bold: true
    }

    Grid {
        id: colorPicker
        x: 4;
        anchors.top: helloText.bottom
        anchors.topMargin: 30
        anchors.rightMargin: 4
        anchors.bottom: page.bottom
        anchors.bottomMargin: 4
        anchors.right: page.right
        anchors.left: page.left
        rows: 2; columns: 3;
        focus: true

        Cell { cellColor: "red" }
        Cell { cellColor: "green" }
        Cell { cellColor: "blue" }
        Cell { cellColor: "yellow" }
        Cell { cellColor: "steelblue" }
        Cell { cellColor: "black" }

        Controller.onPressed: {
            console.log("Generic handler", event.type)
            event.accepted = event.type === 2
        }

        Controller.onReleased: {
            console.log("Button released")
        }

        Controller.onButtonAPressed: {
            console.log("Specific handler auto-accepts like Keys")
        }
    }
}

Exit when Steam button is pressed.

/*
 * steamlink-qml-example
 * Copyright (c) 2016 Mackenzie Straight. See LICENSE for license details.
 */
import QtQuick 2.0
import org.e7m.steamlink 1.0

Rectangle {
    id: page
    width: 320; height: 480
    color: "lightgray"

    Text {
        id: helloText
        text: "Hello world!"
        y: 30
        anchors.horizontalCenter: page.horizontalCenter
        font.pointSize: 24; font.bold: true
    }

    Grid {
        id: colorPicker
        x: 4;
        anchors.top: helloText.bottom
        anchors.topMargin: 30
        anchors.rightMargin: 4
        anchors.bottom: page.bottom
        anchors.bottomMargin: 4
        anchors.right: page.right
        anchors.left: page.left
        rows: 2; columns: 3;
        focus: true

        Cell { cellColor: "red" }
        Cell { cellColor: "green" }
        Cell { cellColor: "blue" }
        Cell { cellColor: "yellow" }
        Cell { cellColor: "steelblue" }
        Cell { cellColor: "black" }

        Controller.onPressed: {
            console.log("Generic handler", event.type)
            event.accepted = event.type === 2
        }

        Controller.onReleased: {
            console.log("Button released")
        }

        Controller.onButtonAPressed: {
            console.log("Specific handler auto-accepts like Keys")
            helloText.text = "[A] button pressed."
        }

        Controller.onButtonGuidePressed: Qt.quit()
    }
}


// -*- qml -*-
import QtQuick 1.1
import com.nokia.meego 1.1
import QtCamera 1.0

Selector {
        id: button

        property alias value: evComp.value

        iconSource: evComp.value == 0 ? "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-manual-exposure.png" : ""
        text: evComp.value == 0 ? "" : evComp.value.toFixed(1);
        font.pixelSize: 23
        timerConstraints: slider.pressed

        EvComp {
                id: evComp
                camera: cam

                // TODO: hardcoding
                value: slider.value
        }

        widget: Slider {
                id: slider
                width: 500
                orientation: Qt.Horizontal
                minimumValue: evComp.minimum
                maximumValue: evComp.maximum
                value: evComp.value
                stepSize: 0.1
                Component.onCompleted: { slider.value = evComp.value; }
        }
}

Adjust the font size after changing the size of the button

// -*- qml -*-
import QtQuick 1.1
import com.nokia.meego 1.1
import QtCamera 1.0

Selector {
        id: button

        property alias value: evComp.value

        iconSource: evComp.value == 0 ? "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-manual-exposure.png" : ""
        text: evComp.value == 0 ? "" : evComp.value.toFixed(1);
        font.pixelSize: 19
        timerConstraints: slider.pressed

        EvComp {
                id: evComp
                camera: cam

                // TODO: hardcoding
                value: slider.value
        }

        widget: Slider {
                id: slider
                width: 500
                orientation: Qt.Horizontal
                minimumValue: evComp.minimum
                maximumValue: evComp.maximum
                value: evComp.value
                stepSize: 0.1
                Component.onCompleted: { slider.value = evComp.value; }
        }
}


/****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Raine Makelainen <raine.makelainen@jolla.com>
**
****************************************************************************/

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

import QtQuick 2.0
import Sailfish.Silica 1.0
import Sailfish.Browser 1.0

ApplicationWindow {
    id: window

    property alias webView: webView
    property alias tabModel: webView.tabModel
    property alias historyModel: historyModel

    allowedOrientations: Orientation.Portrait
    _defaultPageOrientations: allowedOrientations

    initialPage: Page {
        WebView {
            id: webView

            active: true
            toolbarHeight: 50
            portrait: true

            HistoryModel {
                id: historyModel
            }
        }
    }

    cover: undefined
}

Improve unit tests of WebView

/****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Raine Makelainen <raine.makelainen@jolla.com>
**
****************************************************************************/

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

import QtQuick 2.0
import Sailfish.Silica 1.0
import Sailfish.Browser 1.0

ApplicationWindow {
    id: window

    property alias webView: webView
    property alias tabModel: webView.tabModel
    property alias historyModel: historyModel

    allowedOrientations: Orientation.Portrait
    _defaultPageOrientations: allowedOrientations

    initialPage: Page {
        WebView {
            id: webView

            active: true
            portrait: true
            toolbarHeight: 0
            fullscreenHeight: Screen.height
            width: parent.width
            height: parent.height

            HistoryModel {
                id: historyModel
            }
        }
    }

    cover: undefined
}


Implement control for .srt subtitles parsing and displaying

Resource {
	property real progress;
	property string text;

	onProgressChanged: {
		var blocks = this._textBlocks
		if (!blocks || blocks.length == 0) {
			this.text = ""
			return
		}

		if (value < blocks[0].startTime || value > blocks[blocks.length - 1].endTime) {
			this.text = ""
			return
		}

		var found = false
		for (var i in blocks) {
			if (value >= blocks[i].startTime && value <= blocks[i].endTime) {
				this.text = blocks[i].text
				found = true
			}
		}

		if (!found)
			this.text = ""
	}

	turnOff: {
		this._textBlocks = null
		this.text = ""
		this.url = ""
	}

	onDataChanged: {
		var lines = value.split('\n');
		var textBlocks = []
		var startTime = 0
		var endTime = 0
		var blockNumber = 0
		var text = ""
		for (var i in lines) {
			var line = lines[i].trim()
			if (line == "") {
				if (text.trim() != "")
					textBlocks.push({ text: text, startTime: startTime, endTime: endTime, blockNumber: blockNumber })
				text = ""
				startTime = 0
				endTime = 0
				blockNumber = 0
			} else if (this.digitRegExp.test(line)) {
				blockNumber = parseInt(line)
			} else if (line.indexOf("-->") > 0) {
				var timeStrings = line.split("-->")
				if (timeStrings.length < 2)
					continue
				var startTimeStr = timeStrings[0].trim()
				var endTimeStr = timeStrings[1].trim()
				startTime = this.getTimeDuration(startTimeStr)
				endTime = this.getTimeDuration(endTimeStr)
			} else {
				if (text)
					text += "<br>"
				text += line
			}
		}

		log("got subtitles", textBlocks.length, "lines")
		this._textBlocks = textBlocks
	}

	getTimeDuration(str): {
		var parts = str.split(":")
		var res = 0
		var hours = parseInt(parts[0]) * 3600
		var min = parseInt(parts[1]) * 60
		var sec = parseInt(parts[2].split(",")[0])
		res = hours + min + sec
		return res
	}

	constructor: { this.digitRegExp = /^\d+$/; }
}


import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import QtQuick.Window 2.0

ApplicationWindow {
    id: root
    visible: false
    width: bar.implicitWidth
    height: 400
    minimumWidth: 400
    minimumHeight: 300
    title: "puush-qt"

    Connections {
        target: systemTray

        onSignalOpenSettings: {
            root.show()
            bar.currentIndex = tab
        }
    }

    TabBar {
        id: bar
        x: 0
        y: 0
        z: 10
        width: root.width

        TabButton {
            text: qsTr("General")
        }

        TabButton {
            text: qsTr("Key Bindings")
        }

        TabButton {
            text: qsTr("Account")
            onClicked: account.updateAccountInformation()
        }

        TabButton {
            text: qsTr("Advanced")
        }

        TabButton {
            text: qsTr("About")
        }
    }

    StackLayout {
        id: mainLayout
        width: parent.width
        height: parent.height - bar.height
        currentIndex: bar.currentIndex
        anchors.top: bar.bottom

        General { }

        KeyBindings { }

        Account {
            id: account
        }

        Advanced { }

        About { }
    }

    onClosing: {
        root.hide()
    }
}

Use clip instead of z

import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import QtQuick.Window 2.0

ApplicationWindow {
    id: root
    visible: false
    width: bar.implicitWidth
    height: 400
    minimumWidth: 400
    minimumHeight: 300
    title: "puush-qt"

    Connections {
        target: systemTray

        onSignalOpenSettings: {
            root.show()
            bar.currentIndex = tab
        }
    }

    TabBar {
        id: bar
        x: 0
        y: 0
        width: root.width

        TabButton {
            text: qsTr("General")
        }

        TabButton {
            text: qsTr("Key Bindings")
        }

        TabButton {
            text: qsTr("Account")
            onClicked: account.updateAccountInformation()
        }

        TabButton {
            text: qsTr("Advanced")
        }

        TabButton {
            text: qsTr("About")
        }
    }

    StackLayout {
        id: mainLayout
        width: parent.width
        height: parent.height - bar.height
        currentIndex: bar.currentIndex
        anchors.top: bar.bottom
        clip: true

        General { }

        KeyBindings { }

        Account {
            id: account
        }

        Advanced { }

        About { }
    }

    onClosing: {
        root.hide()
    }
}


AutoTypes {
    imports: [ "import HelperWidgets 2.0", "import QtQuick 2.1", "import QtQuick.Layouts 1.1" ]

    Type {
       typeNames: ["int"]
       sourceFile: "IntEditorTemplate.template"
    }
    Type {
        typeNames: ["real", "double", "qreal"]
        sourceFile: "RealEditorTemplate.template"
    }
    Type {
        typeNames: ["string", "QString"]
        sourceFile: "StringEditorTemplate.template"
    }
    Type {
        typeNames: ["QUrl", "url"]
        sourceFile: "UrlEditorTemplate.template"
    }
    Type {
        typeNames: ["bool", "boolean"]
        sourceFile: "BooleanEditorTemplate.template"
    }
    Type {
        typeNames: ["color", "QColor"]
        sourceFile: "ColorEditorTemplate.template"
    }
}

Change default editor for color

AutoTypes {
    imports: [ "import HelperWidgets 2.0", "import QtQuick 2.1", "import QtQuick.Layouts 1.1" ]

    Type {
       typeNames: ["int"]
       sourceFile: "IntEditorTemplate.template"
    }
    Type {
        typeNames: ["real", "double", "qreal"]
        sourceFile: "RealEditorTemplate.template"
    }
    Type {
        typeNames: ["string", "QString"]
        sourceFile: "StringEditorTemplate.template"
    }
    Type {
        typeNames: ["QUrl", "url"]
        sourceFile: "UrlEditorTemplate.template"
    }
    Type {
        typeNames: ["bool", "boolean"]
        sourceFile: "BooleanEditorTemplate.template"
    }

    Type {
        typeNames: ["color", "QColor"]
        sourceFile: "StringEditorTemplate.template"
    }
}


Create a base/interface for the viewer components

/*
 * Copyright (C) 2015 Dan Leinir Turthra Jensen <admin@leinir.dk>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) version 3, or any
 * later version accepted by the membership of KDE e.V. (or its
 * successor approved by the membership of KDE e.V.), which shall
 * act as a proxy defined in Section 6 of version 3 of the license.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

import QtQuick 2.1
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.0

Item {
    id: root;
    // Fired when the viewer has completed loading the file.
    // Success is true if this was successful, and false otherwise.
    signal loadingCompleted(bool success);
    property string file;
    property int currentIndex;
}


import Qt 4.6

Item {
    id: resizable
    width:400
    height:400

    GraphicsObjectContainer {
        anchors.fill:parent

        QGraphicsWidget {
            size.width:parent.width
            size.height:parent.height

            layout: QGraphicsLinearLayout {
                LayoutItem {
                    minimumSize: "100x100"
                    maximumSize: "300x300"
                    preferredSize: "100x100"
                    Rectangle { color: "yellow"; anchors.fill: parent }
                }
                LayoutItem {
                    minimumSize: "100x100"
                    maximumSize: "400x400"
                    preferredSize: "200x200"
                    Rectangle { color: "green"; anchors.fill: parent }
                }
            }
        }
    }
}

Add import Qt.widgets 4.6 to layout.qml example

import Qt 4.6
import Qt.widgets 4.6
Item {
    id: resizable
    width:400
    height:400

    GraphicsObjectContainer {
        anchors.fill:parent

        QGraphicsWidget {
            size.width:parent.width
            size.height:parent.height

            layout: QGraphicsLinearLayout {
                LayoutItem {
                    minimumSize: "100x100"
                    maximumSize: "300x300"
                    preferredSize: "100x100"
                    Rectangle { color: "yellow"; anchors.fill: parent }
                }
                LayoutItem {
                    minimumSize: "100x100"
                    maximumSize: "400x400"
                    preferredSize: "200x200"
                    Rectangle { color: "green"; anchors.fill: parent }
                }
            }
        }
    }
}