Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to set default focus properties on priority?
Forum Updated to NodeBB v4.3 + New Features

How to set default focus properties on priority?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 1 Posters 414 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.
  • S Offline
    S Offline
    Simr
    wrote on last edited by
    #1

    I want to have a default focus on a QLineEdit when there is any state transition is happening during runtime and when coming back to main window.
    For example, I have QLineEdit as a text input field and in that window I have QTVirtualKeyboard which is always capsLockActive and Shift button is disabled, whenever there is a state transition and coming back to main window which is having QTVirtualKeyboard then Focus is coming back to main window and in Code i do setFocus() on QLineEdit & cursor starts blinking but still Shift button remains enabled untill user clicks on QLineEdit text field.
    Please share how do I make Shift button disabled in the start before clicking anywhere when entering into this state? I have placed setFocus and Shift button disabled call as below in my code at multiple places including constructor, but nothing is working for this scenario.

    QTimer::singleShot(0, QLineEdit, SLOT(setFocus()));
    QMetaObject::invokeMethod(m_GUI->getVirtualKeyboard()->rootObject(), "capLockActive", Q_ARG( QVariant, QVariant(true) ) );

    Thanks in advance for any advice.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Simr
      wrote on last edited by
      #2

      Hi,
      We want to have capsLockActive and shift key disabled for qml virtual keyboard in our C++ Qt based application where we are using QML virtual keyboard. We are using Qt 5.13.2.
      We have called below function at multiple places in our code, but still, we are not able to get consistent behaviour for shift key disabled.

      And when user clicks on shift key multiple times, our application gets crashed, that is very critical situation for our product.

      QTimer::singleShot(0, QLineEdit, SLOT(setFocus()));
      QMetaObject::invokeMethod(m_GUI->getVirtualKeyboard()->rootObject(), "capLockActive", Q_ARG( QVariant, QVariant(true) ) );
      Please help with the consistent way to keep capsLock active and disable shift key for virtual qml keyboard.

      Attached are the images with shift key enabled and disabled. we need our keyboard with shift key disabled all the time.

      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