main.cpp
#include "hello.h"
#include <qtopia/qpeapplication.h>
QTOPIA_ADD_APPLICATION("hello",HelloForm)
QTOPIA_MAIN
ll.h
#ifndef FORM1_H
#define FORM1_H
#include <qvariant.h>
#include <qwidget.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QPushButton;
class Form1 : public QWidget
{
Q_OBJECT
public:
Form1( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~Form1();
QPushButton* PushButton1;
};
#endif // FORM1_H
ll.cpp
#include "ll.h"
#include <qpushbutton.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
/*
* Constructs a Form1 which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*/
Form1::Form1( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
if ( !name )
setName( "Form1" );
resize( 596, 480 );
setCaption( tr( "Form1" ) );
PushButton1 = new QPushButton( this, "PushButton1" );
PushButton1->setGeometry( QRect( 210, 80, 110, 50 ) );
PushButton1->setText( tr( "hello" ) );
}
/*
* Destroys the object and frees any allocated resources
*/
Form1::~Form1()
{
// no need to delete child widgets, Qt does it all for us
}
ll.desktop
~ [Desktop Entry]
Comment=An Example Program
Exec=ll
Icon=ll
Type=Application
Name=Hello2440
ll.pro
TEMPLATE = app
CONFIG = qt warn_on release
HEADERS =ll.h
SOURCES = ll.cpp \
main.cpp
INTERFACES =
DEPENDPATH=../../include
TARGET =ll
~
build
#!/bin/bash
source /opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/setQpeEnv
qmake -o Makefile -spec /opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/mkspecs/qws/linux-generic-g++ *.pro
make clean
make
谢谢版主