Results 1 to 7 of 7

Thread: signal slot conection using a string, not a SLOT

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    30
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: signal slot conection using a string, not a SLOT

    WOW... it works great.

    I had to adjust my string to be "1copy ()" instead of "copy", and it works. I wonder why they add the 1 to the end of this? Seems this makes things a bit more difficult. I'm there is a reason.

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

    Default Re: signal slot conection using a string, not a SLOT

    It's an easy way to distinguish between methods ("0"), slots ("1"), signals ("2") and garbage (??).

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    85
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: signal slot conection using a string, not a SLOT

    They prepend a digit because in C++ no identifiers like method or variable names may start with a digit. That way you can distinguish between the types like wysota mentioned.

  4. The following user says thank you to Codepoet for this useful post:

    rianquinn (21st March 2006)

Similar Threads

  1. Replies: 0
    Last Post: 18th February 2009, 14:31
  2. pthread instead QThread
    By brevleq in forum Qt Programming
    Replies: 8
    Last Post: 23rd December 2008, 08:16
  3. Connection of custon signals/slots
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 23rd December 2008, 08:04
  4. Replies: 12
    Last Post: 18th September 2008, 16:04
  5. Signal & Slot editor
    By Ishark in forum Qt Tools
    Replies: 4
    Last Post: 28th May 2008, 16:20

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
  •  
Qt is a trademark of The Qt Company.