Results 1 to 2 of 2

Thread: Pass string to print slot (QPrintPreviewDialog)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Pass string to print slot (QPrintPreviewDialog)

    A slot can never have more arguments than the signal it is connected to.
    How would the computer know at the point of the emit which value to pass?

    Couple of options:
    You can store the string in a member of mainwindow.
    You can store the string as a dynamic property on the QPrinter.
    You could delegate printing to an instance of a specialized class that has the string to print as its member.

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    Rafaelpsmed (12th February 2015)

Similar Threads

  1. Pass a float value to a string
    By alitoh in forum Newbie
    Replies: 3
    Last Post: 11th April 2011, 17:38
  2. how to print string??
    By pratik in forum Qt Programming
    Replies: 7
    Last Post: 25th December 2010, 16:38
  3. Replies: 13
    Last Post: 30th November 2010, 12:47
  4. Replies: 4
    Last Post: 21st June 2009, 18:06
  5. signal slot conection using a string, not a SLOT
    By rianquinn in forum Qt Programming
    Replies: 6
    Last Post: 5th February 2006, 18:52

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.