[SailfishDevel] Using Clipboard object

Andrey Kozhevnikov coderusinbox at gmail.com
Thu Dec 19 00:59:21 UTC 2013


Clipboard is global object. You dont need to create it, just use it.
check /usr/lib/qt5/qml/Sailfish/Silica/plugins.qmltypes

On 19.12.2013 02:41, Marko Koschak wrote:
> Hi
>
> I am just wondering how it is possible to copy text into the system
> clipboard by means of the Clipboard object (as described in the Silica
> reference)? When I try something like shown below I get the error:
> [W] unknown:291 -
> file:///opt/sdk/ownKeepass/usr/share/harbour-ownkeepass/cover/CoverPage.qml:291:5: Element is not creatable.
>           Clipboard {
>
> Is this feature simply not implemented or am I missing something?
>
> Background: I want to copy some text of a keepass entry into clipboard
> within the cover page using the swipe gesture on the cover.
>
> Thanks,
> Marko
>
> ---
>
> import QtQuick 2.0
> import Sailfish.Silica 1.0
>
> CoverBackground {
>      id: coverPage
>
>      function copyToClipboard() {
>          systemClipboard.text = "some text"
>      }
>
>      Clipboard {
>          id: systemClipboard
>      }
> }
>
> _______________________________________________
> SailfishOS.org Devel mailing list



More information about the Devel mailing list