protected int ExecApplicationWithTimeout(int timeoutMs) { CancellationTokenSource cts = new CancellationTokenSource(); CancellationToken ct = cts.Token; Task.Factory.StartNew(() => { Thread.Sleep(timeoutMs); if (!ct.IsCancellationRequested) { _coreApplication.Exit(-1); } }, ct); var result = _coreApplication.Exec(); cts.Cancel(); return(result); }
private void CloseButton_Pressed() { QGuiApplication.Exit(); }