Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt5 Support? #131

Closed
goldhoorn opened this issue Nov 17, 2015 · 8 comments
Closed

Qt5 Support? #131

goldhoorn opened this issue Nov 17, 2015 · 8 comments

Comments

@goldhoorn
Copy link

Will there ever be a qt5 version for the ruby-bindingy available?
qt5 got used and more even by system libs.
It not really possible to use a qtbindings which only supports qt4.

I'm only interested if there is a plan to support qt5 from your side?

@ukimi367
Copy link

ukimi367 commented Dec 3, 2015

@goldhoorn: Please see Issue #94 for the answer to this question.
@ryanmelt: I was wondering if you would be willing to add a short writeup to the README about how the Ruby/Qt bindings work in general. I would love to try and compile this against Qt5 as you suggested in Issue #94 but I don't feel that I have the necessary understanding to do so. Thanks!

@ryanmelt
Copy link
Owner

ryanmelt commented Dec 3, 2015

Since development of the upstream qtruby/smoke has ended (at least mostly), I really should reorganize this code into a better understandable manner.

At the high level is a library called Smoke, that reads the qt headers and makes a nice system for introspection that allows for dynamic languages like Ruby to look up methods and figure out which method would be best to call based on the data types passed to the function. The reason Qt5 is not supported is because Smoke does not work with Qt5 (I haven't researched why). There has been a little talk on the kdebindings mailing list about this, but noone has it working yet. I could probably get it working with a couple weeks of full time effort, but as I don't need it for the main reason I created this gem (Ball Aerospace COSMOS - http://cosmosrb.com), that is very unlikely to happen any time soon. As far as I can tell Qt5 is mainly focused on mobile platforms, and QML which I don't personally care too much about. It also has somewhat better Mac OSX support which may eventually justify the effort, but right now I am too busy with paying projects.

Almost all of the qtbindings/qtruby C code is used to "marshal", ie convert ruby datatypes into C++ datatypes and to make the appropriate calls to the C++ library, and then marshal back to ruby data types.

There is also a good amount of ruby code that primarily handles name conflicts between native ruby method names and Qt method names.

@ryanmelt ryanmelt closed this as completed Dec 3, 2015
@ukimi367
Copy link

ukimi367 commented Dec 3, 2015

@ryanmelt Thanks for the information. I wasn't suggesting that you actually do the Qt5 bindings, but the information you provided should be very helpful in getting me started, or at least understanding why Smoke and Qt5 don't play nicely together. By the way, the COSMOS program looks VERY cool! If you don't mind me asking, how did you do the graphs? Did you just use Qt's drawing capabilities? One of the reasons I was interested in Qt5 was because of the Qt Data Visualization module (http://doc.qt.io/QtDataVisualization/index.html) for drawing data plots.

@jmthomas
Copy link
Collaborator

jmthomas commented Dec 4, 2015

We just used the basic QT 4.8 methods to do all our graphing. It looks like the Qt Data Visualization module is all about 3D. Some of their plots are really cool. We do have support for OpenGL in COSMOS. Once you install it you can double click OpenGLBuilder.bat (on Windows) to see how it works.

@CeesZ
Copy link

CeesZ commented Jul 11, 2016

@ryanmelt: I looked again at the possibilities for Ruby bindings for Qt5. As far as I understand from the kde-bindings mailinglist, the problems with Qt5 and Smoke have not been resolved. Smoke was used to generate bindings for both Ruby and Python and on the Python side Smoke seems to have been abandoned for an alternative approach. It is not clear to me if this could also be used as the basis for Qt5 Ruby bindings. There is a separate GitHub project kitech/ruby-jit-qt aimed at Qt5 Ruby bindings using cllang/llvm, but this is still in an experimental stage and it uses a different class naming convention than Qt4. The alternative approach of using JRuby, qt_connect and QtJambi (the Java version of the Qt library) offers no solution, as QtJambi has not been developed beyond Qt 4.8.
For most existing Qt based applications, there is not an enormous need to move over to Qt5. The possible exceptions are applications using Qt-Webkit which has developed a lot further since the last Qt 4.8 release (from Qt-5.5 WebKit has been deprecated and replaced by the chromium-based QtWebEngine module).
As an interim solution I have tried to compile Qt-4.8.7 with a newer release of QtWebKit-2.3.4, which supports more features and has less security issues. (the official release comes with WebKit-2.2.4).
On Windows I followed these instructions and managed to build a working version of Qt with the updated webkit. However this uses VS2012; any attempts to build a MINGW version on windows have failed with missing 'generated' files. If anybody has been more successful with this process on Windows I would appreciate any feedback. Also if there is more information on Qt5 and Ruby, I would be interested.

@areman
Copy link

areman commented Jun 6, 2018

Hello guys,
I'm very interested in a QT5 support. The qt bindings are a smart way for easy UI development. Great project !! I'm facing the problem of the outdated QT4 support in the most Linux Distribution. I found out that there are Smoke sources available for QT 5.2. I ask myself, if it's possible to make the qt bindings works with new smoke qt sources ??
@ryanmelt do you think it's possible ?
@CeesZ Have you found a solution ? Have you new information you would like to share ?

Thanks in advance,
André

@CeesZ
Copy link

CeesZ commented Jun 10, 2018

Hi Andre,
I'm afraid I didn't get much further with Qt5 bindings or integrating a newer version of QtWebKit in Qt-4.8.
Last february I contacted Chris Burel who did a lot of work on smokegen and PerlQt5. He kindly pointed me to his work in progress smoke git repo (https://github.com/chrisburel/smokegen) and the accompanying smokeqt repo (https://github.com/chrisburel/smokeqt). This version uses LLVM to parse the c++ headers. He managed to build smokeqt against Qt5 on Windows and Linux. He suggested to get the old QtRuby source to build against the newer smokeqt5 libraries and since the Smoke API hasn't changed, this might just work. I have tried to build these for my Windows/mingw platform but failed, probably mostly because of my inexperience with clang, llvm, c++ etc. Maybe others are more successful; give it a try!
If Qt5Ruby support does become available, please note that starting from Qt 5.6 the WebKit classes are removed from the distribution and are replaced with the WebEngine classes. However the QtWebKit reboot project (https://github.com/annulen/webkit/releases) provides prebuilt packages with updated WebKit versions. It would be interesting to include these in any new qt5bindings.

Cees

@areman
Copy link

areman commented Jun 13, 2018

Dear @CeesZ,
thanks for the feedback !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants