Results 1 to 3 of 3

Thread: Signal and Slots with Large Parameters

  1. #1
    Join Date
    Jul 2009
    Posts
    39
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Signal and Slots with Large Parameters

    Is it a good idea to pass big parameters with signal and slot mechanism such as XML files, structs and classes? Are there any restriction and what can be the alternatives?

  2. #2
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Signal and Slots with Large Parameters

    The argument is going to be copied, so you have to consider that cost. Consider using one of Qt's implicitely shared classes, then you will have no problem at all.

  3. #3
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Signal and Slots with Large Parameters

    I think it is only copied when using a Queued connection. Spud: Do you have a reference for always copying?
    It's nice to be important but it's more important to be nice.

Similar Threads

  1. Replies: 3
    Last Post: 3rd May 2009, 14:15
  2. Slots & Signals w/ parameters passed by reference.
    By Wazman in forum Qt Programming
    Replies: 7
    Last Post: 20th December 2008, 00:13
  3. How many copies of Signal parameters
    By Doug Broadwell in forum Newbie
    Replies: 3
    Last Post: 2nd December 2006, 21:34
  4. Signals and Slots (with structure as parameters)
    By vishwanath in forum Qt Programming
    Replies: 4
    Last Post: 22nd November 2006, 20:14
  5. Unused parameters in slots
    By ePharaoh in forum Qt Programming
    Replies: 3
    Last Post: 22nd March 2006, 08:30

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.