Rounded Corner Tooltips



  • 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



  • 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();
    }@



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.