Created
June 4, 2013 17:50
-
-
Save olegwtf/5707991 to your computer and use it in GitHub Desktop.
perl qt4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use QtCore4; | |
use QtGui4; | |
package Ui_MainWindow; | |
use strict; | |
use warnings; | |
use QtCore4; | |
use QtGui4; | |
sub centralwidget { | |
return shift->{centralwidget}; | |
} | |
sub verticalLayout_2 { | |
return shift->{verticalLayout_2}; | |
} | |
sub pushButton { | |
return shift->{pushButton}; | |
} | |
sub setupUi { | |
my ( $class, $mainWindow ) = @_; | |
my $self = bless {}, $class; | |
if ( !defined $mainWindow->objectName() ) { | |
$mainWindow->setObjectName( "mainWindow" ); | |
} | |
$mainWindow->resize( 800, 600 ); | |
my $centralwidget = Qt::Widget( $mainWindow ); | |
$self->{centralwidget} = $centralwidget; | |
$centralwidget->setObjectName( "centralwidget" ); | |
my $verticalLayout_2 = Qt::VBoxLayout( $centralwidget ); | |
$self->{verticalLayout_2} = $verticalLayout_2; | |
$verticalLayout_2->setObjectName( "verticalLayout_2" ); | |
my $pushButton = Qt::PushButton( $centralwidget ); | |
$self->{pushButton} = $pushButton; | |
$pushButton->setObjectName( "pushButton" ); | |
$verticalLayout_2->addWidget( $pushButton ); | |
$mainWindow->setCentralWidget( $centralwidget ); | |
$self->retranslateUi( $mainWindow ); | |
Qt::MetaObject::connectSlotsByName( $mainWindow ); | |
return $self; | |
} # setupUi | |
sub setup_ui { | |
my ( $mainWindow ) = @_; | |
return setupUi( $mainWindow ); | |
} | |
sub retranslateUi { | |
my ( $self, $mainWindow ) = @_; | |
$mainWindow->setWindowTitle( Qt::Application::translate( 'MainWindow', "MainWindow", undef, Qt::Application::UnicodeUTF8() ) ); | |
$self->{pushButton}->setText( Qt::Application::translate( 'MainWindow', "PushButton", undef, Qt::Application::UnicodeUTF8() ) ); | |
} # retranslateUi | |
sub retranslate_ui { | |
my ( $mainWindow ) = @_; | |
retranslateUi( $mainWindow ); | |
} | |
package MainWindow; | |
use QtCore4::isa qw( Qt::MainWindow ); | |
sub NEW { | |
my $class = shift; | |
$class->SUPER::NEW(); | |
this->{ui} = Ui_MainWindow->setupUi(this); | |
} | |
package main; | |
use MainWindow; | |
my $app = Qt::Application( \@ARGV ); | |
my $win = MainWindow(); | |
$win->show(); | |
$app->exec(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment