Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Rounded Corner Tooltips
Forum Updated to NodeBB v4.3 + New Features

Rounded Corner Tooltips

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 5.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DotW
    wrote on last edited by
    #1

    Hi,

    I'm trying to set styles for Tooltips, using app.setStyleSheet(). The color and padding are all OK, but the border-radius doesn't work. The tooltips are always in rectangle with straight corners.
    Here is my code to set the style sheet.

    @app.setStyleSheet("QToolTip {font-size:12pt; color:white; padding:2px; border-width:2px; border-style:solid; border-radius:4px }");@

    Does QToolTip support "border-radius" style property?
    Otherwise, how can I implement rounded corner tooltips?

    Thanks,
    Walter

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sigrid
      wrote on last edited by
      #2

      When running the example below using Windows 7 and Qt 4.7.2, the corners of the tooltip are rounded for me. Does the example below reproduce the problem you are having? If so, which Qt version are you using and on which platform? If not, can you modify the example so that it reproduces your issue?

      @#include <QtGui>

      int main(int argc, char** argv)
      {
      QApplication app(argc, argv);
      app.setStyleSheet("QToolTip {font-size:12pt; color:white; padding:2px; border-width:2px; border-style:solid; border-radius:4px }");
      QWidget wid;
      wid.setToolTip("ToolTip");
      wid.resize(100, 200);
      wid.show();
      return app.exec();
      }@

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DotW
        wrote on last edited by
        #3

        I'm using Qt opensource sdk 4.7.0.
        I tried the example on both Ubuntu 10.10 and Meego.
        With your given code, the ToolTip also displayed in rectangle on Ubuntu 10.10.
        Thanks.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved