Results 1 to 5 of 5

Thread: [Qt4] Signal printRequest

  1. #1
    Join Date
    May 2010
    Posts
    22
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default [Qt4] Signal printRequest

    Hi.

    I'm trying to print QWebView mainframe content from javascript method 'window.print()'. I wrote line:

    QObject::connect(ui->webView->page(), SIGNAL('printRequested()'), SLOT(print()));

    And i have compilator info :

    No such signal QWebPage::'printRequested()' .
    i try diffrent constructions but always is info that no such signal...

    Maybe someone has a solution?
    Sorry for my english.
    Regards

  2. #2
    Join Date
    Apr 2010
    Location
    Rostov-na-Donu, Russia
    Posts
    153
    Thanks
    2
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [Qt4] Signal printRequest

    remove quotes like this:
    Qt Code:
    1. QObject::connect(ui->webView->page(), SIGNAL(printRequested()), SLOT(print()));
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    May 2010
    Posts
    22
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: [Qt4] Signal printRequest

    the same result :
    Object::connect: No such signal QWebPage:: printRequested() ...

  4. #4
    Join Date
    Apr 2010
    Location
    Rostov-na-Donu, Russia
    Posts
    153
    Thanks
    2
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [Qt4] Signal printRequest

    from Qt docs:
    void QWebPage:rintRequested ( QWebFrame * frame ) [signal]
    you should write your own slot like
    Qt Code:
    1. void MyWidget::onPrintRequested(QWebFrame * frame )
    2. {
    3. ...
    4. }
    To copy to clipboard, switch view to plain text mode 
    and connect in following way
    Qt Code:
    1. QObject::connect( ui->webView->page()
    2. , SIGNAL( printRequested( QWebFrame * ) )
    3. , SLOT( onPrintRequested(QWebFrame * ) )
    4. );
    To copy to clipboard, switch view to plain text mode 

  5. The following user says thank you to borisbn for this useful post:

    maston (6th May 2010)

  6. #5
    Join Date
    May 2010
    Posts
    22
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Thumbs up Re: [Qt4] Signal printRequest

    It works.
    Thank you very much

Similar Threads

  1. Replies: 3
    Last Post: 26th November 2009, 18:28
  2. signal mapping on pushbutton signal clicked
    By wagmare in forum Qt Programming
    Replies: 2
    Last Post: 17th March 2009, 07:54
  3. Signal-Signal Connections Between Threads
    By PhilippB in forum Qt Programming
    Replies: 2
    Last Post: 15th December 2008, 18:27
  4. Replies: 1
    Last Post: 8th November 2007, 17:11
  5. can i connect a signal to a signal
    By amit_pansuria in forum Qt Programming
    Replies: 1
    Last Post: 29th August 2007, 06:28

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.