Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Issue with QInputMethod to handle the events
Forum Updated to NodeBB v4.3 + New Features

Issue with QInputMethod to handle the events

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 608 Views 1 Watching
  • 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.
  • Bharath_pthinksB Offline
    Bharath_pthinksB Offline
    Bharath_pthinks
    wrote on last edited by
    #1

    I am working on digital multi-meter application using Qt 5.7. There is a numeric keypad on the device. UI screen has TableView, the data is updated from model and QStyledDelegates are being used to display and edit the data. TableView has two columns, one column is editable. The QFlags have been set for the same.

    Suppose the selected ModelIndex is (row = 0 && col = 1) which is editable, when any of the numeric hard key is pressed the selected cell should get turned to edit mode (adds QLineEdit to the cell using createEditor()) and pressed digit should appear on the QLineEdit.

    We are using QInputMethod to handle the events. Whenever any key is pressed, we set the commitString() of QInputMethodEvents and post the event to focussed widget. The problem here is, the focussed widget gets the event and adds QLineEdit to the cell but not the character to the QLineEdit. Subsequent keys are accepted and appears in QLineEdit. Problem is only with the first keypress.

    Tried to override the edit() method of QAbtsractItemView but did not help.

    Regards,
    Bharath Renukaswsamy
    PthinkS – “We are the Qt-QML Developers”

    m l +91 990 100 2299, off l +91 876 233 1536 l Skype - bharath.r26 l
    u l www.pthinks.com, e l bharath@pthinks.com, info@pthinks.com, l

    1 Reply Last reply
    0
    • YashpalY Offline
      YashpalY Offline
      Yashpal
      wrote on last edited by
      #2

      @Bharath_pthinks how have you ensured the characters of respective keys pressed reaches the QLineEdit that was created?

      1 Reply Last reply
      0

      • Login

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