Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Keybuttons lcd7cape mapped to beaglebone, dont catch event, try eventfilter etc

Keybuttons lcd7cape mapped to beaglebone, dont catch event, try eventfilter etc

Scheduled Pinned Locked Moved Mobile and Embedded
beaglebone bbb
1 Posts 1 Posters 483 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RamiroGC
    wrote on 22 Sept 2015, 11:18 last edited by
    #1

    Hello, it is first time to write here, i have fixed many issue by this forum, but this problem i dont know solution.

    I have a beaglebone with lcd7cape, five buttons ( left, right, up, down, enter ), but dont catch events in qt, i try eventfilter, keypressevent, read /dev/input/event2 ( here is event keyboard ), but nothing

    By terminal work event, catch key press, running in bbb dont work.

    this mainwindow.cpp

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

            QList<QSerialPortInfo> com_ports = QSerialPortInfo::availablePorts();
            QSerialPortInfo port;
    
    
            foreach(port, com_ports)
            {
                ui->listWidget->addItem(port.portName());
            }
    
    
    
    
    
    
    
            bbwhite.setPortName("/dev/ttyO4");
    
                       bbwhite.open(QSerialPort::ReadWrite);
                       //bbwhite.open(QSerialPort::ReadOnly);
                       bbwhite.setBaudRate(QSerialPort::Baud9600);
                       bbwhite.setDataBits(QSerialPort::Data8);
                       bbwhite.setFlowControl(QSerialPort::NoFlowControl);
                       bbwhite.setParity(QSerialPort::NoParity);
                       bbwhite.setStopBits(QSerialPort::OneStop);
    
    
    
      connect(&bbwhite, SIGNAL(readyRead()), this, SLOT(readData()));
    
    
          ui->TipoVia->setText("Via: Ciudad");   //partimos de via ciudad
          mensajesCiudad();
    

    }

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

    void MainWindow::keyPressEvent(QEvent* event)
    {
    ui->listWidget->insertItem(0,QString::number(1) + " " + "carretera" );

    if (event->key() == Qt::Key_Enter)
    {

    }
    }

    mainwindow.h

    namespace Ui {
    class MainWindow;
    }

    class MainWindow : public QMainWindow
    {
    Q_OBJECT

    public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    protected:
    void keyPressEvent(QEvent* event);
    //bool eventFilter(QObject* obj, QEvent* event);
    .
    .
    .
    .

    in other forum read about have my windows with focus, but i dont know , thanks

    1 Reply Last reply
    0

    1/1

    22 Sept 2015, 11:18

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved