예제 #1
0
        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);
        }
예제 #2
0
 private void CloseButton_Pressed()
 {
     QGuiApplication.Exit();
 }