texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Gavin D. Smith
Date: Wed, 30 Nov 2022 13:36:24 -0500 (EST)

branch: old/qt-info
commit 9559cb8211d4e487a8dd51ad2a3833cf50f79b1b
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Apr 7 14:26:34 2019 +0100

    use Qt object tree to destroy objects
---
 js/docbrowser/mainwindow.cpp | 13 ++++++++-----
 js/docbrowser/mainwindow.h   |  3 ---
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/js/docbrowser/mainwindow.cpp b/js/docbrowser/mainwindow.cpp
index 4d260654e0..c939e742ff 100644
--- a/js/docbrowser/mainwindow.cpp
+++ b/js/docbrowser/mainwindow.cpp
@@ -20,21 +20,24 @@ MainWindow::MainWindow(QWidget *parent) :
 
     connect(ui->actionQuit, &QAction::triggered, this, &MainWindow::quit);
 
-    server = new QWebSocketServer
-(QStringLiteral("QWebChannel Standalone Server"), 
QWebSocketServer::NonSecureMode);
+    auto *server = new QWebSocketServer
+               (QStringLiteral("QWebChannel Standalone Server"),
+                QWebSocketServer::NonSecureMode,
+                this);
 
 // we shouldn't hardcode a number here.  what if the program is run twice at 
the same time?
     if (!server->listen(QHostAddress::LocalHost, 12345)) {
         qFatal("Failed to open web socket server.");
     }
 
-    clientWrapper = new WebSocketClientWrapper(server);
+    auto *clientWrapper = new WebSocketClientWrapper(server, this);
 
 
-    channel = new QWebChannel;
+    auto *channel = new QWebChannel(this);
     QObject::connect(clientWrapper, &WebSocketClientWrapper::clientConnected,
                          channel, &QWebChannel::connectTo);
-    core = new Core;
+
+    auto *core = new Core(this);
     channel->registerObject(QStringLiteral("core"), core);
 
 
diff --git a/js/docbrowser/mainwindow.h b/js/docbrowser/mainwindow.h
index 17548e3a3e..f85119b330 100644
--- a/js/docbrowser/mainwindow.h
+++ b/js/docbrowser/mainwindow.h
@@ -26,9 +26,6 @@ private slots:
 private:
     Ui::MainWindow *ui;
 
-    QWebChannel *channel;
-    QWebSocketServer *server;
-    WebSocketClientWrapper *clientWrapper;
     Core *core;
 
     QString qwebchannel_js;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]