Ok so after some trail and error i got a "downloaded" index page of Facebook.
And things are a bit clearer (litel bit atleast :>) and i came up with this code.
I know its not prety remember am only experementing any tips is great.
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(&networkManager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(onResult(QNetworkReply*)) );
}
MainWindow::~MainWindow()
{
delete ui;
}
// funtion used to login to facebook
void MainWindow
::sendLoginRecuest(QUrl url
) {
url = "https://www.facebook.com/";
netRequest.setUrl(url);
netReply = networkManager.get(netRequest);
}
// response to our login atempt
void MainWindow::reciveRecuest()
{
// Do somthing...
}
// Exit function
void MainWindow::on_actionExit_triggered()
{
close();
}
// Exit function \\
void MainWindow::on_loginButton_clicked()
{
sendLoginRecuest(url);
}
// This is what happens when the request is finsihed
void MainWindow::onResult(QNetworkReply *reply)
{
if (reply->error() != QNetworkReply::NoError)
{
"Request Faild: ",
} else {
"Request Completed with no errors. ",
ui->textBrowser->setText("Ok test");
QScriptEngine engine;
QScriptValue result = engine.evaluate(data);
ui->textBrowser->append(data);
}
ui->textBrowser->update();
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(&networkManager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(onResult(QNetworkReply*)) );
}
MainWindow::~MainWindow()
{
delete ui;
}
// funtion used to login to facebook
void MainWindow::sendLoginRecuest(QUrl url)
{
url = "https://www.facebook.com/";
netRequest.setUrl(url);
netReply = networkManager.get(netRequest);
}
// response to our login atempt
void MainWindow::reciveRecuest()
{
// Do somthing...
}
// Exit function
void MainWindow::on_actionExit_triggered()
{
close();
}
// Exit function \\
void MainWindow::on_loginButton_clicked()
{
sendLoginRecuest(url);
}
// This is what happens when the request is finsihed
void MainWindow::onResult(QNetworkReply *reply)
{
if (reply->error() != QNetworkReply::NoError)
{
QMessageBox::information(this, "Request Error: ",
"Request Faild: ",
QMessageBox::Ok );
} else {
QMessageBox::information(this, "Request Completed: ",
"Request Completed with no errors. ",
QMessageBox::Ok );
ui->textBrowser->setText("Ok test");
QString data = (QString) reply->readAll();
QScriptEngine engine;
QScriptValue result = engine.evaluate(data);
ui->textBrowser->append(data);
}
ui->textBrowser->update();
}
To copy to clipboard, switch view to plain text mode
As am shure you can see it just takes the text and puts it in a text browser.
Now am wondering
#1 How to find out what Url to use for the login do i use?
From Facebook source ( <form id="login_form" action="[B][FONT=Arial Black]https://www.facebook.com/login.php?login_attempt=1[/FONT][/B]" method="post" onsubmit="return window.Event .... )
From Facebook source ( <form id="login_form" action="[B][FONT=Arial Black]https://www.facebook.com/login.php?login_attempt=1[/FONT][/B]" method="post" onsubmit="return window.Event .... )
To copy to clipboard, switch view to plain text mode
#2 is it away for me to use the reply that i get to parse the username and password feald?
And then login?
#3 Or do i get the fealds for the login form manualy in the source code on the page (including the hidden ones?)
#4 Is it the reply.readAll() the correct method to use when trying somthing like this.
Am confused... 
Thanks to anyone how takes the time to help a newbie out.
Its much aprichiated (Like a kid on christmas i am hehe) 
Cheers
WetCode
Bookmarks