Results 1 to 5 of 5

Thread: Tooltip of widget not visible in QGraphicsProxyWidget

  1. #1
    Join Date
    Dec 2007
    Location
    London
    Posts
    206
    Thanks
    40
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Tooltip of widget not visible in QGraphicsProxyWidget

    Hi,

    I've embedded a QCustomPlot item into a container widget; and embedded this container widget into a QGraphicsProxyWidget. And i've inserted this proxywidget into QGraphicsScene. QCustomPlot 's events have some problems with QGraphicsProxyWidget. Jscurlee' s solution fixes most of the problem. But i also needed to show a tooltip for plots and used Ross 's solution.

    As a result; i can see a tooltip box when i hover on the graph line; but texts of the tooltip are invisible as below:

    graph.png

    Now i am stuck here, any idea?

    Thanks,
    Yigit

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Tooltip of widget not visible in QGraphicsProxyWidget

    Maybe you can draw directly in a custom item instead of embedding a widget?

    Then you wouldn't have to proxy between widgets and graphicsscene and have full control over what you do.

    Cheers,
    _

  3. #3
    Join Date
    Dec 2007
    Location
    London
    Posts
    206
    Thanks
    40
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: Tooltip of widget not visible in QGraphicsProxyWidget

    Hi Anda,
    Do you mean i should port QCustomPlot item into a QGraphicsPlotItem?

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Tooltip of widget not visible in QGraphicsProxyWidget

    That might be better for the long run if that is possible.

    Embedding widgets into a graphics scene can get ugly, as things like events need to be mapped back and forth between two very different worlds.

    A custom graphics item is usually more upfront work but you also better control on drawing and user interaction.

    Usually embedding widgets makes only sense if it is one of the standard widgets, e.g. QComboBox, which are quite complicated to replicated visually and behavioralwise.

    Cheers,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    yagabey (12th February 2016)

  6. #5
    Join Date
    Dec 2007
    Location
    London
    Posts
    206
    Thanks
    40
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: Tooltip of widget not visible in QGraphicsProxyWidget

    Life would be much easier if that tooltip had worked; but anyway... :-)

    Edit: I think proxy causes a palette related issue. Calling setPalette after tooltip's showText function solved the problem for now.

    Qt Code:
    1. QToolTip::showText(helpEvent->globalPos(), ttip);
    2. QToolTip::setPalette(QPalette(Qt::black));
    To copy to clipboard, switch view to plain text mode 
    Last edited by yagabey; 12th February 2016 at 23:13.

Similar Threads

  1. Replies: 1
    Last Post: 23rd March 2012, 13:39
  2. Creating a Tooltip-like widget for mouse-hover of QListView items
    By TropicalPenguin in forum Qt Programming
    Replies: 4
    Last Post: 26th November 2011, 05:14
  3. How can we set tooltip to a particular area of widget?
    By pratik041 in forum Qt Programming
    Replies: 5
    Last Post: 21st November 2011, 16:17
  4. Replies: 8
    Last Post: 9th July 2010, 00:37
  5. Tooltip-like widget
    By momesana in forum Qt Programming
    Replies: 5
    Last Post: 4th October 2007, 18:33

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.