Results 1 to 2 of 2

Thread: Qt5 signal/slot syntax - automatically disconnecting?

  1. #1
    Join Date
    Jul 2012
    Posts
    244
    Thanks
    27
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt5 signal/slot syntax - automatically disconnecting?

    Quick question, I am in the process of moving to the new Qt5 signal/slot syntax. I am connecting instances of classes, no adventurous things like lambdas, function pointers or similar things.


    With the old syntax, the connection was disconnected() when one of the participants was destroyed, and thus i never cared at all about diconnecting in my code. This behavior is still the same, right? The documentation is unclear here - it says manually disconnects are necessary, but i am pretty sure it refers only to lambdas (?).


    During my tests automatically disconnecting seemed to work fine - but we are awfully close to the land of undefined behavior, so i wanted to ask.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt5 signal/slot syntax - automatically disconnecting?

    Quote Originally Posted by tuli View Post
    This behavior is still the same, right?
    Yes, nothing changed in this regard.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 1
    Last Post: 14th August 2014, 18:08
  2. Replies: 6
    Last Post: 4th March 2014, 16:09
  3. Replies: 2
    Last Post: 26th October 2013, 06:40
  4. Replies: 8
    Last Post: 7th November 2012, 15:10
  5. Replies: 11
    Last Post: 20th April 2011, 22:53

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.