handle international utf8 text when copying to the clipboard resolves issue #25

This commit is contained in:
Morgan McMillian 2019-10-13 16:32:36 -07:00
parent c024f45348
commit fddd407504
2 changed files with 5 additions and 3 deletions

View file

@ -106,11 +106,13 @@ QString ApplicationUI::appversion()
return appinfo.version();
}
void ApplicationUI::copyText(QByteArray text)
void ApplicationUI::copyText(QString text)
{
bb::system::Clipboard clipboard;
clipboard.clear();
clipboard.insert("text/plain", text);
QByteArray textstr;
textstr.append(text.toUtf8());
clipboard.insert("text/plain", textstr);
}
void ApplicationUI::onInvoke(const bb::system::InvokeRequest& request)

View file

@ -47,7 +47,7 @@ public:
Q_INVOKABLE QVariant setting(const QString &key);
Q_INVOKABLE void setSetting(const QString &key, const QString &value);
Q_INVOKABLE QString appversion();
Q_INVOKABLE void copyText(QByteArray text);
Q_INVOKABLE void copyText(QString text);
Q_INVOKABLE void showImage(const QString &filename);
Q_SIGNALS: