javac++qtcross-platformjavafx-2

JavaFX 2.0 and Qt for cross-platform application


I need a bit of advice from you developers who deal with cross-platform applications (specifically programs with a GUI).

I will be creating an application soon that needs to be cross-platform and so I have done some preliminary research on two different frameworks: JavaFX 2.0 and Qt.

Honestly, both would more than suit my needs. So then I asked myself why I would choose one over the other (SPOILER ALERT: I don't know the answer :P ). I do know that JavaFX 2.0 is rather new (as of 2012) and is not fully supported across platforms, but it will be eventually.

The question I pose is this: which one of these would you use for a cross-platform application, and what criteria did you look at when making that decision?

Thank you for taking the time to read this! :)

EDIT: For your reference when considering this question, the application I will be writing involves reading/writing XML files, displaying images, and creating some small widgets with custom functionality. I've written a similar application in C# with .NET, but would like advice when considering JavaFX 2.0 or Qt for cross-platform usability.

Thanks again! :)


Solution

  • It's the old question: stability vs bleeding edge. I'll try to give you some personal insights based on your application features.

    JavaFX 2.0 is rather new (as of 2012) and is not fully supported across platforms

    Well, it's fully supported on Linux, Windows and Mac. I can say that because I'm developing a JavaFX 2.2 application in Mac which the server runs on a Linux box and the clients on Windows boxes.

    Reading/writing XML files

    I'm yet to see some tool/interface better/easier/faster than sax2 to parse XML. Of course QtXMLPatterns module parser deservers respect but they are even developing a SAX2 based XML parser (Which by the way is not complete and not fully compatible with legacy SAX1 methods) so I would say that add JavaFX 2 some score.

    Displaying images

    Both technologies can display images with enough ease, but JavaFX 2.2 lacks some tools for image manipulation (Specially format codecs). If image processing is a critical matter, I would say that Qt is slight up ahead in the fight.

    creating some small widgets with custom functionality.

    As of now, this is not an easy task in JavaFX 2 since the Stage object does not have an option like ALWAYS_ON_TOP and won't have until 3.0 (Somewhere in 2013) It's not impossible tough, but Qt already has some nice tools for customize/display/handle widgets that we simply can not reproduce in JavaFX.

    which one of these would you use for a cross-platform application, and what criteria did you look at when making that decision?

    Well, JavaFX 2.2 is made of and for Java. I personally find to program in Java a lot better and easy than C++. You'll never have to struggle with pointers in java, you can always rely on the Garbage Collector for memory management, there are a plenty of tutorials and documentation across the web (which I believe surpasses C++) and an always growing Java Gurus community.

    In abstract, I've choose JavaFX 2.2 because it's pretty, because it's cool, because I can handle the MVC more easily and because I love Java, but I believe you should go for Qt if the widget part of your application is the main purpose of it.

    I hope it helped, cheers