port of EQL/Qt4 to Qt5

This commit is contained in:
polos 2016-11-25 23:30:38 +01:00
commit 0591f54ce8
339 changed files with 99935 additions and 0 deletions

View file

@ -0,0 +1,31 @@
#include <QtCore>
#include <QtNetwork>
#include <QtDebug>
#include <iostream>
int main(int argc, char** argv) {
QCoreApplication qapp(argc, argv);
QLocalSocket socket;
socket.connectToServer("EQL:local-server");
socket.waitForConnected();
qapp.processEvents();
QString exp(QCoreApplication::arguments().at(1));
if(socket.isWritable()) {
QString data(QString::number(exp.size()) + " " + exp);
socket.write(data.toLatin1());
qapp.processEvents();
socket.waitForBytesWritten();
while(true) {
socket.waitForReadyRead();
qapp.processEvents();
QString data(socket.readAll());
QString type(data.section(' ', 1, 1));
if(!(":EXPRESSION" == type)) {
QString print(data.section(' ', 2).trimmed());
if(!print.isEmpty()) {
std::cout << qPrintable(print) << std::endl; }
if(":VALUES" == type) {
exit(0); }}}}
qCritical() << "[send] error:" << exp;
return -1; }