本文整理汇总了C++中DBManager::getActivity方法的典型用法代码示例。如果您正苦于以下问题:C++ DBManager::getActivity方法的具体用法?C++ DBManager::getActivity怎么用?C++ DBManager::getActivity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBManager
的用法示例。
在下文中一共展示了DBManager::getActivity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setVisible
void ActivityWizard::setVisible(bool visible) {
if (visible) {
DBManager manager;
QSqlError error;
if (mRecord.contains("id") && mRecord.value("id").toULongLong() != 0) {
mActivity =
manager.getActivity(mRecord.value("id").toULongLong(), error);
if (error.type() != QSqlError::NoError) {
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Warning);
msgBox.setText(
tr("There was an error while loading activity from the "
"database."));
msgBox.setDetailedText(error.text());
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.exec();
reject();
return;
}
if (!mActivity) {
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Information);
msgBox.setText(tr("The requested activity does not exist."));
msgBox.setInformativeText(tr("Maybe someone or system clean up "
"job deleted the activity. "
"Try refreshing the data."));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.exec();
reject();
return;
}
} else {
mActivity = make_shared<Activity>();
}
}
QWizard::setVisible(visible);
}