SiteWeb visité

Fermé
abourainformatique Messages postés 13 Date d'inscription dimanche 16 mars 2014 Statut Membre Dernière intervention 3 avril 2014 - 3 avril 2014 à 07:20
Bonjour,
j'ai commencé à écrire un programme en C++:
afficher la liste de site Web visités pour contrôler mon poste.
code:
header.h:
#ifndef HEADER_FENPRINCIPALE
#define HEADER_FENPRINCIPALE


#include <QtGui>
#include <QtWebKit>


class FenPrincipale :: public QMainWindow
{
Q_OBJECT


public:
FenPrincipale();


private:
void creerActions();
void creerMenus();
void creerBarresOutils();
void creerBarreEtat();
QWidget *creerOngletPageWeb(QString url = "");
QWebView *pageActuelle();


private slots:
void precedente();
void suivante();
void accueil();
void stop();
void actualiser();

void aPropos();
void nouvelOnglet();
void fermerOnglet();
void chargerPage();
void changementOnglet(int index);

void changementTitre(const QString & titreComplet);
void changementUrl(const QUrl & url);
void chargementDebut();
void chargementEnCours(int pourcentage);
void chargementTermine(bool ok);


private:
QTabWidget *onglets;


QAction *actionNouvelOnglet;
QAction *actionFermerOnglet;
QAction *actionQuitter;
QAction *actionAPropos;
QAction *actionAProposQt;
QAction *actionPrecedente;
QAction *actionSuivante;
QAction *actionStop;
QAction *actionActualiser;
QAction *actionAccueil;
QAction *actionGo;


QLineEdit *champAdresse;
QProgressBar *progression;
};


#endif


source.cpp:

#include "Header.h"



MainWindow::MainWindow() : QMainWindow()
{
QMainWindow fenetre;

//création du menu
QMenu *menuFichier = menuBar()->addMenu(tr("&Fichier", "menu fichier"));
QMenu *menuNavigation = menuBar()->addMenu(tr("&Navigation", "menu navigation"));

//
//Creation sub menu Fichier
QAction *ouvrirUrl = menuFichier->addAction(tr("Ouvrir une URL"));
QAction *Onglet = menuFichier->addAction(tr("Ouvrir un nouvel onglet"));
QAction *ouvrirPage = menuFichier->addAction(tr("Ouvrir une nouvelle page"));

//
//Création sub menu navigation
QAction *precedent = menuNavigation->addAction(tr("précédent"));
QAction *suivant = menuNavigation->addAction(tr("suivant"));
QAction *arreter = menuNavigation->addAction(tr("arrêter le chargement de la page"));
QAction *actualiser = menuNavigation->addAction(tr("actualiser la page web"));
precedent->setIcon(QIcon("./previous.png"));
suivant->setIcon(QIcon("./next.png"));
arreter->setIcon(QIcon("./stop.png"));
actualiser->setIcon(QIcon("./actualiser.png"));
//
//
//
//Création Barre d'outil
QToolBar *toolBar = addToolBar(tr("Navigation"));
toolBar->addAction(precedent);
toolBar->addAction(suivant);
toolBar->addAction(arreter);
toolBar->addAction(actualiser);
url = new QLineEdit;
toolBar->addWidget(url);
//
//
//
//Création Mdi
onglet = new QMdiArea;
acceuil = new QString("https://www.google.fr/?gws_rd=ssl");
ouvrirOnglet(acceuil);
//this->ouvrirOnglet(acceuil);
url->setText(pageActuelle()->url().toString());

//
//
//
//
//Les connexions
connect(precedent, SIGNAL(triggered()), this, SLOT(precedent()));
connect(suivant, SIGNAL(triggered()), this, SLOT(suivant()));
connect(arreter, SIGNAL(triggered()), this, SLOT(arreter()));
connect(actualiser, SIGNAL(triggered()), this, SLOT(actualiser()));
connect(url, SIGNAL(returnPressed()), this, SLOT(allerALaPage()));

/////////C'est ce SLOT précisement////////////////////////////////

connect(Onglet, SIGNAL(triggered()), this, SLOT(nouvelOnglet()));

////////////////////////////////////////////////////////////////

//connect(ouvrirPage,SIGNAL(triggered()), this,SLOT(nouvelFenetre()));
connect(onglet, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(changerUrl()));
connect(onglet, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(changerTitre()));
ouvrirAcceuil();
}

///////////////////////La fonction appelée par le SLOT

void MainWindow::ouvrirOnglet(QString *adresse)
{
QWebView* web = new QWebView;
QWidget *wWeb = new QWidget;
QVBoxLayout *vLayout = new QVBoxLayout;
vLayout->addWidget(web);
wWeb->setLayout(vLayout);
onglet->addSubWindow(wWeb);
web->load(*adresse);
onglet->setViewMode(QMdiArea::TabbedView);
setCentralWidget(onglet);
connect(web, SIGNAL(urlChanged(QUrl)), this, SLOT(changerUrl()));
connect(web, SIGNAL(titleChanged(QString)), this, SLOT(changerTitre()));

}

/////////////////////////////////////////////////

QWebView *MainWindow::pageActuelle()
{
return onglet->currentSubWindow()->widget()->findChild<QWebView *>();
}

void MainWindow::precedent()
{
pageActuelle()->back();
}

void MainWindow::suivant()
{
pageActuelle()->forward();
}

void MainWindow::arreter()
{
pageActuelle()->stop();
}

void MainWindow::actualiser()
{
pageActuelle()->reload();
}

void MainWindow::allerALaPage()
{
pageActuelle()->load(url->text());
}

void MainWindow::changerUrl()
{
url->setText(pageActuelle()->url().toString());
}

void MainWindow::changerTitre()
{
onglet->currentSubWindow()->widget()->setWindowTitle(pageActuelle()->title());
}

////////////////////Voila la definition du slot
void MainWindow::nouvelOnglet()
{
ouvrirOnglet(acceuil);
}
///////////////////////////

void MainWindow::ouvrirAcceuil()
{
ouvrirOnglet(acceuil);
}


errors:
error C1083: connot open include file:'QtGui': no such file or directory

S'il vaut plait, Quelle est la solution pour mon problème? Existe-il une autre méthode très clair que ça?

merci.