PDA

View Full Version : QCompleter & ToolTip



nanortemis
27th June 2009, 16:01
Hello,

How to add tooltips to QCompleter items??

wysota
27th June 2009, 19:39
Did you try setting the tooltip role for the model you are passing to QCompleter?

nanortemis
27th June 2009, 20:21
I tried to get ToolTip using below code



QCompleter *completer = new QCompleter(this);
QStandardItemModel *model = new QStandardItemModel(this);
model->setItem(0, new QStandardItem("test"));
model->item(0)->setToolTip("Tool Tip test");
completer->setModel(model);
completer->setCaseSensitivity(Qt::CaseInsensitive);
ui->lineEdit->setCompleter(completer);


Code completion works but ToolTip is missing.
I used QStandardItemModel because it's possible to set tool tip for QStandardItem.

lasher
25th September 2009, 20:54
Hi,

I need also this feature, similar to VS C# code completion, completion items + tooltips for every compeltion.

Did you find any solution?

Greetings!