QtRuby 1.4.6

URIS

http://rubyforge.org/projects/korundum/
http://developer.kde.org/language-bindings/ruby/index.html

NAME

QtRuby 1.4.6

SYNOPSIS

Ruby bindings for the Qt4 GUI apis

DESCRIPTION

Highlights from the QtRuby ChangeLog since release 1.4.5

  • Support for Qt 4.2 with over 80 new classes

  • Added the rbrcc Ruby resource compiler tool

  • Optional support for the QtDbus classes

  • Optional support for the Qwt plotting library

  • Properties can be set and got with ‘myinstance.prop’ or
    ‘myinstance.prop = val’, even if the class isn’t in the
    Smoke library

  • More examples added, and bugs in existing ones fixed

  • Slots and signals can have return types and values

CONFIG

See the qtruby/INSTALL file for details of configuration, building
and installation.

BUILDING ON WINDOWS

  • The smoke library can be built on windows by manually editing
    qtguess.pl.in and generate.pl.in (automake doesn’t work with
    qtruby on Windows). Run ‘perl qtguess.pl’ to for the configure
    tests. Then run ‘perl generate.pl’ to generate the Smoke sources,
    and build with qmake. Use extconf.rb and qmake to build the
    qtruby extension and rbuic tool.

ENVIRONMENTS

Linux, BSD*, Unix etc
Mac OS X, Windows

AUTHORS

Richard Dale with Caleb T., Alexander Kellett and others

[email protected] wrote:

NAME
QtRuby 1.4.6
SYNOPSIS
Ruby bindings for the Qt4 GUI apis
BUILDING ON WINDOWS

Is this for real ?? yes, yes? yes?

May I hug you all guys?

cheers

Simon

Simon Kröger wrote:

cheers

Simon
Well yes it should build on Windows (the previous 1.4.5 release did),
but it isn’t easy which is why I added the explanation. I haven’t tried
building this 1.4.6 release with Qt 4.2 on Windows, and it still needs
to be packaged as a binary (gem?), and there is a memory corruption bug
on Windows which doesn’t seem to affect Linux or Mac OS X so much. But
it is finally getting near a production quality release - maybe by
1.4.7 or 1.4.8. This is the first one I thought was worth announcing on
ruby-talk.

– Richard

  • Support for Qt 4.2 with over 80 new classes

Dear QtRuby developers!

I am new to QtRuby and I am not a C++ developer, so please forgive me if
this is a very stupid question :wink: I tried to find the answer in this
forum and elsewhere, but without result.

I have successfully installed QT 4.2 in /Developer/qt/ on my OSX
(PowerPC) machine using:

./configure -system-zlib -qt-gif -qt-libpng -debug -no-stl
-no-exceptions -fast -no-framework -prefix /Developer/q
t

All example QT apps work fine.

Now I tried to configure QtRuby 1.4.6 using:
./configure --enable-mac --with-qt-dir=/Developer/qt
–with-qt-includes=/Developer/qt/include --with-qt-libraries=
/Developer/qt/lib

But this always results in:

checking for Qt… configure: error: Qt (>= Qt 4.1) (library qt) not
found. Please check your installation (and make sure you compiled
Qt with -debug - doing symlinks to a -release build of Qt4 will
introduce breakage, do not do that -)!

Who knows how to deal with this ? What can I do ? Any suggestions ?
I would be very happy to get this going …

Thanks!

Ma Br wrote:

But this always results in:

checking for Qt… configure: error: Qt (>= Qt 4.1) (library qt) not
found. Please check your installation (and make sure you compiled
Qt with -debug - doing symlinks to a -release build of Qt4 will
introduce breakage, do not do that -)!

Who knows how to deal with this ? What can I do ? Any suggestions ?
I would be very happy to get this going …
You could try setting your $QTDIR environment variable to
‘/Developer/qt’ - that might help. Have a look at the discussions on
the help forum on the RubyForge Korundum site about building on Mac OS
X if you’re still stuck:

http://rubyforge.org/forum/forum.php?forum_id=723

The main problem is that autoconf/automake don’t work well on Mac OS X
and you may need to use qmake and ruby extconf instead.

– Richard

Thanks Richard for your suggestions;

You could try setting your $QTDIR environment variable to
‘/Developer/qt’ - that might help.

I did this now, but this changed nothing. Still QT 4.2 isn’t found.

A somewhat old message here
(http://rubyforge.org/forum/forum.php?thread_id=7451&forum_id=723) tells
me that 4.2 was not working … dunno whether this has changed? Do you
run QT4.2 ?

Have a look at the discussions on
the help forum on the RubyForge Korundum site about building on Mac OS
X if you’re still stuck:

I did look around of course, but all these messages mostly don’t find a
solution for this problem. For some people on the other hand it seems
to work anyway ?!

The main problem is that autoconf/automake don’t work well on Mac OS X
and you may need to use qmake and ruby extconf instead.

Any directions to look for ? As I said, I have not
C++/make/automake/qmake/whatsoever background - sorry!

Thanks for any further direction …
Best regards!

A somewhat old message here
(http://rubyforge.org/forum/forum.php?thread_id=7451&forum_id=723) tells

Sorry, wrong link; I ment this one:
http://rubyforge.org/forum/forum.php?thread_id=8396&forum_id=723

./configure -system-zlib -qt-gif -qt-libpng -debug -no-stl
-no-exceptions -fast -no-framework -prefix /Developer/qt

Wohoooo … following Richards suggestion from #qtruby on freenode I
tried to compile QT without the prefix - what can I say - the qtruby
configure now finds QT without any problems (though there is another new
problem now - see below)

So, I compiled it without the -prefix and installed QT in
/usr/local/Trolltech/Qt-4.2.0/

A subsequent “./configure --enable-mac” for QtRuby followed:

checking for Qt… libraries /usr/local/Trolltech/Qt-4.2.0/lib, headers
/usr/local/Trolltech/Qt-4.2.0/include

Nice and excellent so far - thanks for the hint Richard, though I don’t
really understand why the config script was not detecting QT at the old
place /Developer/qt, even though I tried to tell it with-qt-dir= …

However - NEW PROBLEM:

  1. my output of configure: http://pastebin.ca/204840 (I was trying this
    with and without the smoke lib definition)

  2. my problem once I try to run make: http://pastebin.ca/204841

Any idea(s) ??? Thanks so much !

Ma Br wrote:

But this always results in:

checking for Qt… configure: error: Qt (>= Qt 4.1) (library qt) not
found. Please check your installation (and make sure you compiled
Qt with -debug - doing symlinks to a -release build of Qt4 will
introduce breakage, do not do that -)!

Who knows how to deal with this ? What can I do ? Any suggestions ?
I would be very happy to get this going …
You could try setting your $QTDIR environment variable to
‘/Developer/qt’ - that might help. Have a look at the discussions on
the help forum on the RubyForge Korundum site about building on Mac OS
X if you’re still stuck:

http://rubyforge.org/forum/forum.php?forum_id=723

The main problem is that autoconf/automake don’t work well on Mac OS X
and you may need to use qmake and ruby extconf instead.

– Richard

Ma Br wrote:

======================

  1. my output of configure: http://pastebin.ca/204840 (I was trying this
    with and without the smoke lib definition)
    That’s all ok, and normal
  1. my problem once I try to run make: http://pastebin.ca/204841

Any idea(s) ??? Thanks so much !
I really need to do a new release of QtRuby for Qt 4.2, as I’ve fixed a
few things like this problem. Here are the diffs made to ‘kalyptus’,
the tool that generates the Smoke library since the last release:

mardigras rdale 133% svn diff -r537751:580685 kalyptus
Index: kalyptus

— kalyptus (revision 537751)
+++ kalyptus (revision 580685)
@@ -459,6 +459,8 @@
next;
}
# Hack, waiting for real handling of preprocessor
defines

  •           $p =~ s/Q_REQUIRED_RESULT//;
    
  •           $p =~ s/QT_ASCII_CAST_WARN//;
              $p =~ s/QT_BEGIN_HEADER//;
              $p =~ s/QT_END_HEADER//;
              $p =~ s/QT_MODULE\(\w+\)//;
    

@@ -466,6 +468,7 @@
$p =~ s/QT_WEAK_SYMBOL//;
$p =~ s/QT_MOC_COMPAT//;
$p =~ s/Q_EXPORT_CODECS_BIG5//;

  •           $p =~ s/Q_DECL_DEPRECATED//;
              $p =~ s/QT_COMPAT / /;
              $p =~ s/Q_DISABLE_COPY\((\w+)\)/$1(const $1 &);\n$1
    

&operator=(const $1 &);/;
$p =~ s/QWIDGETSIZE_MAX/32767/; # Qt/E uses this
#define as an enum value - yuck!
@@ -493,6 +496,8 @@
$p =~ s/KDOM_FORWARDPUT/bool putforward();/;
$p =~ s/KDOM_BASECLASS/virtual KJS::Value cache();/;
$p =~ s/KDOM_CAST/KJS::Value cast();/;

  •           $p =~ s/Q_DECLARE_BUILTIN_METATYPE[^\)]*\)//;
    
  •           $p =~ s/Q_[A-Z]+_EXPORT_INLINE//;
              if ( $p =~ m/KDOM_DEFINE_PROTOTYPE\((\w+)\)/ ) {
                      push @inputqueue, split('\n',"namespace KDOM
    

{\nclass $1 {\n};\n};");
}
@@ -522,6 +527,8 @@
|| $p =~
/^\sQ_DECLARE_TYPEINFO/
|| $p =~
/^\s
Q_PRIVATE_SLOT/
|| $p =~
/^\s*Q_DECLARE_SHARED/

  •                                           || $p =~
    

/^\s*Q_DECLARE_INTERFACE/

  •                                           || $p =~
    

/^\s*Q_DECLARE_METATYPE/
);

            push @includes_list, $1 if $p =~

/^#include\s+<?(.?)>?\s$/;
@@ -569,8 +576,10 @@
$p =~ m/^#\sifdef\s+Q_MOC_RUN/ or
$p =~
m/^#\s
if\s+defined\s*(QT3_SUPPORT/ or
$p =~
m/^#\sif\s+defined\s(qdoc/ or

  •                                $p =~ m/^#\s*ifdef\s+qdoc/ or
                                   $p =~
    

m/^#\sifndef\s+QT_NO_MEMBER_TEMPLATES/ or
$p =~
m/^#if\s
!defined(Q_NO_USING_KEYWORD)/ or

  •                                $p =~
    

m/^#if\sdefined(Q_INTERNAL_QAPP_SRC)/ or
($p =~
m/^#if\s
QT_VERSION\s*<\s0x040000/ and $qt4) or
&$match_qt_defines( $p ) or
$p =~ m/^#\s
if\s+0\s+/ ) {

If that doesn’t fix it, you may need to get the current versions of
‘kalyptus’ and ‘kalyptusCxxToSmoke.pm’ from the kde svn. Or remove the
‘qcursor.h’ header from smoke/qt/header_list and just leave out the
Qt::Cursor class for now.

– Richard

If that doesn’t fix it, you may need to get the current versions of
‘kalyptus’ and ‘kalyptusCxxToSmoke.pm’ from the kde svn. Or remove the
‘qcursor.h’ header from smoke/qt/header_list and just leave out the
Qt::Cursor class for now.

Thanks for all your help Richard!

It works now and I have summarized the installation of QT 4.2 and
qt4-ruby 1.4.6 on a Mac here: http://www.markus.brosch.net/?p=110

Thanks again and best regards!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs