Ejemplo n.º 1
0
 public static void AwaitTask(Task task, QEventLoop.ProcessEventsFlag flags, TimeSpan?timeout = null)
 {
     while (!task.IsCompleted)
     {
         ProcessEvents(flags, timeout);
     }
     task.GetAwaiter().GetResult();
 }
Ejemplo n.º 2
0
 public static void ProcessEvents(QEventLoop.ProcessEventsFlag flags, TimeSpan?timeout = null)
 {
     if (timeout == null)
     {
         Interop.QCoreApplication.ProcessEvents((int)flags);
     }
     else
     {
         Interop.QCoreApplication.ProcessEventsWithTimeout((int)flags, (int)timeout.Value.TotalMilliseconds);
     }
 }