本文整理汇总了C++中TaskPtr::isAnonymous方法的典型用法代码示例。如果您正苦于以下问题:C++ TaskPtr::isAnonymous方法的具体用法?C++ TaskPtr::isAnonymous怎么用?C++ TaskPtr::isAnonymous使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskPtr
的用法示例。
在下文中一共展示了TaskPtr::isAnonymous方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MenuWindow
SingleTaskMenu::SingleTaskMenu(const QString& tablename, CamcopsApp& app) :
MenuWindow(app, ""), // start with a blank title
m_tablename(tablename),
m_current_task(nullptr)
{
// Title
TaskFactoryPtr factory = app.factory();
TaskPtr specimen = factory->create(m_tablename);
m_title = specimen->menutitle();
m_anonymous = specimen->isAnonymous();
// m_items is EXPENSIVE (and depends on security), so leave it to build()
}
示例2: addTask
void SingleTaskMenu::addTask()
{
// The task we create here needs to stay in scope for the duration of the
// editing! The simplest way is to use a member object to hold the pointer.
TaskFactoryPtr factory = m_app.factory();
TaskPtr task = factory->create(m_tablename);
if (!task->isAnonymous()) {
int patient_id = m_app.currentPatientId();
if (patient_id == DbConst::NONEXISTENT_PK) {
qCritical() << Q_FUNC_INFO << "- no patient selected";
return;
}
task->setPatient(m_app.currentPatientId());
}
task->save();
OpenableWidget* widget = task->editor();
m_app.open(widget, task, true);
}
示例3: setDefaults
MenuItem::MenuItem(const TaskMenuItem& taskmenuitem, CamcopsApp& app)
// m_title: below
{
setDefaults();
m_task_tablename = taskmenuitem.tablename;
TaskPtr task = app.factory()->create(m_task_tablename);
if (task == nullptr) {
m_title = tr("UNKNOWN TASK") + ": " + taskmenuitem.tablename;
m_implemented = false;
return;
}
m_title = task->menutitle();
m_subtitle = task->menusubtitle();
m_crippled = task->isCrippled();
if (task->isAnonymous()) {
m_icon = UiFunc::iconFilename(UiConst::ICON_ANONYMOUS);
}
}