Results 1 to 3 of 3

Thread: hello~my slot has been connected but the slot function can't be called

  1. #1
    Join Date
    Aug 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Red face hello~my slot has been connected but the slot function can't be called

    Can U tell me why~Ps.I use GUI in the slot indirectly~

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: hello~my slot has been connected but the slot function can't be called

    No, how could we? We don't see your code...

  3. #3
    Join Date
    Aug 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: hello~my slot has been connected but the slot function can't be called

    en I will show my code if necessary~My project is sth like this:
    Qt Code:
    1. Class A{
    2. Q_OBJECT
    3. public slots:
    4. void slot();
    5. public:
    6. B b;
    7. A()
    8. } ;
    9.  
    10. Class B{
    11. Q_OBJECT
    12. signals:
    13. void signal();
    14. }
    15.  
    16. A::A()
    17. {
    18. connect(b,SIGNAL(signal()),this,SLOT(slot()));
    19. }
    20.  
    21. main(){
    22. A *a;
    23. a=new A;
    24. a=new A;
    25. }
    To copy to clipboard, switch view to plain text mode 
    the pointer point to another member of class A before delete it. My question is,can the system find the former 'A' and run the slot() function without a pointer pointing to it.
    Last edited by Lykurg; 26th August 2011 at 19:16. Reason: missing [code] tags

Similar Threads

  1. Connected QTimer slot not being called
    By Polnareff in forum Qt Programming
    Replies: 4
    Last Post: 27th July 2010, 15:55
  2. Disconnect slot when another is being connected
    By holst in forum Qt Programming
    Replies: 4
    Last Post: 8th September 2009, 09:49
  3. Slot gets called twice
    By greatgatsby in forum Newbie
    Replies: 7
    Last Post: 20th August 2009, 15:11
  4. SLOT not being called
    By steg90 in forum Qt Programming
    Replies: 4
    Last Post: 6th December 2007, 11:30
  5. Replies: 1
    Last Post: 6th March 2007, 15:27

Tags for this Thread

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.