handle international utf8 text when copying to the clipboard resolves issue #25
This commit is contained in:
parent
c024f45348
commit
fddd407504
2 changed files with 5 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
Reference in a new issue