[Kde-bindings] Listing possible candidates for a method

Chris Burel chrisburel at gmail.com
Thu Aug 6 23:56:21 UTC 2009


I'm trying to write some error reporting that will list all possible
candidates of a function if called with invalid arguments.  For
instance, calling (in Perl)
my $widget = Qt::Widget( 'with', 'invalid', 'arguments);

Would print:
--- Arguments for method call QWidget::QWidget did not match any known
C++ method signature, called at foo.pl line 10
Method call was:
        QWidget::QWidget( with, invalid, arguments )
Possible candidates:
        QWidget::QWidget(  )
        QWidget::QWidget( QWidget* )
        QWidget::QWidget( QWidget*, Qt::WindowFlags )

Now, the only way I know to get a methodId from Smoke is with the
munged method name.  So to generate the list of possible methods, I
have to permute $, ?, and #, and do the method lookup for each one,
and see what method ids are valid.  Take into account that there are
up to 14 arguments for a single method ( I looked in the smokedata.cpp
to get that info ), you get upwards of 1,000,000 combinations to do
the complete search.

Is there an easy way to say, give me all method ids from class x and
method x, regardless of the munged methodname?



More information about the Kde-bindings mailing list