I am trying to set up a user manual and followed the method in C++ Gui Programming with Qt. It worked exactly as planned on Qt Creator version 2.0 using Qt 4.7. I then transferred the code to Creator Version 2.4.1 using Qt 4.7.4 and it didn't work. At first the browser window would not load anything. I modified the code and now the manual shows, but it does not show the pictures. Here is what I have:
Original code
Qt Code:
  1. DlgHelpBrowser::DlgHelpBrowser(const QString &path, const QString &page,
  2. QWidget *parent) :
  3. QDialog(parent),
  4. ui(new Ui::DlgHelpBrowser)
  5. {
  6. ui->setupUi(this);
  7. setAttribute(Qt::WA_DeleteOnClose);
  8. setAttribute(Qt::WA_GroupLeader);
  9.  
  10. connect (ui->btnHome, SIGNAL(clicked()),
  11. ui->textBrowser, SLOT (home()));
  12. connect (ui->btnBack, SIGNAL(clicked()),
  13. ui->textBrowser, SLOT (backward()));
  14. connect (ui->btnClose, SIGNAL(clicked()),
  15. this, SLOT (close()));
  16. ui->textBrowser->setSearchPaths(QStringList() << path <<"/graphics");
  17. ui->textBrowser->setSource(page);
  18. }
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. void DlgHelpBrowser::showPage(const QString &page)
  2. {
  3. QString path= directoryOf("manual").absolutePath();
  4. DlgHelpBrowser *browser = new DlgHelpBrowser ( path, page);
  5. browser->resize(1000, 800);
  6. browser->show();
  7. }
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. QDir DlgHelpBrowser::directoryOf(const QString &subdir)
  2. {
  3. QDir dir(QApplication::applicationDirPath());
  4. if (dir.dirName().toLower()== "debug" || dir.dirName().toLower()=="release")
  5. dir.cdUp();
  6.  
  7. dir.cd(subdir);
  8. return dir;
  9. }
To copy to clipboard, switch view to plain text mode 
The code to run on Creator 2.4.1
Qt Code:
  1. DlgHelpBrowser::DlgHelpBrowser(const QString &path, const QString &page,
  2. QWidget *parent) :
  3. QDialog(parent),
  4. ui(new Ui::DlgHelpBrowser)
  5. {
  6. ui->setupUi(this);
  7. setAttribute(Qt::WA_DeleteOnClose);
  8. setAttribute(Qt::WA_GroupLeader);
  9.  
  10. connect (ui->btnHome, SIGNAL(clicked()),
  11. ui->textBrowser, SLOT (home()));
  12. connect (ui->btnBack, SIGNAL(clicked()),
  13. ui->textBrowser, SLOT (backward()));
  14. connect (ui->btnClose, SIGNAL(clicked()),
  15. this, SLOT (close()));
  16. QUrl loadPage =QUrl::fromLocalFile(page);//New line here
  17. ui->textBrowser->setSearchPaths(QStringList() << path <<"/graphics"); //I also tried path + "/graphics"
  18. ui->textBrowser->setSource(loadPage);
  19. ui->textBrowser->zoomIn(2);
  20. }
To copy to clipboard, switch view to plain text mode 

This shows the HTML file but the pictures are not there, just a picture icon. Any ideas?