MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), m_mutex(0), m_information_count(0), m_wifi(new Wifi()), m_wsettings(new WSettings()), m_wdevices(new WDevices()), m_wthread(new WThread()), m_translator(new QTranslator(this)), m_trayIcon(new QSystemTrayIcon(this)), m_restoreAction(new QAction(this)), m_quitAction(new QAction(this)), m_controlWifi(new QAction(this)), m_restartWifi(new QAction(this)), m_trayIconMenu(new QMenu(this)) { setupLanguage(); ui->setupUi(this); initUIValue(); setupTrayIcon(); setupSignalsSlots(); //setupDevicesForTest(); }
ServerWidget::ServerWidget() { qDebug() << "Thread ServerWidget " << thread(); server = new Server(); serverThread = new QThread(this); qDebug() << "Thread server before moving it " << server->thread(); server->moveToThread(serverThread); qDebug() << "Thread server after moving it" << server->thread(); serverThread->start(); // Doesn't actually start anything for server, just starts the event loop setupGUI(); setupSignalsSlots(); }