initialize вместо singleShot

This commit is contained in:
2026-02-09 16:23:40 +03:00
parent 6387b41f9b
commit f03632c56e
3 changed files with 9 additions and 11 deletions

View File

@@ -67,10 +67,7 @@ MainWindow::MainWindow(QWidget *parent) :
//slot_Tray_ShowMessage(tr("Starting the server..."));
ui->verticalLayout_Main->addWidget(serverLMSWidget);
//Отложенная инициализация (для serverLMSWidget)
QTimer::singleShot(1000, this, &MainWindow::slot_LazyInitialization);
ui->verticalLayout_Main->addWidget(serverLMSWidget);
}
MainWindow::~MainWindow()
@@ -112,6 +109,11 @@ void MainWindow::changeEvent(QEvent *event)
}
}
void MainWindow::initialize()
{
serverLMSWidget->startInitialization();
}
void MainWindow::slot_TrayIconActivated(QSystemTrayIcon::ActivationReason reason)
{
if(flInitServerLMSWidget)
@@ -198,11 +200,6 @@ void MainWindow::slot_updateStateServer(EStateServer stateServer, EStateBlockAut
}
}
void MainWindow::slot_LazyInitialization()
{
serverLMSWidget->startInitialization();
}
void MainWindow::slot_hasError(int code)
{
if(code == 100)