Results 1 to 8 of 8

Thread: QComboBox

  1. #1
    Join Date
    May 2009
    Posts
    94
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Post QComboBox

    How can i select the currentText of a QComboBox?

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QComboBox

    do you mean in a lineEdit of QComboBox?
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. The following user says thank you to spirit for this useful post:

    bismitapadhy (15th July 2009)

  4. #3
    Join Date
    May 2009
    Posts
    94
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QComboBox

    Quote Originally Posted by spirit View Post
    do you mean in a lineEdit of QComboBox?
    Yes line edit of QCombobox.

  5. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QComboBox

    QLineEdit::selectAll
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  6. The following user says thank you to spirit for this useful post:

    bismitapadhy (15th July 2009)

  7. #5
    Join Date
    May 2009
    Posts
    94
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QComboBox

    Quote Originally Posted by spirit View Post
    QLineEdit::selectAll
    Yes When we open a dialog having a Qcombobox the current text of the combobox show selected. So that user can edit easily.
    How is it possible using QLineEdit::selectAll.its should be function of QComboBox.

  8. #6
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QComboBox

    QComboBox has the following method QComboBox::lineEdit, but the comboBox must be editable. so, if it is, then only what you need it is to call QLineEdit::selectAll.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  9. The following user says thank you to spirit for this useful post:

    bismitapadhy (15th July 2009)

  10. #7
    Join Date
    May 2009
    Posts
    94
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QComboBox

    Quote Originally Posted by spirit View Post
    QComboBox has the following method QComboBox::lineEdit, but the comboBox must be editable. so, if it is, then only what you need it is to call QLineEdit::selectAll.
    This is not helping to select the content. To explain my Question i attached 2 picture. picture 1- is the picture what i have. \
    picture 2- With selection content in the find what combobox.
    So my Question is how can i select the find what content through program not manually.
    Attached Images Attached Images
    • File Type: jpg 1.JPG (16.8 KB, 14 views)
    • File Type: jpg 2.JPG (17.0 KB, 14 views)

  11. #8
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QComboBox

    did you even taken a look at the docs? The last post has the answer..
    Qt Code:
    1. combo->lineEdit()->selectAll()
    To copy to clipboard, switch view to plain text mode 

    that is it

  12. The following user says thank you to nish for this useful post:

    bismitapadhy (15th July 2009)

Similar Threads

  1. QComboBox crash
    By sfilez in forum Newbie
    Replies: 4
    Last Post: 8th July 2009, 00:31
  2. QItemDelegate, QDataWidgetMapper and QComboBox
    By cydside in forum Qt Programming
    Replies: 7
    Last Post: 8th April 2009, 19:44
  3. QComboBox - Few virtual methods
    By gruszczy in forum Qt Programming
    Replies: 17
    Last Post: 16th July 2008, 17:08
  4. QComboBox drop list button events
    By maird in forum Qt Programming
    Replies: 5
    Last Post: 20th October 2007, 20:25
  5. using QComboBox as an ItemView
    By EricTheFruitbat in forum Qt Programming
    Replies: 3
    Last Post: 24th January 2007, 17:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.