Results 1 to 10 of 10

Thread: Creating click events for label

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Creating click events for label

    Qt Code:
    1. #include <QMouseEvent>
    2.  
    3. class ClickLabel : public QObject
    4. {
    5. Q_OBJECT
    6. ....
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Nov 2011
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Creating click events for label

    Is it easy to inherit the functionality of the QLabel class into the new class, so that I can easily use the same features like set text, and stuff of that nature?

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Creating click events for label

    Yes, inherit from QLabel and not QObject.

Similar Threads

  1. Replies: 0
    Last Post: 17th March 2011, 19:38
  2. Click events
    By Maluko_Da_Tola in forum Newbie
    Replies: 0
    Last Post: 26th August 2010, 01:05
  3. how to get the position of mouse click on a label
    By qt_user in forum Qt Programming
    Replies: 1
    Last Post: 9th August 2010, 09:14
  4. Detect click on QTableWidget label
    By Darthspawn in forum Qt Programming
    Replies: 1
    Last Post: 12th March 2010, 10:50
  5. close window when click on a label
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 29th October 2007, 07:35

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
  •  
Qt is a trademark of The Qt Company.