diff options
author | Timothy Pearson <[email protected]> | 2012-01-01 18:24:37 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-01-01 18:24:37 -0600 |
commit | 4e997a9c6e25689dca65a2ec573a599699ef8170 (patch) | |
tree | fdb5ecac42fb8204df9fc8c9abe1c784d4719e0e /PerlQt/lib/Qt/slots.pm | |
parent | bfa107694b2507a7116f8856cafe4ab1375da8a9 (diff) | |
download | libtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.tar.gz libtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.zip |
Initial TQt conversion
Diffstat (limited to 'PerlQt/lib/Qt/slots.pm')
-rw-r--r-- | PerlQt/lib/Qt/slots.pm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/PerlQt/lib/Qt/slots.pm b/PerlQt/lib/Qt/slots.pm index 5d1daf6..c12990e 100644 --- a/PerlQt/lib/Qt/slots.pm +++ b/PerlQt/lib/Qt/slots.pm @@ -1,11 +1,11 @@ -package Qt::slots; +package TQt::slots; use Carp; # # Proposed usage: # -# use Qt::slots changeSomething => ['int']; +# use TQt::slots changeSomething => ['int']; # -# use Qt::slots 'changeSomething(int)' => { +# use TQt::slots 'changeSomething(int)' => { # args => ['int'], # call => 'changeSomething' # }; @@ -14,21 +14,21 @@ use Carp; sub import { no strict 'refs'; my $self = shift; - my $caller = $self eq "Qt::slots" ? (caller)[0] : $self; + my $caller = $self eq "TQt::slots" ? (caller)[0] : $self; my $parent = ${ $caller . '::ISA' }[0]; my $parent_qt_invoke = $parent . '::qt_invoke'; - Qt::_internal::installqt_invoke($caller . '::qt_invoke') unless defined &{ $caller. '::qt_invoke' }; + TQt::_internal::installqt_invoke($caller . '::qt_invoke') unless defined &{ $caller. '::qt_invoke' }; # *{ $caller . '::qt_invoke' } = sub { # my $meta = \%{ $caller . '::META' }; # die unless $meta->{object}; # my $offset = $_[0] - $meta->{object}->slotOffset; # if($offset >= 0) { -# Qt::_internal::invoke(Qt::this(), $meta->{slots}[$offset], $_[1]); +# TQt::_internal::invoke(TQt::this(), $meta->{slots}[$offset], $_[1]); # return 1; # } else { -# Qt::this()->$parent_qt_invoke(@_); +# TQt::this()->$parent_qt_invoke(@_); # } # } unless defined &{ $caller . '::qt_invoke' }; @@ -58,17 +58,17 @@ sub import { my $slot_index = $#{ $meta->{slots} }; my $argcnt = scalar @$args; - my $mocargs = Qt::_internal::allocateMocArguments($argcnt); + my $mocargs = TQt::_internal::allocateMocArguments($argcnt); my $i = 0; for my $arg (@$args) { my $a = $arg; $a =~ s/^const\s+//; - if($a =~ /^(bool|int|double|char\*|QString)&?$/) { + if($a =~ /^(bool|int|double|char\*|TQString)&?$/) { $a = $1; } else { $a = 'ptr'; } - my $valid = Qt::_internal::setMocType($mocargs, $i, $arg, $a); + my $valid = TQt::_internal::setMocType($mocargs, $i, $arg, $a); die "Invalid type for slot argument ($arg)\n" unless $valid; $i++; } |