1) makefile 的生成
qmake -project
qmake hello.pro
2) 窗口的布局 ,主要是通过窗口布局管理器里实现的,
主要函数有addWidget 和setLayout.
#include 将包含大部分ui的头文件。
3) Qt 对话框 要从public QDialog 继承。
4) 信号和槽
connect(sender,SIGNAL(signal),receiver,SLOT(slot));
sender 和 receiver 是指向QObjecgt的指针,signal 和slot 是不带参数的函数名,实际上,SIGNAL() 和SLOT() 会把他们的参数转换成相应的字符串。
Qt4.6.2 移植
1) cd qt-everywhere-opensource-src-4.6.2/mkspecs/qws
cp linux-arm-g++ linux-omap3530-g++
2) 修改文件gmake.conf
#
# qmake configuration for building with arm-linux-g++
#
include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)
#modifications to g++.conf
#QMAKE_CC = arm-linux-gcc
#QMAKE_CXX = arm-linux-g++
#QMAKE_LINK = arm-linux-g++
#QMAKE_LINK_SHLIB = arm-linux-g++
#Toolchain
#Compiler Flags to take advantage of the ARM architecture
QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -lts
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -lts
QMAKE_CC = arm-none-linux-gnueabi-gcc
QMAKE_CXX = arm-none-linux-gnueabi-g++
QMAKE_LINK = arm-none-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++
#modifications to linux.conf
#QMAKE_AR = arm-linux-ar cqs
#QMAKE_OBJCOPY = arm-linux-objcopy
#QMAKE_STRIP = arm-linux-strip
QMAKE_AR = arm-none-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
QMAKE_STRIP = arm-none-linux-gnueabi-strip
QMAKE_INCDIR = /home/wqs/work/omap3530/tslibbin/include
QMAKE_LIBDIR = /home/wqs/work/omap3530/tslibbin/lib
load(qt_config)
3) configure
./configure -prefix /home/wqs/work/omap3530/sbc8100/rootfs -embedded arm -platform /qws/linux-x86-g++ -xplatform /qws/linux-omap3530-g++ -depths 16,24,32 -no-mmx -no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -qt-mouse-pc -qt-mouse-linuxtp -qt-mouse-linuxinput -plugin-mouse-linuxtp -plugin-mouse-pc -fast -qt-mouse-tslib
4) make
cp /arm-none-linux-gnueabi/libc/lib/libdl-2.8.so rootfs/lib
Qt 编译;
Qt 鼠标
mdev:
阅读(1256) | 评论(0) | 转发(0) |