Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > d38b97c69a3fd47b351add70f89a7ab5 > files > 943

perl-qt4-examples-4.14.3-1.mga5.noarch.rpm

package Button;

use strict;
use warnings;

use QtCore4;
use QtGui4;
use QtCore4::isa qw( Qt::ToolButton );

use List::Util qw(max);

# [0]
sub NEW {
    my ( $class, $text, $parent ) = @_;
    $class->SUPER::NEW( $parent );
    this->setSizePolicy(Qt::SizePolicy::Expanding(), Qt::SizePolicy::Preferred());
    this->setText($text);
}
# [0]

# [1]
sub sizeHint {
# [1] //! [2]
    my $size = this->SUPER::sizeHint();
    $size->setHeight( $size->height() + 20 );
    $size->setWidth( max($size->width(), $size->height()));
    return Qt::Size($size);
}

# [2]

1;