mirror of
https://github.com/oxen-io/lokinet-control-panel.git
synced 2023-12-14 05:53:00 +01:00
26 lines
537 B
C++
26 lines
537 B
C++
#ifndef QMLCLIPBOARDADAPTER_H
|
|
#define QMLCLIPBOARDADAPTER_H
|
|
|
|
#include <QClipboard>
|
|
#include <QObject>
|
|
|
|
/**
|
|
* A helper class that allows cliboard access in QML.
|
|
*
|
|
* Source: Rüdiger Gad provided this code on his blog:
|
|
* https://ruedigergad.com/2011/08/06/qml-and-clipboard-interaction/
|
|
*/
|
|
class QmlClipboardAdapter : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit QmlClipboardAdapter(QObject *parent = 0);
|
|
|
|
Q_INVOKABLE void setText(QString text);
|
|
|
|
private:
|
|
QClipboard *clipboard;
|
|
};
|
|
|
|
#endif // QMLCLIPBOARDADAPTER_H
|