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. SoftwareInputPanel with digits only - how?
Forum Updated to NodeBB v4.3 + New Features

SoftwareInputPanel with digits only - how?

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 3 Posters 3.4k 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.
  • C Offline
    C Offline
    cmer4
    wrote on last edited by
    #1

    I noticed quite a few apps where developers are using standard SoftwareInputPanel with alphabetics and digits, while user is only required to input digits.

    What is the method to call a SoftwareInputPanel that provides entering digits (the one that exists in Nokia devices)?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      thisisbhaskar
      wrote on last edited by
      #2

      We should call setInputMethodHints on the editor before opening softwareinputpanel.

      Example:

      editor->setInputMethodHints(Qt::ImhDigitsOnly);
      //http://doc.trolltech.com/4.7.1/qt.html#InputMethodHint-enum

      //and then call below code to open software keypad.
      //http://labs.qt.nokia.com/2009/08/31/new-api-for-input-panel-virtual-keyboards
      QEvent event(QEvent::RequestSoftwareInputPanel);
      QApplication::sendEvent(editor, &event);

      //to close kepad
      QEvent event(QEvent::CloseSoftwareInputPanel);
      QApplication::sendEvent(editor, &event);

      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