Fluid
Loading...
Searching...
No Matches
clipboard.h
Go to the documentation of this file.
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2018 Michael Spencer <sonrisesoftware@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
7 *
8 * This Source Code Form is subject to the terms of the Mozilla Public
9 * License, v. 2.0. If a copy of the MPL was not distributed with this
10 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 *
12 * $END_LICENSE$
13 */
14
15#pragma once
16
17#include <QObject>
18#include <QClipboard>
19#include <QtQml/qqmlregistration.h>
20
24class Clipboard : public QObject
25{
26 Q_OBJECT
27 Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
28 QML_ELEMENT
29public:
30 explicit Clipboard(QObject *parent = nullptr);
31
35 QString text() const;
36
40 Q_INVOKABLE void clear();
41
42public Q_SLOTS:
43 void setText(const QString &text);
44
45Q_SIGNALS:
47
48private:
49 QClipboard *m_clipboard = nullptr;
50};
51
Clipboard.
Definition clipboard.h:25
Q_INVOKABLE void clear()
Definition clipboard.cpp:37
void textChanged()
void setText(const QString &text)
Definition clipboard.cpp:32
QString text
Definition clipboard.h:27