4

my question is somewhat related to Search button inside the search box like Bing. I plan to use a similar control to provide search facility within my desktop application. The search box is somewhat like the search box given in the windows explorer in Windows 7 where the text "search" appears and when the user enters text to search it'll show suggestions and close matches. Also when the search query is cleared there'll be a slight transition such as a fade out, so that the entire control looks smooth in operation.

I haven't done this using MFC/Windows programming, but I've a feeling this should be easier on Qt. I've seen the Qt example using QML but i don't plan to use QML.

Can you guys suggest a way for me to do this in Qt ?

Community
  • 1
  • 1
OverTheEdge
  • 749
  • 1
  • 11
  • 17

1 Answers1

4

Use QLineEdit with a QCompleter , for the Windows 7 search box effect see setPlaceHolderText(...) function.

waldyrious
  • 3,683
  • 4
  • 33
  • 41
ismail
  • 46,010
  • 9
  • 86
  • 95
  • 1
    sadly that does not offer the ability to give a slight transition as the one show in the Search Box demo using QML. – OverTheEdge Jan 20 '11 at 11:44
  • 1
    If its possible in QML its possible with C++ too :) – ismail Jan 20 '11 at 11:47
  • Yes Im thinking of doing a custom draw, using QStyle classes to capture control events and draw the control as I want it. But I am not sure how much of trouble Id run into. THis is simply the reason I needed help from the community. – OverTheEdge Jan 20 '11 at 11:55