标题:qte2.3.1在arm下的使用问题
作者:gwhhwgy
日期:2006-05-11 15:48
内容:
偶已经针对arm交叉编译成功了qte2.3.1,选用everything.
偶写了一个很小的程序,编译后烧到arm板子上运行,但出现两个问题:
1)没有显示结果
2)串口不再响应
不知道问题在哪里?
小程序代码如下:
#include
#include
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton *button = new QPushButton("Quit", 0);
//QObject::connect(button, SIGNAL(clicked()), &app, SLOT(quit()));
app.setMainWidget(button);
button->show();
return app.exec();
}
#1 [gwhhwgy 05-11 15:51]
换另外一个小程序来试,倒是可以显示了,但仍然存在串口不响应问题:
不知道问题在哪里?
小程序代码如下:
#include
#include
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!", 0);
app.setMainWidget(label);
label->show();
return app.exec();
}
#2 [shiroki 05-11 18:42]
你说的串口不响应是什么意思?
你是从串口执行的程序吗? 这个程序本来就没有什么输出阿。 没明白
#3 [fengshenx 05-12 01:41]
CTL+C没响应?
QT程序退出了,shell就能用了。
#4 [gwhhwgy 05-12 09:32]
是呀,ctrl+c 没有响应
我在程序中加入了不少printf:
#include
#include
#include
#include
int main(int argc, char *argv[])
{
printf("before qapp\n");
QApplication app(argc,argv);
printf("before label\n");
//QLabel *btn = new QLabel("Hello Qt!",0);
QPushButton *btn = new QPushButton("Quit",0);
QObject::connect(btn,SIGNAL(clicked()), &app,SLOT(quit()));
printf("before setmain\n");
app.setMainWidget(btn);
printf("before show\n");
btn->show();
printf("before exec\n");
return app.exec();
printf("after exec\n");
}
但COM1只输入before qapp一行,同时也不接受输入,包括ctrl+c.
图形程序本身似乎还活着.
这样程序调试很麻烦,板子只能重新启动,不知如何解决?