John Levon wrote:

> On Sat, Dec 07, 2002 at 05:16:53PM +0100, Alfredo Braunstein wrote:
> 
>> When using the math panel, the following run time error appears:
>> 
>> 
--------------------------------------------------------------------------
>> QObject::connect: No such signal IconPalette::button_clicked(string
>> const&)
>> QObject::connect:  (sender name:   'unnamed')
>> QObject::connect:  (receiver name: 'QMathDialogBase')
>> 
--------------------------------------------------------------------------
>> 
>> And inserting symbols and delimiters from the panel just does nothing.
>> 
>> Following indications found in lyx-devel/src/frontends/qt2/README, I've
>> changed "something const &" to "const something &" while using SLOT and
>> SIGNAL on two different files, and now works ok for me.
>> 
>> Trivial patch attached. Btw, is it my particular setup that gives these
>> problems, or is it general?
> 
> What Qt version ? The patch doesn't make any sense because the signal is

qt-3.0.5. Wouldn't know if it makes sense, but I believe you. The only think 
I want to add is that it works (no more run-time error, insertion of 
symbols work as expected)

> :
> 
>      38 signals:
>      39         void button_clicked(string const &);
> 

Aren't 'string const &' and 'const string &' equivalent C++-wise? Sorry 
about my ignorance.

> Can you please check moc/iconpalette_moc.C for button_clicked and show
> us what the code looks like ?

Is this enough?

$ grep -A2 -B2 button_clicked iconpalette_moc.C
----------------------------------------------------------------
         { 0, &static_QUType_ptr, "const string&", QUParameter::In }
    };
    static const QUMethod signal_0 = {"button_clicked", 1, param_signal_0 };
    static const QMetaData signal_tbl[] = {
        { "button_clicked(const string&)", &signal_0, QMetaData::Public }
    };
    metaObj = QMetaObject::new_metaobject(
--
#include <qsignalslotimp.h>

// SIGNAL button_clicked
void IconPalette::button_clicked( const string& t0 )
{
    if ( signalsBlocked() )
--
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: button_clicked((const string&)*((const 
string*)static_QUType_ptr.get(_o+1))); break;
    default:
        return QWidget::qt_emit(_id,_o);
------------------------------------------------------------------------

> 
> Perhaps Qt does even more mangling in more recent versions.
> 
> [moan elided ;)]
> 
> regards
> john

Bye, Alfredo



Reply via email to