Results 1 to 2 of 2

Thread: tool tip for label

  1. #1
    Join Date
    Feb 2006
    Posts
    42
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question tool tip for label

    Hi all,

    Is it possible to add tool tip to a label? I tried to subclass QLabel , here is the code I had written,

    #include <QLabel>

    class QLabel;
    class QMouseEvent;

    class MutateLabel : public QLabel
    {
    Q_OBJECT
    public:
    MutateLabel( QString, QWidget * );

    protected:

    virtual void mousePressEvent( QMouseEvent * );

    };
    MutateLabel::MutateLabel( QString str, QWidget *parent )
    : QLabel(str, parent )
    {}

    void MutateLabel::mousePressEvent( QMouseEvent *e )
    {

    }
    I dont know how to proceed further. Can some body suggest some thing on this

    Thanks in Advance,
    Seema Rao

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: tool tip for label

    Why subclass?

    Qt Code:
    1. QLabel *label = new QLabel("label", this);
    2. label->setToolTip("Some tooltip");
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to wysota for this useful post:

    georgie (11th May 2006)

Similar Threads

  1. Tool for web application?
    By cool_qt in forum General Programming
    Replies: 3
    Last Post: 9th December 2008, 09:21
  2. tool buttons on top of label
    By McKee in forum Qt Programming
    Replies: 5
    Last Post: 2nd November 2008, 16:07
  3. Tool Tip
    By Rakesh_Kumar in forum Qt Programming
    Replies: 9
    Last Post: 3rd October 2008, 13:01
  4. Open source automated testing tool for Qt App
    By William Wilson in forum Qt Programming
    Replies: 21
    Last Post: 5th December 2007, 16:56
  5. Problem with unified tool bar on Mac OS X
    By m_e in forum Qt Programming
    Replies: 1
    Last Post: 7th August 2007, 11:21

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.