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
QtWS25 Last Chance

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 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
    0
    • H HPCTECH

      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 last edited by
      #2

      @HPCTECH I found out the solution by using:

      ui->lineEdit->setInputMethodHints(Qt::ImhPreferNumbers);
      
      1 Reply Last reply
      2
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on 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

        • Login

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