Results 1 to 4 of 4

Thread: Tooltip has undesired border

  1. #1
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Tooltip has undesired border

    Hi,

    I do toolButton->setStyleSheet( "border: 2px solid red;" ) to highlight a tool button. The button contains a QAction that has tooltip. When hover over the button, the tool tip has same border as the button, which is not desired. What can I do so that the tooltip doesn't inherit the button's border? Please see the attachment.

    Thanks
    Attached Images Attached Images

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Tooltip has undesired border

    Read about the Qt Style sheets in Qt Assistant..
    u can limit the hierarchy using "." ">" .
    like .QPushButton { ....}

  3. #3
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Tooltip has undesired border

    I think it should be like this:
    Qt Code:
    1. toolButton->setStyleSheet("QToolButton { border: 2px solid red; }");
    To copy to clipboard, switch view to plain text mode 

    P.S. But, as aamer4yu said, few minutes with style sheet reference in Qt Assistant is highly recommended.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  4. #4
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Tooltip has undesired border

    Thank you both! That works great!

    I am surprised to find also that when I setStatusTip in the QAction, it automatically finds the QStatusBar in the QMainWindow and display it there, although the QAction is in QMdiSubWindow many levels down the widget tree. Was thinking how I can let the QAction know where the QStatusBar is.....


Similar Threads

  1. Replies: 5
    Last Post: 14th April 2009, 08:27
  2. Extended Tooltip
    By aamer4yu in forum Qt Programming
    Replies: 12
    Last Post: 26th July 2008, 11:18
  3. Showing QWidget border around the window
    By maverick_pol in forum Qt Programming
    Replies: 2
    Last Post: 20th March 2008, 20:14
  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. How to create a movable border between two widgets?
    By Teuniz in forum Qt Programming
    Replies: 2
    Last Post: 16th March 2007, 08:45

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.