Show numeric keypad in Android



  • 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!



  • @HPCTECH I found out the solution by using:

    ui->lineEdit->setInputMethodHints(Qt::ImhPreferNumbers);
    

  • Lifetime Qt Champion

    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 :)