Showing the changes to plugins/JSAPIExample/src/JSAPIExample.cpp (1 of 220 files). Show all
Unified · Split
| @@ -77,7 +77,7 @@ namespace REPLACE_ME_WITH_UNIQUE_NAME { · 76 unmodified lines | |||
| 77 | // (note: Qt script engines automatically look for a ".toString" method on native classes when coercing values to strings) | 77 | // (note: Qt script engines automatically look for a ".toString" method on native classes when coercing values to strings) |
| 78 | QString toString() const { return QString("[%1 version=%2]").arg(objectName()).arg(_version); } | 78 | QString toString() const { return QString("[%1 version=%2]").arg(objectName()).arg(_version); } |
| 79 | 79 | ||
| 80 | /**jsdoc | 80 | /*@jsdoc |
| 81 | * Returns current microseconds (usecs) since Epoch. note: 1000usecs == 1ms | 81 | * Returns current microseconds (usecs) since Epoch. note: 1000usecs == 1ms |
| 82 | * @example <caption>Measure current setTimeout accuracy.</caption> | 82 | * @example <caption>Measure current setTimeout accuracy.</caption> |
| 83 | * var expected = 1000; | 83 | * var expected = 1000; |
| @@ -89,7 +89,7 @@ namespace REPLACE_ME_WITH_UNIQUE_NAME { · 5 unmodified lines | |||
| 89 | */ | 89 | */ |
| 90 | QVariant now() const { return usecTimestampNow(); } | 90 | QVariant now() const { return usecTimestampNow(); } |
| 91 | 91 | ||
| 92 | /**jsdoc | 92 | /*@jsdoc |
| 93 | * Example of returning a JS Object key-value map | 93 | * Example of returning a JS Object key-value map |
| 94 | * @example <caption>"zip" a list of keys and corresponding values to form key-value map</caption> | 94 | * @example <caption>"zip" a list of keys and corresponding values to form key-value map</caption> |
| 95 | * print(JSON.stringify(JSAPIExample.zip(["a","b"], [1,2])); // { "a": 1, "b": 2 } | 95 | * print(JSON.stringify(JSAPIExample.zip(["a","b"], [1,2])); // { "a": 1, "b": 2 } |
| @@ -102,7 +102,7 @@ namespace REPLACE_ME_WITH_UNIQUE_NAME { · 6 unmodified lines | |||
| 102 | return out; | 102 | return out; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | /**jsdoc | 105 | /*@jsdoc |
| 106 | * Example of returning a JS Array result | 106 | * Example of returning a JS Array result |
| 107 | * @example <caption>emulate Object.values(keyValues)</caption> | 107 | * @example <caption>emulate Object.values(keyValues)</caption> |
| 108 | * print(JSON.stringify(JSAPIExample.values({ "a": 1, "b": 2 }))); // [1,2] | 108 | * print(JSON.stringify(JSAPIExample.values({ "a": 1, "b": 2 }))); // [1,2] |
| @@ -112,7 +112,7 @@ namespace REPLACE_ME_WITH_UNIQUE_NAME { · 3 unmodified lines | |||
| 112 | return values; | 112 | return values; |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | /**jsdoc | 115 | /*@jsdoc |
| 116 | * Another example of returning JS Array data | 116 | * Another example of returning JS Array data |
| 117 | * @example <caption>generate an integer sequence (inclusive of [from, to])</caption> | 117 | * @example <caption>generate an integer sequence (inclusive of [from, to])</caption> |
| 118 | * print(JSON.stringify(JSAPIExample.seq(1,5)));// [1,2,3,4,5] | 118 | * print(JSON.stringify(JSAPIExample.seq(1,5)));// [1,2,3,4,5] |
| @@ -125,7 +125,7 @@ namespace REPLACE_ME_WITH_UNIQUE_NAME { · 6 unmodified lines | |||
| 125 | return out; | 125 | return out; |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | /**jsdoc | 128 | /*@jsdoc |
| 129 | * Example of returning arbitrary binary data from C++ (resulting in a JS ArrayBuffer) | 129 | * Example of returning arbitrary binary data from C++ (resulting in a JS ArrayBuffer) |
| 130 | * see also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer#Examples | 130 | * see also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer#Examples |
| 131 | * @example <caption>return compressed/decompressed versions of the input data</caption> | 131 | * @example <caption>return compressed/decompressed versions of the input data</caption> |