[Qt-interest] Need to show a dialog on click of QLabel

chandrasekar wagmare sekarwagmare at gmail.com
Thu May 14 11:42:12 CEST 2009


create your own signal:
 signals:
          void activated();

reimplement
  void mousePressEvent(QMouseEvent *event); in your QLabel class

  void LabelClick:: mousePressEvent(QMouseEvent *event){
          if(event->button() != Qt::LeftButton)
                {
                        QGraphicsRectItem::mousePressEvent(event);
                        return;
                }
                emit activated();   //this is your customize signal ..
emitting on left click of mouse
  }

connect it to a slot ...l

On Thu, May 14, 2009 at 2:55 PM, Kamakshi Sivaraman <
Kamakshi.Sivaraman at lntinfotech.com> wrote:

>
> Hi All,
>
> I need to show a dialog on click of QLabel.
> Please tell, how can I do that.
>
>
>
> Thanks & Regards,
> S.KAMAKSHI
> Larsen & Toubro Infotech Limited
> Whitefield,
> Bangalore -560066
> *
> Larsen & Toubro Infotech Ltd.**
> **www.Lntinfotech.com* <http://www.lntinfotech.com/>
>
> This Document is classified as:
>
> L&T Infotech Proprietary   L&T Infotech Confidential   L&T Infotech
> Internal Use Only   L&T Infotech General Business
>
> This Email may contain confidential or privileged information for the
> intended recipient (s) If you are not the intended recipient, please do not
> use or disseminate the information, notify the sender and delete it from
> your system.
> ______________________________________________________________________
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>


-- 
WAGMARE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090514/c6c66980/attachment.html 


More information about the Qt-interest-old mailing list