Advertisement
Guest User

Untitled

a guest
Feb 14th, 2024
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include <QGuiApplication>
  2. #include <QQmlApplicationEngine>
  3. #include <QtWebView>
  4. #include <QWebChannel>
  5. #include <QWebSocketServer>
  6. #include "websockettransport.h"
  7. //#include <QQmlContext>
  8.  
  9. int main(int argc, char *argv[])
  10. {
  11. QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
  12.  
  13. QGuiApplication app(argc, argv);
  14.  
  15. // foreach(QString filename, QDir(app.applicationDirPath()).entryList())
  16. // {
  17. // qDebug() << "- " << filename;
  18. // }
  19.  
  20. // don't forget about this
  21. QtWebView::initialize();
  22.  
  23. qmlRegisterType<WebSocketTransport>("io.decovar.WebSocketTransport", 1, 0, "WebSocketTransport");
  24.  
  25. QQmlApplicationEngine engine;
  26. // engine.rootContext()->setContextProperty("applicationDirPath", QGuiApplication::applicationDirPath());
  27. engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
  28. if (engine.rootObjects().isEmpty()) { return -1; }
  29.  
  30. return app.exec();
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement