本文整理汇总了C++中Exception::getErrorType方法的典型用法代码示例。如果您正苦于以下问题:C++ Exception::getErrorType方法的具体用法?C++ Exception::getErrorType怎么用?C++ Exception::getErrorType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exception
的用法示例。
在下文中一共展示了Exception::getErrorType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: captureThreadError
void DatabaseImportForm::captureThreadError(Exception e)
{
QPixmap ico;
QTreeWidgetItem *item=nullptr;
if(!create_model)
model_wgt->rearrangeSchemas(QPointF(origin_sb->value(), origin_sb->value()),
tabs_per_row_sb->value(), sch_per_row_sb->value(), obj_spacing_sb->value());
destroyModelWidget();
finishImport(trUtf8("Importing process aborted!"));
ico=QPixmap(PgModelerUiNS::getIconPath("msgbox_erro"));
ico_lbl->setPixmap(ico);
item=PgModelerUiNS::createOutputTreeItem(output_trw, PgModelerUiNS::formatMessage(e.getErrorMessage()), ico, nullptr, false, true);
PgModelerUiNS::createExceptionsTree(output_trw, e, item);
//Destroy the current import thread and helper to avoid reuse
destroyThread();
//Recreates a new import thread and helper to force user to reconfigure the import
createThread();
database_cmb->setCurrentIndex(0);
throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e);
}
示例2: captureThreadError
void DatabaseImportForm::captureThreadError(Exception e)
{
destroyModelWidget();
finishImport(trUtf8("Importing process aborted!"));
ico_lbl->setPixmap(QPixmap(QString(":/icones/icones/msgbox_erro.png")));
throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e);
}
示例3: redoOperation
void OperationList::redoOperation(void)
{
if(isRedoAvailable())
{
Operation *operation=NULL;
bool chain_active=false;
Exception error;
unsigned chain_size=0, pos=0;
if(!this->signalsBlocked())
chain_size=getChainSize();
do
{
//Gets the current operation
operation=operations[current_index];
/* If it is detected that the operation is chained with other
and active chaining flag is cleared marks the flag to start
the execution several operations at once */
if(!ignore_chain && !chain_active &&
operation->chain_type!=Operation::NO_CHAIN)
chain_active=true;
/* If the chaining is active and the current operation is not part of
chain or it is at the start of chain, aborts execution of the operation */
else if(chain_active &&
(operation->chain_type==Operation::CHAIN_START ||
operation->chain_type==Operation::NO_CHAIN))
break;
try
{
if(chain_size > 0)
{
//Emits a signal with the current progress of operation execution
pos++;
emit s_operationExecuted((pos/static_cast<float>(chain_size))*100,
trUtf8("Redoing operation on object:: %1 (%2)")
.arg(operation->pool_obj->getName())
.arg(operation->pool_obj->getTypeName()),
operation->pool_obj->getObjectType());
}
//Executes the redo operation (second argument as 'true')
executeOperation(operation, true);
}
catch(Exception &e)
{
error=e;
}
current_index++;
}
/* Performs the operations while the current operation is part of chain
or the redo option is available */
while(!ignore_chain && isRedoAvailable() && operation->chain_type!=Operation::NO_CHAIN);
if(error.getErrorType()!=ERR_CUSTOM)
throw Exception(error.getErrorMessage(), error.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__);
}
}