|
本帖最后由 xiaofuhaixia 于 2009-9-1 18:50 编辑
我改后的first.cpp
/****************************************************************************
** Form implementation generated from reading ui file 'first.ui'
**
** Created: 一 8月 31 16:07:26 2009
** by: The User Interface Compiler ($Id: qt/main.cpp 3.1.1 edited Nov 21 17:40 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "first.h"
#include <qvariant.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>
/*
* Constructs a first as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*/
first::first( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
//QPixmap image0( ( const char** )image0_data );
if ( !name )
setName( "first" );
resize(451,305);
setCaption( tr("EmbedSky_First_Qt_Program") );
user_b = new QPushButton( this, "user_b" );
user_b->setGeometry( QRect( 60, 20, 100, 30 ) );
user_b->setText( tr("User Button") );
close = new QPushButton( this, "close" );
close->setGeometry( QRect( 120, 140, 80, 28 ) );
close->setText( tr("Close") );
user_t = new QLabel( this, "user_t" );
user_t->setGeometry( QRect( 20, 70, 188, 30 ) );
QFont user_t_font( user_t->font() );
user_t_font.setPointSize( 18 );
user_t_font.setBold( TRUE );
user_t->setFont( user_t_font );
user_t->setText( tr("") );
//PixmapLabel1= new QLabel(this,"PixmapLabel1");
//PixmapLabel1->setGeometry( QRect( 260, 20, 28, 98 ) );
//PixmapLabel1->setPixmap( image0 );
//PixmapLabel1->setScaledContents( TRUE );
// signals and slots connections
connect( user_b, SIGNAL( clicked() ), this, SLOT( user_button() ) );
connect( close, SIGNAL( clicked() ), this, SLOT( close() ) );
}
/*
* Destroys the object and frees any allocated resources
*/
first::~first()
{
// no need to delete child widgets, Qt does it all for us
}
/*
* Sets the strings of the subwidgets using the current
* language.
*/
//bool first::event(QEvent*ev)
//{ //bool ret = QWidget::event(ev);
// if (ev->type()==QEvent::ApplicationFontChange)
// { QFont user_t_font(user_t->font());
// user_t_font.setPointSize( 18 );
// user_t_font.setBold( TRUE );
// user_t->setFont( user_t_font );
// }
// return ret;
//}
void first::user_button()
{ user_t->setText( tr("Hello,Qt Application !") );
//qWarning( "first::user_button(): Not implemented yet" );
}
不知道现在对不对??编译时,环境变量是这样设的:
cd /opt/EmbedSky/Qte/x86-qtopia
. setenv
我想就相当于. x86-setenv吧??
手册里说,在pc机上仿真可以用编译器3.2.2,我就用的是3.2.2????
在板子上仿真用V61编译,我下了,在解压时,生成的目录自动把原来的3.4.5覆盖了,他们是不是一个啊???因为解压完成后,和原来的文件夹一样啊????
在改完first.cpp后,如上图所示,设置完环境变量,编译器3.2.2编译,当make时,出现下面的错误,不知道main.o为什么错误??怎么改??
谢谢!! |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|