Moxa UC-8481-LX [73/90] Compile and test the qt program on an x86 machine

Moxa UC-8410-LX [73/90] Compile and test the qt program on an x86 machine
UC-8410/8416/8418/8430 Programmer's Guide
5-21
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("<H1>hello <font color=red>QT</font></H1>");
QWidget window;
label->setWindowTitle("Hello");
label->setAlignment(Qt::AlignCenter);
label->resize(200,100);
label->show();
window.resize(320, 240);
window.show();
window.setWindowTitle(
QApplication::translate("toplevel", "Top-level widget"));
return app.exec();
}
Compile and Test the QT Program on an X86 Machine
Install the QT developing package
apt-get install build-essential libqt4-dev libqt4-dev-tools qt4-designer
Compile the programs
1. Create the project file hello.pro
qmake -project
2. Create the Makefile
qmake
3. Compile
Make
4. Execute
./hello
Set up Qt development
The qt-libraries have been included in arm-linux_2.3_YYMMDDHH.sh/arm-linux_3.x_YYMMDDHH.sh. You can
launch the auto-installed script to install the libraries. The setup the QTDIR and PATH for cross-compiling:
For toolchain v2.x:
Debian:~# export QTDIR=/usr/local/arm-linux/lib/be/qt-lib
Debian:~# export PATH=$QTDIR/bin:$PATH
For toolchain v3.x:
Debian:~# export QTDIR=/usr/local/arm-linux-4.4.2/lib/be/qt-lib
Debian:~# export PATH=$QTDIR/bin:$PATH
Cross-compile the Qt application and run with Dual-display
To enter the project folder:
Debian:~# cd hello
To create the project file, hello.pro:
Debian:~# qmake -project
To create the Makefile:
Debian:~# qmake

Содержание

Похожие устройства

Скачать