PDA

View Full Version : QLabel mouse event problem



danics
11th March 2010, 13:30
Hi every body!
i want to know when my label is selected with user my code is this but doesn't work



class ImageLabel : public QLabel
{
Q_OBJECT
public:
ImageLabel(QWidget* parent=0);

signals:
void selected();
protected:
void mousePressEvent( QMouseEvent* event );

};

void ImageLabel::mousePressEvent (QMouseEvent* eve)
{
if(eve->button() == Qt::LeftButton)
{
emit selected();
}
}


program compiled but after clicking label doesn't happened everything

danics
11th March 2010, 13:37
Thats Solved!

aamer4yu
11th March 2010, 13:38
How ?
It might be of some use to others :rolleyes: