2013-10-18 17 views
0

我的目标是为Technexion DevKit TDM-3730 BlizzardPack制作QT应用程序。一切正常,但它是不可能点击一个按钮与触摸屏,而与鼠标没关系。无法通过Qt和Angstrom获取触摸事件

我试过evtest,在这里它的输出:

[email protected]:/dev/input# evtest touchscreen0 
Input driver version is 1.0.1 
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 
Input device name: "prism_st" 
Supported events: 
    Event type 0 (Sync) 
    Event type 1 (Key) 
    Event code 330 (Touch) 
    Event type 3 (Absolute) 
    Event code 0 (X) 
     Value 115 
     Min  0 
     Max  1499 
    Event code 1 (Y) 
     Value 397 
     Min  0 
     Max  899 
    Event code 24 (Pressure) 
     Value  0 
     Min  0 
     Max  255 
Testing ... (interrupt to exit) 
Event: time 10551.906098, type 3 (Absolute), code 0 (X), value 735 
Event: time 10551.906129, type 3 (Absolute), code 1 (Y), value 461 
Event: time 10551.906129, type 3 (Absolute), code 24 (Pressure), value 255 
Event: time 10551.906129, -------------- Report Sync ------------ 
Event: time 10551.915772, type 3 (Absolute), code 0 (X), value 734 
Event: time 10551.915772, type 3 (Absolute), code 1 (Y), value 460 
Event: time 10551.915802, -------------- Report Sync ------------ 
Event: time 10551.925201, type 3 (Absolute), code 0 (X), value 733 
Event: time 10551.925201, type 3 (Absolute), code 1 (Y), value 459 
Event: time 10551.925232, -------------- Report Sync ------------ 
Event: time 10551.934570, type 3 (Absolute), code 0 (X), value 732 
Event: time 10551.934600, -------------- Report Sync ------------ 
Event: time 10551.943999, type 3 (Absolute), code 0 (X), value 730 
Event: time 10551.944030, type 3 (Absolute), code 1 (Y), value 460 
Event: time 10551.944030, -------------- Report Sync ------------ 
Event: time 10551.951659, type 3 (Absolute), code 0 (X), value 728 
Event: time 10551.951690, type 3 (Absolute), code 1 (Y), value 462 
Event: time 10551.951690, type 3 (Absolute), code 24 (Pressure), value 28 
Event: time 10551.951690, -------------- Report Sync ------------ 
Event: time 10551.959014, type 3 (Absolute), code 0 (X), value 726 
Event: time 10551.959044, type 3 (Absolute), code 1 (Y), value 464 
Event: time 10551.959044, type 3 (Absolute), code 24 (Pressure), value 1 
Event: time 10551.959044, -------------- Report Sync ------------ 

不管我多么轻拍没有触摸事件(330)。

我已经做了一个GTK应用程序,它没问题,但它根本不方便。而且似乎在GTK GUI中实现了触摸事件处理。我对吗?

这里是我的系统参数:

Host - Linux Mint 15, Linux version 3.8.0-19-generic, QT 5 
Target - Angstrom, Linux version 2.6.37, qt4-embedded - 4.7.3-r33.1.9, tslib 
Cpu - TI Sitara DM3730 @ 1Ghz 
DSP Core - TMS320C64x+™ @ 800Mhz 

tslib的环境变量远销:

export TSLIB_TSDEVICE=/dev/input/touchscreen0 
export QWS_MOUSE_PROTO=Tslib:/dev/input/touchscreen0 

我在QT(和嵌入式系统)初学者,所以我followwing德里克在BeagleBone上的Molloy教程http://www.youtube.com/watch?v=kP7uvOu9hoQ。但我有Technexion开发工具包。 Beaglebone linux版本是3.2.34,我的版本是2.6.37。

这里是我的测试程序的main.cpp:

#include "mainwindow.h" 
#include <QApplication> 
#include <QTouchEvent> 

int main(int argc, char *argv[]) 
{ 
    QApplication a(argc, argv); 
    MainWindow w; 
    w.show(); 

    return a.exec(); 
} 

这里是mainwindow.cpp:

#include "mainwindow.h" 
#include "ui_mainwindow.h" 

MainWindow::MainWindow(QWidget *parent) : 
    QMainWindow(parent), 
    ui(new Ui::MainWindow) 
{ 
    ui->setupUi(this); 
} 

MainWindow::~MainWindow() 
{ 
    delete ui; 
} 

void MainWindow::on_pushButton_clicked() 
{ 
    ui->lineEdit->setText("DevKit"); 
} 

而且在德里克的教程它工作正常。有谁能告诉我如何让qt源代码接受触摸屏事件吗?

预先感谢您。

叶戈尔

回答

0

我想你可能会发现在设置你的Qt环境和配置QT嵌入到BBB这个视频非常有用。

[Beaglebone:Qt Creator中的C++ ARM嵌入式Linux开发]

+0

我理解,但我需要为我的开发工具包,否则我不会问这样的问题 – Egor