Hello Jérôme, I am trying to understand how you made it possible,
2016-04-26 15:39 GMT+03:00 Jérôme Godbout <jer...@bodycad.com>: > We also have expose those blocking C++ QMessageBox and QDialog for linear > workflow via Q_INVOKABLE from C++ singleton. > I might misunderstand, do you actually using QMessageBox with QML application? or do you mean MessageBox QML type? > This avoid the callback spaghetti mess of Qml Dialog and made the code > more readable. If you have many options to offer to user in particular > sequences of may or may not be requested, the declarative way is a > nightmare. In fact I think we have 0 Qml Dialog into our 5 CAD > applications, but many call to those C++ blocking dialog invoke. > > On Tue, Apr 26, 2016 at 8:34 AM, Jérôme Godbout <jer...@bodycad.com> > wrote: > >> I can tell what we did, we made a FileSystem C++ singleton that expose >> most file system file/url check, we made those check inside Qml javascript >> now. >> > Do you mean instead of sending the user input to FileDialog and checking this url in C++, you directly check if the file exists in QML? > This way you can make callback and GUI logic into Qml. We expect C++ >> function to be call with valid argument all the time. Else we always return >> error (unexpected error, since the Qml code should have validate before >> making the call, this is a developer issue). >> > I am sorry, you return error from what? Side Note: We also have experiment with throw from C++ that get evaluate >> into Qml, it work, but it would be nice to have a proper keyword with throw >> type to indicate this and the exception get transfer to into Q_INVOKABLE. >> Would allow for better error handling. >> >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest