[Kde-perl] slot searched in the base class instead of the derived one
Stéphane Payrard
kde-perl@mail.kde.org
Sat, 7 Dec 2002 01:09:21 +0100
To get the hang of Qt, I am writing a small appli to display
perl docs. Can you help me with the following code extracted
from that appli.
PerlQt barks:
QObject::connect: No such slot QApplication::showdoc(int)
QObject::connect: (sender name: 'unnamed')
QObject::connect: (receiver name: 'sdoc')
I am puzzled: why the slot is searched in Qt::Application
instead of my subclass DocAppli?
I am probably getting something wrong. But I can't see what.
Thx
--
stef
#! /usr/bin/perl
package DocAppli;
use strict;
use Qt;
use Qt::isa qw(Qt::Application);
use Qt::slots showdoc => [ 'int' ];
sub showdoc { } # place-holder
package main;
use Qt;
use DocAppli;
my $a = DocAppli(\@ARGV);
my $m = Qt::MainWindow();
my $mb = $m->menuBar();
$mb->insertItem( "foo", $a, SLOT("showdoc(int)") );
$a->exec();