-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathUtils.txt
46 lines (38 loc) · 2.55 KB
/
Utils.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
utils регестрируется в javascript по имени utils
Q_INVOKABLE void qtOpenInBrowser(const QString &url, const QString &callback);
# Opens link in default browser
# After the operation is completed, it calls function
callback("Ok", errorNum, errorMessage)
Q_INVOKABLE void openFolderDialog(QString beginPath, QString caption, const QString &callback);
# Shows to user the dialog box providing the ability to select a directory.
beginPath # initial directory location
caption # name of the dialog box
# After the operation is completed, it calls function
callback(dir, errorNum, errorMessage)
Q_INVOKABLE void openFileDialog(const QString &beginPath, const QString &caption, const QString &filters, const QString &callback);
# Shows to user the dialog box providing the ability to select a existing file.
beginPath # initial directory location
caption # name of the dialog box
# After the operation is completed, it calls function
callback(file, errorNum, errorMessage)
Q_INVOKABLE void saveFileFromUrl2(const QString &url, const QString &saveFileWindowCaption, bool openAfterSave, const QString &filePath, const QString &callback);
# Shows file save dialog, then downloads the file and saves it.
# After the operation is completed, it calls function
# Отличие от аналогичной функции в mainWindows в том, что вместо относительного пути fileName нужно задавать абсолютный путь filePath
callback("Ok", errorNum, errorMessage)
Q_INVOKABLE void chooseFileAndLoad(const QString &openFileWindowCaption, const QString &filePath, const QString &filters, const QString &callback);
# Shows the file selection dialog, then encodes the selected file in base64 and sends it to the function
# Отличие от аналогичной функции в mainWindows в том, что вместо относительного пути fileName нужно задавать абсолютный путь filePath
callback(pathToFile, result, errorNum, errorMessage)
Q_INVOKABLE void onQrEncode(const QString &textHex, const QString &callback);
# Encodes text to qr code
# Result returns to the function:
callback(result, errorNum, errorMessage);
# where result is a png image in base64
Q_INVOKABLE void qrDecode(const QString &imageBase64, const QString &callback);
# Decodes text from qr code
# Result returns to the function:
callback(requestId, result);
# where result is a text in base16
Q_INVOKABLE void javascriptLog(const QString &message);
# Записать в лог сообщение от javascript