Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QWebView don't display local html

QWebView don't display local html

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Phenixo
    wrote on last edited by
    #1

    @mainWind::mainWind(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::mainWind)
    {
    ui->setupUi(this);
    QWebView *pageWeb=new QWebView();
    pageWeb->load(QUrl("html/pagevide.htm"));
    ui->tabWidget->insertTab(ui->tabWidget->indexOf(ui->nouveauongle),pageWeb,"a");
    ui->toolBar_2->insertWidget(ui->action_R_tablire,ui->champAdresse);
    setCentralWidget(ui->tabWidget);
    ui->statusbar->addPermanentWidget(ui->progressBar);
    ui->statusbar->setVisible(false);
    connect(ui->actionNouveaux_onglet,SIGNAL(triggered()),this,SLOT(ajouterOngle()));
    connect(ui->tabWidget,SIGNAL(currentChanged(int)),this,SLOT(changeOngle(int)));

    }
    @

    the problem is that qwebview don't display the html (there is a photo in the html)

    to be a professional programmer is my goal :p

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      The current working directory of the program is probably not where you think it is and therefore the relative path to the HTML file is not resolving to where you think it is.

      You should also look at QUrl::fromLocalFile()

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved