Re: [Development] Make Qt6 JNI API safer to use

2020-03-06 Thread André Pönitz
On Fri, Mar 06, 2020 at 11:59:32AM +, Simon Hausmann wrote: >Hi, > >I think it would be great to have a result type in the Qt API and use >that, instead of C++ exceptions. In theory we could use std::variant, >but I think the API inconvenient for the use-case of a result. That

Re: [Development] Make Qt6 JNI API safer to use

2020-03-06 Thread Fabian Kosmale
Hi Bogdan, first of all, I think improving the JNI error handling is a great idea. However, I'm currently not convinced that we should (unconditionally) require exceptions, or that we really need them. As far as I can tell, the Android NDK still disables exceptions by default, and the last ti

Re: [Development] Make Qt6 JNI API safer to use

2020-03-06 Thread Simon Hausmann
Simon From: Development on behalf of Thiago Macieira Sent: Thursday, March 5, 2020 16:31 To: development@qt-project.org Subject: Re: [Development] Make Qt6 JNI API safer to use On Thursday, 5 March 2020 07:29:07 PST Bogdan Vatra via Development wrote: > În ziua de joi,

Re: [Development] Make Qt6 JNI API safer to use

2020-03-06 Thread Vitaly Fanaskov
Regarding exceptions, I see your point. Personally I agree with using exceptions here. If there are no well justified objections, just go for it. On 3/5/20 4:59 PM, Bogdan Vatra wrote: Hi, În ziua de joi, 5 martie 2020, la 17:14:44 EET, Vitaly Fanaskov a scris: I think something like std::exp

Re: [Development] Make Qt6 JNI API safer to use

2020-03-05 Thread Bogdan Vatra via Development
Hi, În ziua de joi, 5 martie 2020, la 17:14:44 EET, Vitaly Fanaskov a scris: > I think something like std::expected is a nice thing to have. > > There is some experimental implementation of std::expected: > https://github.com/TartanLlama/expected. > That implementation is my favorite, I really

Re: [Development] Make Qt6 JNI API safer to use

2020-03-05 Thread Thiago Macieira
On Thursday, 5 March 2020 07:29:07 PST Bogdan Vatra via Development wrote: > În ziua de joi, 5 martie 2020, la 17:21:11 EET, Thiago Macieira a scris: > > On Thursday, 5 March 2020 07:14:44 PST Vitaly Fanaskov wrote: > > > I think something like std::expected is a nice thing to have. > > > > > > Th

Re: [Development] Make Qt6 JNI API safer to use

2020-03-05 Thread Bogdan Vatra via Development
În ziua de joi, 5 martie 2020, la 17:21:11 EET, Thiago Macieira a scris: > On Thursday, 5 March 2020 07:14:44 PST Vitaly Fanaskov wrote: > > I think something like std::expected is a nice thing to have. > > > > There is some experimental implementation of std::expected: > > https://github.com/Tart

Re: [Development] Make Qt6 JNI API safer to use

2020-03-05 Thread Thiago Macieira
On Thursday, 5 March 2020 07:14:44 PST Vitaly Fanaskov wrote: > I think something like std::expected is a nice thing to have. > > There is some experimental implementation of std::expected: > https://github.com/TartanLlama/expected. > > Another good example is Result > (https://doc.rust-lang.or

Re: [Development] Make Qt6 JNI API safer to use

2020-03-05 Thread Vitaly Fanaskov
I think something like std::expected is a nice thing to have. There is some experimental implementation of std::expected: https://github.com/TartanLlama/expected. Another good example is Result (https://doc.rust-lang.org/std/result/index.html) type from Rust. But might look clumsy in C++, beca

[Development] Make Qt6 JNI API safer to use

2020-03-05 Thread Bogdan Vatra via Development
Hi, I started to review and move androidextras to qtbase (qtbase/src/corelib/ platform/android). Here we have a problem with our Qt JNI API. The problem is that in Java exceptions are (ab)used everywhere. Even if we have a way to check for exceptions after each call in Qt, it's not used (not e