Results 1 to 2 of 2

Thread: Problem with Signals and Slots

  1. #1
    Join Date
    Apr 2012
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem with Signals and Slots

    I know that I can only connect signals and slots between objects. I encounter this situation where I reimplement the mouseReleaseEvent of a QGraphicsLineItem object (e.g. myCable Class, cable object) and I wish to connect it to a QGraphicsScene object (e.g. myScene Class, scene object) but the object for myCable class was created in the scene.

    Can someone give me some advice, I think I might have done something wrong here.

  2. #2
    Join Date
    Sep 2011
    Location
    Mannheim, Germany
    Posts
    22
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with Signals and Slots

    declare your own signal, connect it to your object and emit it where ever you want.

    Make sure that your emitting object is subclassed from QObject.

Similar Threads

  1. Signals and Slots Problem
    By GenericProdigy in forum Qt Programming
    Replies: 4
    Last Post: 2nd February 2009, 09:06
  2. Problem with signals & slots
    By Palmik in forum Qt Programming
    Replies: 4
    Last Post: 17th January 2009, 22:45
  3. Signals And Slots problem
    By ldiamond in forum Newbie
    Replies: 7
    Last Post: 23rd March 2008, 00:11
  4. Problem with signals and slots
    By conexion2000 in forum Qt Programming
    Replies: 2
    Last Post: 23rd March 2006, 10:20
  5. Problem with Signals and Slots
    By Kapil in forum Newbie
    Replies: 11
    Last Post: 15th February 2006, 11: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.