Results 1 to 3 of 3

Thread: QLabel mouse event problem

  1. #1
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QLabel mouse event problem

    Hi every body!
    i want to know when my label is selected with user my code is this but doesn't work

    Qt Code:
    1. class ImageLabel : public QLabel
    2. {
    3. Q_OBJECT
    4. public:
    5. ImageLabel(QWidget* parent=0);
    6.  
    7. signals:
    8. void selected();
    9. protected:
    10. void mousePressEvent( QMouseEvent* event );
    11.  
    12. };
    13.  
    14. void ImageLabel::mousePressEvent (QMouseEvent* eve)
    15. {
    16. if(eve->button() == Qt::LeftButton)
    17. {
    18. emit selected();
    19. }
    20. }
    To copy to clipboard, switch view to plain text mode 

    program compiled but after clicking label doesn't happened everything

  2. #2
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QLabel mouse event problem

    Thats Solved!

  3. #3
    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: QLabel mouse event problem

    How ?
    It might be of some use to others

Similar Threads

  1. Replies: 10
    Last Post: 16th July 2011, 12:29
  2. create mouse click event problem
    By yagabey in forum Qt Programming
    Replies: 6
    Last Post: 8th October 2009, 21:45
  3. problem in mouse event
    By bhogasena in forum Qt Programming
    Replies: 0
    Last Post: 28th January 2009, 12:58
  4. Mouse click event problem
    By impeteperry in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2007, 13:44
  5. Clearing a QLabel since the mouse position
    By SkripT in forum Qt Programming
    Replies: 10
    Last Post: 18th January 2006, 18:23

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.