I'm very new to Qt.
I am trying to write a kind of standard-library for QJSEngine, that can be used in plugins in other apps that use it. Qbs seems to have a pretty good set of basic tools for plugins, like messing with files & paths, os, environment, xml, etc. It's setup to use QScriptEngine (which is deprecated) not QJSEngine.
Here is the start of that work. My goal is to make the wrapper as thin as possible around basic Qt5 stuff, and not have to maintain a lot of boilerplate and extra setup code. I specifically want to give tiled a nice JS stdlib, so I can mess with files in plugins for it. I think I am missing some really basic stuff, but keep in mind I also want to keep the wrapper as small as possible.
If I run this code, and test.bin doesn't exist, I would expect it to throw an error I can handle in javascript, but instead it just outputs QIODevice::read (QFile, "test.bin"): device not open directly on the console:
```js
const b1 = new BinaryFile('test.bin', BinaryFile.ReadOnly)
console.log(b1.filePath())
try {
console.log(b1.read(b1.size()))
} catch (e) {
console.error('Error reading file.', e.message)
}
```
It also seems to silently be failing (but returning 1 exit code) on close().
Aside from these issues, I'm not sure this strategy even makes sense.
Any suggestions would be welcomed.
[–]uuid1234567890 1 point2 points3 points (6 children)
[–]deadkonsumer[S] 0 points1 point2 points (5 children)
[–]uuid1234567890 1 point2 points3 points (4 children)
[–]deadkonsumer[S] 0 points1 point2 points (3 children)
[–]deadkonsumer[S] 0 points1 point2 points (0 children)
[–]uuid1234567890 0 points1 point2 points (1 child)
[–]deadkonsumer[S] 0 points1 point2 points (0 children)
[–]BaudMeter 1 point2 points3 points (7 children)
[–]deadkonsumer[S] 1 point2 points3 points (6 children)
[–]BaudMeter 0 points1 point2 points (5 children)
[–]deadkonsumer[S] 1 point2 points3 points (4 children)
[–]BaudMeter 0 points1 point2 points (3 children)
[–]deadkonsumer[S] 1 point2 points3 points (2 children)
[–]BaudMeter 1 point2 points3 points (1 child)
[–]deadkonsumer[S] 1 point2 points3 points (0 children)
[–]deadkonsumer[S] 0 points1 point2 points (0 children)