#ifndef STAT_H
#define STAT_H
#include <QtNetwork>
#include <QtGui>
#include "ui_stat.h"
class Stat
: public QDialog,
public Ui
::dialog{
Q_OBJECT
public:
{
setupUi ( this );
connect (&http, SIGNAL( requestFinished(int,bool)),this,SLOT(end()));
connect ( statButton, SIGNAL ( clicked ( ) ), this, SLOT ( send ( ) ) );
http.
setHost ( host,
QHttp::ConnectionModeHttps );
}
{
data.append ( "FindUserName=");
data.append (input1);
data.append ( "&FindUserPass=");
data.append ( input2 );
outFile .setFileName ( "out.html" );
QSslSocket *socket = new QSslSocket;
socket->connectToHostEncrypted ( "stat.ultranet.ru", 443 );
if ( socket->waitForEncrypted ( 5000) )
{
http.setSocket ( socket );
header.setValue ( "Content-Type", "application/x-www-form-urlencoded" );
header.setValue ( "Host", "stat.ultranet.ru" );
http.request ( header, data, &outFile );
}
}
public slots:
void end( )
{
outFile.close ( );
emit done();
}
void send ( )
{
sendData ( loginLineEdit ->text( ), passwLineEdit ->text( ) ) ;
}
signals:
void done( );
private:
};
#endif