We help IT Professionals succeed at work.

Qt use of QCombobox

dwcronin
dwcronin asked
on
Medium Priority
436 Views
Last Modified: 2006-11-18
I am using the Qt libraries.  I have an option on one of my menus "DiscStim" that open up a DiscStim window that has a "Destination" QCombobox in it.  I have some irrelevant selections: call them dest1, dest2, and dest3 that are available when you click on the Destinations QCombobox.  Initially there is no text in the QCombobox.  Unfortunately if you choose something - says dest1, if you then close the DiscStim window, and then choose DiscStim from the menu again, the previous selection is still there.  My questions are:

1) how do I make Destinations QCombobox blank every time I open the DiscStim window?  Blank is not one of the QCombobox options.  It's only there until you open the QCombobox and select something else.

2) When it is blank, it is blue.  How do I do that?

Thanks,
Dan
Comment
Watch Question

1. Do this

QComboBox* c;
...

c->setCurrentIndex(-1);
...

2. Not possible

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.