mirror of
				https://github.com/YACReader/yacreader
				synced 2025-11-04 01:05:06 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
		
			567 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			567 B
		
	
	
	
		
			C++
		
	
	
	
	
	
#ifndef __HTTP_WORKER_H
 | 
						|
#define __HTTP_WORKER_H
 | 
						|
 | 
						|
#include <QWidget>
 | 
						|
#include <QByteArray>
 | 
						|
#include <QThread>
 | 
						|
#include <QUrl>
 | 
						|
#include "yacreader_global.h"
 | 
						|
 | 
						|
 class HttpWorker : public QThread
 | 
						|
 {
 | 
						|
		 Q_OBJECT
 | 
						|
	public:
 | 
						|
		HttpWorker(const QString & urlString);
 | 
						|
	public slots:
 | 
						|
		void get();
 | 
						|
		QByteArray getResult();
 | 
						|
		bool wasValid();
 | 
						|
		bool wasTimeout();
 | 
						|
	private:
 | 
						|
		void run();
 | 
						|
		QUrl url;
 | 
						|
		int httpGetId;
 | 
						|
		QByteArray result;
 | 
						|
		bool _error;
 | 
						|
		bool _timeout;
 | 
						|
	signals:
 | 
						|
		void dataReady(const QByteArray &);
 | 
						|
		void timeout();
 | 
						|
 };
 | 
						|
 | 
						|
#endif
 |