Bug 145518 - QtRuby - Qt::GridLayout.new crashes program; QT_NO_LAYOUT Smoke error
Summary: QtRuby - Qt::GridLayout.new crashes program; QT_NO_LAYOUT Smoke error
Status: RESOLVED FIXED
Alias: None
Product: bindings
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Mandriva RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: kde-bindings
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-16 18:36 UTC by Tomi Belan
Modified: 2009-11-02 11:01 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
proposed patch for qtguess.pl.in (138 bytes, patch)
2007-05-16 18:41 UTC, Tomi Belan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomi Belan 2007-05-16 18:36:43 UTC
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.
Comment 1 Tomi Belan 2007-05-16 18:41:56 UTC
Created attachment 20597 [details]
proposed patch for qtguess.pl.in
Comment 2 Richard Dale 2007-05-16 20:46:05 UTC
On Wednesday 16 May 2007, Tomi Belan wrote:
[bugs.kde.org quoted mail]
The configure check has already been fixed in the KDE svn version of QtRuby, 
and so it will be in the next release. I'm not sure why it doesn't give an 
error message for the call to the missing constructor though.

-- Richard
Comment 3 Nicolas L. 2009-11-02 11:01:52 UTC
regarding comment #2 i close this as fixed

Please reopen if still valid