// -*- c++ -*- #include #include #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) // Qt4 support #include using WebView = QWebView; #else #include using WebView = QTextEdit; #endif class Server : public QObject { Q_OBJECT public: Server(WebView& webview, QObject *parent = 0); signals: void dataReceived(QByteArray); private slots: void newConnection(); void disconnected(); void readyRead(); private: QTcpServer *server; WebView& webview; QString html; int size{-1}; };