Results 1 to 2 of 2

Thread: Posting events to Widgets do different things on Embedded than on Linux

  1. #1
    Join Date
    Sep 2010
    Posts
    28
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Posting events to Widgets do different things on Embedded than on Linux

    I'm developing an embedded application, but I also has an x86-build that I use to debug/develop. A recurring issue for me is that posting QKeyEvents to Widgets don't do the same in the two applications.

    The current issue:

    I use QFileSystemModel and QListView to move around in the filesystem, and based on input from a custom device I have the following code:

    Qt Code:
    1. QKeyEvent *e = NULL;
    2.  
    3. if (cmd.down)
    4. e = new QKeyEvent(QEvent::KeyPress, Qt::Key_Down, 0, 0);
    5. else if (cmd.up)
    6. e = new QKeyEvent(QEvent::KeyPress, Qt::Key_Up, 0, 0);
    7. else if (cmd.ok) {
    8. syslog(LOG_INFO, "press ok, ok?"):
    9. e = new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, 0, 0);
    10. }
    11.  
    12. if (e)
    13. QApplication::postEvent(&list, e);
    To copy to clipboard, switch view to plain text mode 

    I have also connected a signal to run a function when ok/Enter is pressed:

    Qt Code:
    1. connect(&list,
    2. SIGNAL(activated(const QModelIndex&)),
    3. this,
    4. SLOT(currentSelected(const QModelIndex&)));
    To copy to clipboard, switch view to plain text mode 

    Up/Down works both on embedded and x86, but Key_Enter only gives me the activated-signal on x86. And I wonder why...

  2. #2
    Join Date
    Sep 2010
    Posts
    28
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Posting events to Widgets do different things on Embedded than on Linux

    Tried using a QTreeView instead of a QListView, but have the same issue. The activated signal is never emitted on the embedded platform.

Similar Threads

  1. difference between source in Qt for X11/Linux Qt for Embedded Linux
    By sanjeet in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 7th June 2011, 02:58
  2. Multiple apps using Qt/Embedded+Qtopia on Embedded Linux
    By drahardja in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 17th February 2008, 21:46
  3. Posting custom events to a subclass of QThread
    By jpn in forum Qt Programming
    Replies: 3
    Last Post: 4th July 2006, 15:49
  4. Replies: 2
    Last Post: 14th February 2006, 15:28

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.