Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating my own Qt widget for a search box

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 ?

like image 618
OverTheEdge Avatar asked Oct 21 '25 17:10

OverTheEdge


1 Answers

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

like image 82
ismail Avatar answered Oct 23 '25 19:10

ismail



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!