Results 1 to 4 of 4

Thread: QCompleter & ToolTip

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default QCompleter & ToolTip

    Hello,

    How to add tooltips to QCompleter items??

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QCompleter & ToolTip

    Did you try setting the tooltip role for the model you are passing to QCompleter?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QCompleter & ToolTip

    I tried to get ToolTip using below code

    Qt Code:
    1. QCompleter *completer = new QCompleter(this);
    2. model->setItem(0, new QStandardItem("test"));
    3. model->item(0)->setToolTip("Tool Tip test");
    4. completer->setModel(model);
    5. completer->setCaseSensitivity(Qt::CaseInsensitive);
    6. ui->lineEdit->setCompleter(completer);
    To copy to clipboard, switch view to plain text mode 

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

  4. #4
    Join Date
    Sep 2009
    Posts
    20
    Thanked 2 Times in 2 Posts

    Default Re: QCompleter & ToolTip

    Hi,

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

    Did you find any solution?

    Greetings!

Similar Threads

  1. QDirModel, QCompleter, and Windows UNC paths
    By SnarlCat in forum Qt Programming
    Replies: 1
    Last Post: 17th April 2009, 09:27
  2. toolTip of TreeWidgetItem display is slow
    By yunpeng880 in forum Qt Programming
    Replies: 0
    Last Post: 9th March 2009, 09:35
  3. Extended Tooltip
    By aamer4yu in forum Qt Programming
    Replies: 12
    Last Post: 26th July 2008, 11:18
  4. Hot to set the tooltip of button
    By santosh.kumar in forum Qt Programming
    Replies: 3
    Last Post: 1st November 2007, 12:07
  5. QCompleter + QSqlTableModel problem
    By Lykurg in forum Qt Programming
    Replies: 2
    Last Post: 11th March 2007, 20:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.