免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2849 | 回复: 0
打印 上一主题 下一主题

perlqt的變量問題 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-12-14 19:58 |只看该作者 |倒序浏览
使用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;
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP