Results 1 to 3 of 3

Thread: Click SIGNAL on QFrame

  1. #1
    Join Date
    Jul 2009
    Posts
    36
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Click SIGNAL on QFrame

    Is there any SIGNAL on click event of Frame.

    Like in QListWidgetItem we can use

    Qt Code:
    1. connect(contentsWidget,
    2. SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)),
    3. this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*)));
    To copy to clipboard, switch view to plain text mode 

    but Is there any event which occur when user clicked on Frame.

    I have created 3 frames and on selecting a single frame I want to do different activity.

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Click SIGNAL on QFrame

    QFrame has not such signal, you should handle QMouseEvent. there is two options how to achieve this:
    1. install event filter on your frame and handle mouse click.
    2. subclass QFrame and reimplement mousePressEvent/mouseReleaseEvent.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

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

    sosanjay (8th December 2009)

  4. #3
    Join Date
    Jul 2009
    Posts
    36
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Click SIGNAL on QFrame

    Thanks Spirit,

    Its working, By using

    eventFilter(QObject *o,QEvent *e)

Similar Threads

  1. Replies: 4
    Last Post: 27th November 2009, 13:00
  2. pthread instead QThread
    By brevleq in forum Qt Programming
    Replies: 8
    Last Post: 23rd December 2008, 07:16
  3. Connection of custon signals/slots
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 23rd December 2008, 07:04
  4. QTreeWidget double click signal
    By Pinco Pallino in forum Newbie
    Replies: 2
    Last Post: 18th November 2006, 16:37

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.