Important: Please read the Qt Code of Conduct -

QWebView local html problem

  • hi,
    @void mainWind::ajouterOngle()
    QWidget *ongle = new QWidget;
    QWebView *pageweb =new QWebView;
    QVBoxLayout *layout=new QVBoxLayout;

    when I compile all goes well, but in the program as I call this method “microsoft visual c + + runtime library” error
    I try to solve the problem and I noticed that Error is in line 7 load (local html file) when I delet it there is no problem and all goes well so how do I load (local html file )

    I intend that this problem is because of “http://” I didn’t put it in QUrl because it is a local file

    and I notice that other browser makes “file :/ / / html / pagevide.html” in url so I change all goes well but I noticed that the browser does not load the file because nothing is wrote in Urlbar and the page didn’t display (because I put an image in the html file) and the same problem when I write
    @ pageActuelle () -> load (QUrl :: fromLocalFile ("html / pagevide.html"))@

    Note: I have put the html file in the program directory

  • please give me a answer to this Forum :’(

  • Hi

    you fail to call show() function.

    give like this.

    without give show function , nothing will show. it call default function of hide()

  • Hi

    why you are using QVBoxLayout?

  • i use th layout because I had the idea that will be better to organize my widget
    my problem is not with because if i change pagevide.html with the page google is displayed

Log in to reply