Results 1 to 5 of 5

Thread: tooltip popup in delegate

  1. #1
    Join Date
    Mar 2011
    Posts
    25
    Thanks
    7
    Qt products
    Qt4

    Default tooltip popup in delegate

    I have a delegate that gets instantiated when double clicking on an item in a QTreeWidget.
    I would like to pop up a tooltip for few seconds and that it slowly disappears afterwards.

    Right now I'm doing this:
    Qt Code:
    1. QWidget * Test::createEditor(QWidget *parent, const QStyleOptionViewItem &option,
    2. const QModelIndex &index) const
    3. {
    4. ...
    5. QToolTip::showText(QCursor::pos(), "test");
    6. }
    To copy to clipboard, switch view to plain text mode 
    The tooltip shows up for a second and disappears. How would I go about doing that?
    Thanks

  2. #2
    Join Date
    Mar 2011
    Posts
    25
    Thanks
    7
    Qt products
    Qt4

    Default Re: tooltip popup in delegate

    I tried to do something like in the PropertyAnimation example of the Qt docs, but it disappears after a split second too.
    Does anybody have an idea how to approach this?

    Qt Code:
    1. QPushButton button("Animated Button", mParent);
    2. button.show();
    3. QPropertyAnimation animation(&button, "geometry");
    4. animation.setDuration(10000);
    5. animation.setStartValue(QRect(0, 0, 100, 30));
    6. animation.setEndValue(QRect(250, 250, 100, 30));
    7. animation.start();
    To copy to clipboard, switch view to plain text mode 

    Thanks,

  3. #3
    Join Date
    Mar 2011
    Posts
    25
    Thanks
    7
    Qt products
    Qt4

    Default Re: tooltip popup in delegate

    Is that simply not possible?
    Thanks

  4. #4
    Join Date
    Mar 2011
    Posts
    25
    Thanks
    7
    Qt products
    Qt4

    Default Re: tooltip popup in delegate

    Please let me know if the question wasn't clear. Is it possible to display a widget with a text (like a tooltip) from inside the delegate's createEditor function?

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: tooltip popup in delegate

    Use setToolTip() on the editor widget you create.

Similar Threads

  1. Regarding tooltip
    By ashishsaryar in forum Qt Programming
    Replies: 1
    Last Post: 24th December 2011, 09:32
  2. Replies: 12
    Last Post: 1st May 2011, 12:38
  3. How to make a popup widget that looks like a popup?
    By Olivier Berten in forum Qt Programming
    Replies: 9
    Last Post: 6th June 2010, 14:19
  4. Tooltip in Qwt
    By Ankitha Varsha in forum Qwt
    Replies: 5
    Last Post: 8th December 2009, 13:07
  5. Replies: 3
    Last Post: 17th May 2009, 21:17

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.