• 5553阅读
  • 4回复

qte2.3.1在arm下的使用问题 [复制链接]

上一主题 下一主题
离线gwhhwgy
 
只看楼主 正序阅读 楼主  发表于: 2006-05-11
偶已经针对arm交叉编译成功了qte2.3.1,选用everything.

偶写了一个很小的程序,编译后烧到arm板子上运行,但出现两个问题:
1)没有显示结果
2)串口不再响应

不知道问题在哪里?

小程序代码如下:
#include <qapplication.h>
#include <qpushbutton.h>
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();
}[font=宋体][/font]
[ 此贴被XChinux在2006-05-11 17:12重新编辑 ]
离线gwhhwgy
只看该作者 4楼 发表于: 2006-05-12
是呀,ctrl+c 没有响应

我在程序中加入了不少printf:

#include <stdio.h>
#include <qapplication.h>
#include <qpushbutton.h>
#include <qlabel.h>
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.
图形程序本身似乎还活着.

这样程序调试很麻烦,板子只能重新启动,不知如何解决?
离线fengshenx

只看该作者 3楼 发表于: 2006-05-12
CTL+C没响应?
QT程序退出了,shell就能用了。
离线shiroki

只看该作者 2楼 发表于: 2006-05-11
你说的串口不响应是什么意思?
你是从串口执行的程序吗? 这个程序本来就没有什么输出阿。 没明白
--
shiro is White
ki is tree
http://www.cuteqt.com
论坛 http://www.cuteqt.com/bbs
博客 http://www.cuteqt.com/blog
博客镜像: http://sites.cuteqt.com/cuteqt
Linux/Qt/嵌入式讨论群 http://qun.qq.com/air/5699823
离线gwhhwgy
只看该作者 1楼 发表于: 2006-05-11
换另外一个小程序来试,倒是可以显示了,但仍然存在串口不响应问题:


不知道问题在哪里?

小程序代码如下:
#include <qapplication.h>
#include <qlabel.h>
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();
}
快速回复
限100 字节
 
上一个 下一个