[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-perl
Subject:    Re: [Kde-perl] Help with slots(Visual Studio)
From:       Germain Garand <germain () ebooksfrance ! org>
Date:       2003-04-13 3:27:53
[Download RAW message or body]

Le Dimanche 13 Avril 2003 02:04, Matt Newell a écrit :
> OK, I thought that everything was working dandy, but then I found out that
> user defined slots aren't working.  The perl code runs fine, but when I try
> to connect to one of my slots, it gives the usual Qt no slot exists error.
> When qt gives the error it lists the object type as 'QObject'. I don't know
> if this is correct.

Reading this 5 minutes before going to get some sleep... damn =)

I'd first suspect the virtual method callback mechanism, because if
the metaObject() virtual isn't called on the Perl side, custom slots won't 
work properly

Try to run an example with custom slots like this:
perl -MQt::debug=virtual drawdemo.pl
(or even Qt::debug=all, if you aren't afraid of flood =)

You should see a bunch of callbacks like this:

virtual 0x8064b90->QApplication::notify() called
virtual 0x83f3da0->QWidget::event() called
virtual 0x83f3da0->QWidget::setEraseColor() called
virtual 0x83f3da0->QObject::insertChild() called
[...]
virtual 0x8400fb8->QButtonGroup::metaObject() called => this one setup custom
						 sigslots for the QButtonGroup reimplementation (if any)

If not, you are into troubles.

Roughly,  custom sigslots work like this:

- isa.pm branches the class's ::metaObject() virtual to 
Qt::_internal::getMetaObject() (Qt.pm => l.603)

- slots/signals.pm setup a hash of informations ( %class::META )describing the 
custom signals/slots

-when Qt::_internal::getMetaObject is first called back, it builds the 
metaObject by callingmakeMetaData, then make_metaObject (in Qt.xs).
This metaobject is then cached in $class::META{ object }, and given back to Qt 
each time it is requested.

>
> Does anyone have any pointers to places I should look in the code.  My
> first guess is that the slots aren't getting installed correctly, since you
> can connect to qt slots just fine.  But I'm not very familiar with the perl
> code that generates the slots.
>  Actually, I'm not that familiar with perl
> at all, I've only been using it for a couple weeks :(
>
> Is there a difference in the way Qt slots work for the Qt/Windows
> commercial version?

I don't know, but since you managed to compile it, even though PerlQt uses a 
private Qt class (private/qucomextra_p.h), it really should work...

Germain

>  I looked through the qobject.cpp and qmetaobject.cpp
> files and didn't see any platform specific #ifdefines.  Could it have
> something to the linking?
>
> Thanks for the help
>
> Matt Newell
>
>
> _______________________________________________
> Kde-perl mailing list
> Kde-perl@mail.kde.org
> http://mail.kde.org/mailman/listinfo/kde-perl

_______________________________________________
Kde-perl mailing list
Kde-perl@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-perl

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic