- 论坛徽章:
- 0
|
使用qt3-designer做好GUI後用puic輸出轉換成perl格式,但是不知如何輸出變量(如何得到LineEdit的變量)
請教有相關經驗的人給予指教...........謝謝
use strict;
use utf8;
package Form1;
use Qt;
use Qt::isa qw(Qt::Widget);
use Qt::attributes qw(
frame3
lineEdit2
textLabel1
textLabel1_font
);
sub NEW
{
shift->SUPER::NEW(@_[0..2]);
if ( name() eq "unnamed" )
{
setName("Form1" );
}
my $font = Qt::Font(this->font);
$font->setPointSize(14);
setFont($font);
setMouseTracking(0 );
frame3 = Qt::Frame(this, "frame3");
frame3->setGeometry( Qt::Rect(120, 90, 351, 51) );
frame3->setFrameShape( &Qt::Frame::StyledPanel() );
frame3->setFrameShadow( &Qt::Frame::Raised() );
lineEdit2 = Qt::LineEdit(frame3, "lineEdit2");
lineEdit2->setGeometry( Qt::Rect(70, 10, 121, 31) );
textLabel1 = Qt::Label(frame3, "textLabel1");
textLabel1->setGeometry( Qt::Rect(10, 10, 60, 31) );
my $textLabel1_font = Qt::Font(textLabel1->font);
textLabel1->setFont($textLabel1_font);
textLabel1->setAlignment( int(&Qt::Label::WordBreak | &Qt::Label::AlignVCenter) );
languageChange();
my $resize = Qt::Size(600, 467);
$resize = $resize->expandedTo(minimumSizeHint());
resize( $resize );
clearWState( &Qt::WState_Polished );
}
# Sets the strings of the subwidgets using the current
# language.
sub languageChange
{
setCaption(trUtf8("Form1") );
textLabel1->setText( trUtf8("Asics:<font size=\"+1\"></font>") );
}
1;
package main;
use Qt;
use Form1;
my $a = Qt::Application(\@ARGV);
my $w = Form1;
$a->setMainWidget($w);
$w->show;
exit $a->exec; |
|