Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Announcements
  4. Use ruby seamlessly in your C++/Qt applications
QtWS25 Last Chance

Use ruby seamlessly in your C++/Qt applications

Scheduled Pinned Locked Moved Announcements
3 Posts 2 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cybercatalyst
    wrote on 10 Jun 2015, 21:54 last edited by
    #1

    Execute ruby code seamlessly from within C++/Qt applications with the QtRuby pod:

    // Qt includes
    #include <QCoreApplication>
    
    // QtRuby includes
    #include "qruby.h"
    #include "qrubyvalue.h"
    
    int main(int argc, char *argv[]) {
        QCoreApplication app(argc, argv);
        Q_UNUSED(app);
    
        QRuby rb;
        rb.printVersion();
        rb.evaluate("(1..10).each do |n| puts n end");
    
        return 0;
    }
    

    https://github.com/cybercatalyst/qtruby

    This is in early stage and uses the ruby native extension API to interface the ruby interpreter to be used to execute ruby code in your C++/Qt application. As time goes on, I plan to improve the integration more.

    J 1 Reply Last reply 11 Jun 2015, 02:12
    0
    • C cybercatalyst
      10 Jun 2015, 21:54

      Execute ruby code seamlessly from within C++/Qt applications with the QtRuby pod:

      // Qt includes
      #include <QCoreApplication>
      
      // QtRuby includes
      #include "qruby.h"
      #include "qrubyvalue.h"
      
      int main(int argc, char *argv[]) {
          QCoreApplication app(argc, argv);
          Q_UNUSED(app);
      
          QRuby rb;
          rb.printVersion();
          rb.evaluate("(1..10).each do |n| puts n end");
      
          return 0;
      }
      

      https://github.com/cybercatalyst/qtruby

      This is in early stage and uses the ruby native extension API to interface the ruby interpreter to be used to execute ruby code in your C++/Qt application. As time goes on, I plan to improve the integration more.

      J Offline
      J Offline
      JKSH
      Moderators
      wrote on 11 Jun 2015, 02:12 last edited by
      #2

      Hi @cybercatalyst, this looks useful. Thanks for sharing!

      I'd like to point out though, that the name "QtRuby" is already taken: https://techbase.kde.org/Development/Languages/Ruby

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cybercatalyst
        wrote on 11 Jun 2015, 05:15 last edited by
        #3

        Yes, I knew of the existence of QtRuby, but actually I think that the usage of the "QtRuby"-name in the QtRuby you pointed to is not justified. Usually QtXX is used where XX is something that is being made available in Qt. Language bindings start with the name in front, for example PythonQt, so it should be called RubyQt.

        That's why I insisted on using the name QtRuby, well aware of the name clash.

        1 Reply Last reply
        0

        1/3

        10 Jun 2015, 21:54

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved