Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. TextInputUnit : how to write uppercase letter without clicking "Caps Lock" from the keyboard

TextInputUnit : how to write uppercase letter without clicking "Caps Lock" from the keyboard

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlqt 5.5qt quick 2.4qt c++textinput
3 Posts 2 Posters 345 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.
  • C Offline
    C Offline
    Chetan Sanap
    wrote on 23 Jul 2024, 12:16 last edited by Chetan Sanap
    #1

    TextInputUnit {
    id: pilotName
    x: 231
    y: 396
    width: 199
    height: 62
    parameter: "Pilot Name"
    value:""
    isEditable: true
    unitEnabled: false
    allCapsEnabled: true
    showValidationState: true
    validator : RegExpValidator{ regExp: /^[A-Z]{6}$/ }
    }

    here am using textinput, value will be the input .
    I want to show directly uppercase letters if user type without clicking the Caps Lock,
    Note :- I cant use textInput here , Hoping for answers regarding TextInputUnit only.

    A 1 Reply Last reply 24 Jul 2024, 06:45
    0
    • C Chetan Sanap
      23 Jul 2024, 12:16

      TextInputUnit {
      id: pilotName
      x: 231
      y: 396
      width: 199
      height: 62
      parameter: "Pilot Name"
      value:""
      isEditable: true
      unitEnabled: false
      allCapsEnabled: true
      showValidationState: true
      validator : RegExpValidator{ regExp: /^[A-Z]{6}$/ }
      }

      here am using textinput, value will be the input .
      I want to show directly uppercase letters if user type without clicking the Caps Lock,
      Note :- I cant use textInput here , Hoping for answers regarding TextInputUnit only.

      A Offline
      A Offline
      Axel Spoerl
      Moderators
      wrote on 24 Jul 2024, 06:45 last edited by Axel Spoerl
      #2

      Hi and welcome to the Qt Forum.
      Please use the code formatting tags, when you post code.

      here am using textinput, value will be the input .

      TextInput has Font.AllUppercase.
      TextInputUnit: Maybe one of my blind spots - I have no idea what that is. Which version of Qt are you using?

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Chetan Sanap
        wrote on 24 Jul 2024, 07:40 last edited by
        #3

        I forgot to mentioned this ,I am Using TextInputUnit as component ,
        here is the TextInputUnit.qml , i have added the Font.AllUppercase
        TextInput {
        id: textInput
        text: value
        focus: true
        anchors.top: parent.top
        anchors.left: parent.left
        anchors.bottom: parent.bottom
        anchors.leftMargin: 10
        anchors.right: unitsRect.left
        verticalAlignment: Text.AlignVCenter
        color: '#EBF4FF'
        font.family: 'Lato'
        font.pixelSize: 16
        font.capitalization: Font.AllUppercase

                selectByMouse: true
        

        // validator: validatorIn
        onEditingFinished: {
        root.textChanged()
        }
        readOnly: readonly
        }

        but still its not working . What will be the issue

        1 Reply Last reply
        0

        1/3

        23 Jul 2024, 12:16

        • Login

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