[Kde-bindings] [Bug 145518] New: QtRuby - Qt::GridLayout.new crashes program; QT_NO_LAYOUT Smoke error

Tomi Belan tomi.belan at gmail.com
Wed May 16 16:36:44 UTC 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=145518         
           Summary: QtRuby - Qt::GridLayout.new crashes program;
                    QT_NO_LAYOUT Smoke error
           Product: bindings
           Version: unspecified
          Platform: Mandriva RPMs
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: crash
          Priority: NOR
         Component: general
        AssignedTo: kde-bindings kde org
        ReportedBy: tomi.belan gmail com


Version:           qt4-qtruby-1.4.7 (using KDE KDE 3.5.5)
Installed from:    Mandriva RPMs
Compiler:          gcc version 4.1.2 20070302 (prerelease) (4.1.2-1mdv2007.1) 
OS:                Linux

The QtRuby tutorial at http://www.arachnoid.com/ruby/RubyGUIProject/index.html crashes (with segmentation fault). Fortunately, I found out what causes it:
After debugging the program, I found out that it crashes when calling Qt::GridLayout.new. From QtRuby logs I found out that this function doesn't exist (has no "candidates"). (If needed, I may provide these logs.)
I tried to recompile QtRuby from source (instead of using the RPM) and traced the bug to its source: while configure-ing, Smoke defined QT_NO_LAYOUTS. It was set by smoke/qt/qtguess.pl (auto-generated from qtguess.pl.in). The script tried to compile this program:

#include <QtGui/qlayout.h>
#include <QtCore/qfeatures.h>

class QFoo: public QLayout
{
public:
QFoo() {};
~QFoo() {};
void addItem( QLayoutItem * ) { };
QSize sizeHint() const { return QSize(); }
void setGeometry( const QRect & ) { };
QLayoutItem* itemAt(int) const {return (QLayoutItem*) NULL;}
QLayoutItem* takeAt(int) {return (QLayoutItem*) NULL;}
int QFoo::count() const {return 0;}     <---- this is line 14
};

int main( int argc, char ** argv)
{
QFoo foo;
return 0;
}
(EOF)

Compilation failed with this error:

28982-qtguess.cpp:14: error: extra qualification 'QFoo::' on member 'count'

Obviously, this is just an error in the testing program and Qt layouts work as they should, so QT_NO_LAYOUTS shouldn't be defined.

I think that maybe there are two separate bugs: 1. qtguess.pl(.in) has a wrong testing program for QT_NO_LAYOUTS, 2. QtRuby reacts with segmentation fault when a non-existent function (or just constructor?) is called.



More information about the Kde-bindings mailing list