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. QComboBox. Editable. Select all text and put cursor at the first Char of String
Forum Updated to NodeBB v4.3 + New Features

QComboBox. Editable. Select all text and put cursor at the first Char of String

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 2.3k Views 2 Watching
  • 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.
  • PabloArgP Offline
    PabloArgP Offline
    PabloArg
    wrote on last edited by
    #1

    Maybe someone can help me with this. I need that my "QComboBox editable" is full selected and the cursor is positioned on the first character when it gets the focus.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      michelson
      wrote on last edited by
      #2

      Combination of:

      combBox->setEditable(true)
      combBox->lineEdit()->setCursorPosition(0);
      
      1 Reply Last reply
      1
      • PabloArgP Offline
        PabloArgP Offline
        PabloArg
        wrote on last edited by
        #3

        Thanks michelson!!!
        Just I want to add:

        Don't forget to add this line, otherwise lineEdit() you can not use setCursorPosition(0):
        #include <QLineEdit>
        ......
        ......

        combBox->setEditable(true)
        combBox->lineEdit()->setCursorPosition(0);

        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