Results 1 to 2 of 2

Thread: QComboBox autocompletion question

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2014
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QComboBox autocompletion question

    Hi,

    I'm new to Qt and have a question about QComboBox and autocompletion.

    I have a QComboBox loaded with a bunch of colors as the items. I set editable as false and set QApplication::setKeyboardInputInterval() to 2000 and the autocomplete works as I want it to except for items with spaces.

    Colors loaded in the combobox:
    Black
    Blue
    White
    Dark Blue
    Dark Green

    If I type 'b' the box shows Black
    If I type 'bl' the box shows Black
    If I type 'blu' the box shows Blue. All these are fine.

    If I type 'dark ' (note the space after) the box shows Dark Blue and the popup menu comes up and stops any keypresses from registering until I click on a choice in the popup or hit escape. This stops me from typing 'dark g' to get to Dark Green.

    I read that the space is the shortcut for the popup menu. How can I suppress the popup while still matching the text containing the space?
    Is there another (or better) way to do this besides a combobox? Any information or code snippets are greatly appreciated.

    Thanks
    -Zwil

  2. #2
    Join Date
    Jul 2014
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QComboBox autocompletion question

    Uncheck editable Zwil.

    Nevermind figured it out.

Similar Threads

  1. question on the QComboBox
    By xiongxiongchuan in forum Qt Programming
    Replies: 3
    Last Post: 6th February 2014, 11:32
  2. Advanced Autocompletion where QCompleter might not cut it
    By chezifresh in forum Qt Programming
    Replies: 3
    Last Post: 14th October 2011, 03:48
  3. Replies: 7
    Last Post: 12th July 2011, 15:50
  4. Autocompletion using Qt
    By bismitapadhy in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2009, 18:02
  5. QcomboBox autoCompletion
    By Lele in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2006, 17:44

Tags for this Thread

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.