clipboard

package module
v0.0.0-...-fc22ff6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2015 License: MIT Imports: 4 Imported by: 0

README

Clipboard for Go (go-qml applications)

Uses Qt's facilities to store or load text in/out of the clipboard. This branch utilizes qml.Common to make calls to QClipboard wrapper. This way is a little slower (than master), but code is much cleaner and tends to be safer.

Installation:

See the requirements of go-qml. If they're met and PKG_CONFIG_PATH is set:

$ go get gopkg.in/xlab/clipboard.v2

Platforms:

This clipboard package can be used on all platforms that are supported by go-qml. Requires installed gopkg.in/qml.v1 package (N.B. clipboard.v1 depends on qml.v0 respectively).

Doc:

Additional info:

The package atotto/clipboard might be incompatible with go-qml machinery, see progress on Issue #26. This package utilizes CGO and qml.Common in order to use QApplication::clipboard. Also the benchmarks are better:

BenchmarkReadAll      200000          9770 ns/op
BenchmarkWriteAll      10000        185354 ns/op
ok      github.com/xlab/clipboard.v2   5.079s
BenchmarkReadAll	     100	  20067708 ns/op
BenchmarkWriteAll	     100	  19592142 ns/op
ok  	github.com/atotto/clipboard	4.119s

License is MIT.

Documentation

Overview

Package clipboard uses Qt's facilities to store or load text in/out of system's clipboard

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clipboard

type Clipboard struct {
	// contains filtered or unexported fields
}

func New

func New(engine *qml.Engine) *Clipboard

func (*Clipboard) ReadAll

func (c *Clipboard) ReadAll() (text string, err error)

ReadAll reads string from QApplication::clipboard

func (*Clipboard) WriteAll

func (c *Clipboard) WriteAll(text string) (err error)

WriteAll writes string to QApplication::clipboard

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL