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. Show numeric keypad in Android
Forum Update on Monday, May 27th 2025

Show numeric keypad in Android

Scheduled Pinned Locked Moved Solved Mobile and Embedded
androidqlineditkeypadkeyboardqspinbox
3 Posts 2 Posters 3.5k 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.
  • H Offline
    H Offline
    HPCTECH
    wrote on 16 Dec 2015, 17:20 last edited by SGaist
    #1

    Hi,

    I want to know how can I show numeric keypad for QLineEdit and QSpinBox?

    By default, both widgets show full keypad in Android while I need to call numeric keypad in specific places

    BTW, I expected to show numeric pad by default for QSpinBox because it restricted to numeric values only!

    H 1 Reply Last reply 20 Dec 2015, 09:36
    0
    • H HPCTECH
      16 Dec 2015, 17:20

      Hi,

      I want to know how can I show numeric keypad for QLineEdit and QSpinBox?

      By default, both widgets show full keypad in Android while I need to call numeric keypad in specific places

      BTW, I expected to show numeric pad by default for QSpinBox because it restricted to numeric values only!

      H Offline
      H Offline
      HPCTECH
      wrote on 20 Dec 2015, 09:36 last edited by
      #2

      @HPCTECH I found out the solution by using:

      ui->lineEdit->setInputMethodHints(Qt::ImhPreferNumbers);
      
      1 Reply Last reply
      2
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 21 Dec 2015, 00:28 last edited by
        #3

        Hi,

        Glad you found out and thanks for sharing !

        Just a quick note: there's no need to modify the title anymore to mark the thread as solved. You can use the "Topic Tool" button for that. That makes things cleaner :)

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0

        2/3

        20 Dec 2015, 09:36

        • Login

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