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

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.
  • cybercatalystC Offline
    cybercatalystC Offline
    cybercatalyst
    wrote on 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.

    JKSHJ 1 Reply Last reply
    0
    • cybercatalystC cybercatalyst

      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.

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on 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
      • cybercatalystC Offline
        cybercatalystC Offline
        cybercatalyst
        wrote on 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

        • Login

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