PerlQt

 view release on metacpan or  search on metacpan

PerlQt/lib/Qt/attributes.pm  view on Meta::CPAN

#     baz = 10;
#     this->{baz} = 10;
#     this->baz = 10;
# }
#
# Attributes override any method with the same name, so you may want
# to prefix them with _ to prevent conflicts.
#
sub import {
    my $class = shift;
    my $caller = (caller)[0];

    for my $attribute (@_) {
	exists ${ ${$caller . '::META'}{'attributes'} }{$attribute} and next;
	Qt::_internal::installattribute($caller, $attribute);
        ${ ${$caller . '::META'}{'attributes'} }{$attribute} = 1;
    }
}

1;

PerlQt/lib/Qt/isa.pm  view on Meta::CPAN

package Qt::isa;
use strict;

sub import {
    no strict 'refs';
    my $class = shift;
    my $caller = (caller)[0];

    # Trick 'use' into believing the file for this class has been read
    my $pm = $caller . ".pm";
    $pm =~ s!::!/!g;
    unless(exists $::INC{$pm}) {
	$::INC{$pm} = $::INC{"Qt/isa.pm"};
    }

    for my $super (@_) {
	push @{ $caller . '::ISA' }, $super;

PerlQt/lib/Qt/isa.pm  view on Meta::CPAN


    ${ $caller. '::_INTERNAL_STATIC_'}{'SUPER'} = bless {}, "  $caller";
    Qt::_internal::installsuper($caller) unless defined &{ $caller.'::SUPER' };   

    *{ $caller . '::metaObject' } = sub {
	Qt::_internal::getMetaObject($caller);
    };

    *{ $caller . '::import' } = sub {
	my $name = shift;    # classname = function-name
	my $incaller = (caller)[0];
        $incaller = (caller(1))[0] if $incaller eq 'if'; # work-around bug in package 'if'  pre 0.02
        (my $cname = $name) =~ s/.*::// and do
        { 
            *{ "$name" } = sub {
                $name->new(@_);
            } unless defined &{ "$name" };
        };
        my $p = defined $&? $&:'';
        $p eq ($incaller=~/.*::/?($p?$&:''):'') and
	    *{ "$incaller\::$cname" } = sub {

PerlQt/lib/Qt/signals.pm  view on Meta::CPAN

#     name => 'fooActivated(int)',
#     args => ['int']
# };
#
# sub whatever { emit fooActivated(10); }
#

sub import {
    no strict 'refs';
    my $self = shift;
    my $caller = $self eq "Qt::signals" ? (caller)[0] : $self;
    my $parent = ${ $caller . '::ISA' }[0];
    my $parent_qt_emit = $parent . '::qt_emit';

    Qt::_internal::installqt_invoke($caller . '::qt_emit') unless defined &{ $caller. '::qt_emit' };

#    *{ $caller . '::qt_emit' } = sub {
#	my $meta = \%{ $caller . '::META' };
#	die unless $meta->{object};
#	my $offset = $_[0] - $meta->{object}->signalOffset;
#	if($offset >= 0) {

PerlQt/lib/Qt/slots.pm  view on Meta::CPAN

#
# use Qt::slots 'changeSomething(int)' => {
#     args => ['int'],
#     call => 'changeSomething'
# };
#

sub import {
    no strict 'refs';
    my $self = shift;
    my $caller = $self eq "Qt::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' };

#    *{ $caller . '::qt_invoke' } = sub {
#	my $meta = \%{ $caller . '::META' };
#	die unless $meta->{object};
#	my $offset = $_[0] - $meta->{object}->slotOffset;
#	if($offset >= 0) {



( run in 1.296 second using v1.01-cache-2.11-cpan-a3c8064c92c )