Results 1 to 11 of 11

Thread: Difficulties in working with Webview

  1. #1
    Join Date
    Apr 2016
    Posts
    13
    Thanks
    8
    Qt products
    Qt5

    Default Difficulties in working with Webview

    Hi I have used in your application webview when I open a site with it and I click on the Download link and no further action will not download files Please do guide me
    thanks

  2. #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: Difficulties in working with Webview

    You forgot to post the code of your webview usage.

    Cheers,
    _

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

    MrCoder (17th April 2016)

  4. #3
    Join Date
    Apr 2016
    Posts
    13
    Thanks
    8
    Qt products
    Qt5

    Default Re: Difficulties in working with Webview

    Quote Originally Posted by anda_skoa View Post
    You forgot to post the code of your webview usage.

    Cheers,
    _
    Oh sorry I forgot
    Qt Code:
    1. import QtQuick 2.3
    2. import QtQuick.Window 2.2
    3. import QtQuick.Controls 1.4
    4. import QtWebKit 3.0
    5. WebView {
    6. id: webView1
    7. url:"..."
    8. opacity: 0
    9. width: Window.width
    10. height: Window.height
    11. objectName: "myWebView"
    12. focus: true
    13. }
    To copy to clipboard, switch view to plain text mode 

  5. #4
    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: Difficulties in working with Webview

    Ah.

    You need the "download request" handler from the experiemental module

    Qt Code:
    1. import QtQuick 2.0
    2. import QtWebKit 3.0
    3. import QtWebKit.experimental 1.0
    4.  
    5. WebView {
    6. experimental.onDownloadRequested: {
    7.  
    8. // set a download directory, keep suggested file name
    9. downloadItem.destinationPath = "downloads/" +
    10. downloadItem.suggestedFilename
    11.  
    12. // start download
    13. downloadItem.start()
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _

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

    MrCoder (17th April 2016)

  7. #5
    Join Date
    Apr 2016
    Posts
    13
    Thanks
    8
    Qt products
    Qt5

    Default Re: Difficulties in working with Webview

    Thanks for the help
    I have two more questions
    When the links that I click on another window opens in webview does not work what to do?
    I downloaded the files that are downloaded by IDM
    I will be grateful for help <3

  8. #6
    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: Difficulties in working with Webview

    I am afraid I didn't understand that.

    You click on a link in the webview?
    And another window opens?

    Cheers,
    _

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

    MrCoder (18th April 2016)

  10. #7
    Join Date
    Apr 2016
    Posts
    13
    Thanks
    8
    Qt products
    Qt5

    Default Re: Difficulties in working with Webview

    Once inside the firefox browser, a click on some links will open in a new tab, the links do not open in WebView

  11. #8
    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: Difficulties in working with Webview

    How would Firefox know that you want to open links in your program?

    Cheers,
    _

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

    MrCoder (18th April 2016)

  13. #9
    Join Date
    Apr 2016
    Posts
    13
    Thanks
    8
    Qt products
    Qt5

    Default Re: Difficulties in working with Webview

    No, I open a site on Firefox when I click on the links it will open in another window
    now, when the site opens in WebView, and I could not open the link I click on the links

  14. #10
    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: Difficulties in working with Webview

    I see.
    Have you checked if onNavigationRequested is invoked for those links?

    Btw, if you are developing something new, you might want to look into Qt5.6 and WebEngineView

    Cheers,
    _

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

    MrCoder (19th April 2016)

  16. #11
    Join Date
    Apr 2016
    Posts
    13
    Thanks
    8
    Qt products
    Qt5

    Default Re: Difficulties in working with Webview

    Thanking you
    all the links that Target is equal to _blank
    <a href="" target="_blank">Click here!</a>
    Within WebView when I click on this link does not work why?

Similar Threads

  1. Difficulties with QDateTime.
    By LaurentDuroisin in forum Qt Programming
    Replies: 2
    Last Post: 19th January 2016, 16:04
  2. Difficulties in Making PDF files in Mac PCs
    By ceraolo in forum Qt Programming
    Replies: 9
    Last Post: 17th April 2014, 16:45
  3. Difficulties compiling qt statically
    By tom989 in forum Installation and Deployment
    Replies: 1
    Last Post: 17th November 2012, 00:38
  4. Difficulties with QTableView and setModel
    By sekatsim in forum Qt Programming
    Replies: 11
    Last Post: 19th June 2008, 07:05
  5. QTableView header difficulties
    By croftj in forum Qt Programming
    Replies: 6
    Last Post: 30th January 2008, 20:58

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.