QCompleter for QTableWidgetItem to autocompelte
I have a QTableWidget has a QTableWidgetItem that contains a code a user will 开发者_开发问答supply. This code is known to the database and is suppose to autosuggest to the user as he types. How do I connect a QCompleter to a QTableWidgetItem. I know how to do it with a QLineEdit, but I have not found an example with a QTableWidgetItem.
I managed to come up with a solution, though not exactly by using a QTableWidgetItem, basically I placed a QLineEdit in the cell instead and attached the QCompleter to that.
Not sure how far this will get you, but take a look at this
http://docs.huihoo.com/qt/4.4/demos-spreadsheet-main-cpp.html
Search for completer
in the code.
精彩评论