腹主动脉栓塞:Qt使用小技巧

来源:百度文库 编辑:九乡新闻网 时间:2024/04/27 14:32:14
1.对话框选择条件项,可直接用如下实现:  int nAction = QMessageBox::question(this, tr(TITLE_GRAPHTICKET),
   tr("请选择操作方式:"),
   tr("自动"), tr("手动"),tr("取消"),
   0, 0);
  if (nAction == 0 || nAction == 1)
  {
   lvHintLang->clear();
   ManualTKImp::StartPreview(nAction);
  }
2.获取当前进程ID:ushort GetProcessID()
{
#ifdef _MSC_VER
 return GetCurrentProcessId();
#else
 return getpid();
#endif
} 3.获取当前线程ID:unsigned int GetCurrentThreadID()
{
#ifdef _MSC_VER
 return GetCurrentThreadId();
#else
 return pthread_self();
#endif
} 4.