Results 1 to 3 of 3

Thread: Blackbox button tooltip

  1. #1
    Join Date
    May 2011
    Posts
    23
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Blackbox button tooltip

    Hi

    I have subclassed a qpushbutton (following this link: http://www.qtcentre.org/threads/4429...pawn2-%26gt%3B)
    and set its background-color to transparent via setStyleSheet("background-color: transparent;);
    but this causes the tool tip of this button to appear as a black box. Without this, it works fine.

    setAutoFillBackground is set to false (but I don't think this is the reason for this problem) - it doesn't affect the tooltip.

    Any ideas?

    Thanks,

    Jean

  2. #2
    Join Date
    Jan 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Blackbox button tooltip

    Hi,

    do not use

    widget->setStyleSheet("background-color: transparent;");

    use

    QPalette palette = widget->palette();
    palette.setColor(widget->backgroundRole(), QColor(0, 0, 0, 0));
    widget->setPalette(palette);

    Peter
    Last edited by woswoasi; 20th January 2012 at 12:38.

  3. #3
    Join Date
    May 2011
    Posts
    23
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Blackbox button tooltip

    Hi Peter

    Thanks for your reply.

    Your suggestion does restore the tooltip but the background then appears on buttons of irregular shapes such as rounded shapes (circled buttons). The tooltip is restored, but the transparency fails...

    I still haven't resolved it and decided not to use tool tips (well at least this way all buttons are properly displayed with transparent backgrounds).

    Any more ideas, always welcome.

    Cheers.

    Jean

Similar Threads

  1. Regarding tooltip
    By ashishsaryar in forum Qt Programming
    Replies: 1
    Last Post: 24th December 2011, 08:32
  2. Replies: 4
    Last Post: 6th April 2010, 00:46
  3. Tooltip in Qwt
    By Ankitha Varsha in forum Qwt
    Replies: 5
    Last Post: 8th December 2009, 12:07
  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. ToolTip....
    By merry in forum Qt Programming
    Replies: 27
    Last Post: 3rd August 2007, 10:42

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.