void CExportImageDialog::HandleChangeExportPath() { std::string *output = nullptr; std::string title = "Export Output File"; QLineEdit *edit = nullptr; if ( sender() == mBrowseButton2D ) { title += " 2D"; output = &mOutputFileName2D; edit = mOutputPathLineEdit2D; } else if ( sender() == mBrowseButton3D ) { title += " 3D"; output = &mOutputFileName3D; edit = mOutputPathLineEdit3D; } else assert__( false ); QString export_path = BrowseNewFile( this, title.c_str(), QString( output->c_str() ) ); if ( !export_path.isEmpty() ) { *output = q2a( export_path ); edit->setText( export_path ); } }
void CActiveViewsDialog::HandleCloseWindow() { int index = mViewsListWidget->currentRow(); if ( index >= 0 ) { auto *sub_window = mSubWindows[ index ]; if ( sub_window->close() ) RefreshWindowsList(); else SimpleWarnBox( "Window " + q2a( sub_window->windowTitle() ) + " could not be closed." ); } }
//virtual void CWorkspaceViewsDialog::accept() { auto *item = mViewsListWidget->currentItem(); if ( !item ) { SimpleErrorBox( "There is no selected view to open" ); return; } std::string dname = q2a( item->text() ); mSelectedDisplay = mModel.Workspace< CWorkspaceDisplay >()->GetDisplay( dname ); base_t::accept(); }
void CInsertFunctionDialog::HandleFunctionListRowChanged( int index ) { mHelpText->setText( "" ); if ( index < 0 ) return; std::string func_name = q2a( mFunctionList->item( index )->text() ); std::string func_desc = CMapFunction::GetInstance().GetDescFunc( func_name ); //if ( !EndsWith( func_desc, std::string( "\n" ) ) ) // func_desc += "\n"; mHelpText->SetHelpProperties( func_desc.c_str(), 1, 6, Qt::AlignCenter, true ); mHelpText->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); mHelpText->adjustSize(); //mHelpText->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); }
int dev_gen_sen_oper_sen_value (INT16S u16_inst_id, INT8U u8_oper, void *ptr_value) { int total_len; FRACTION f_value; if (u8_oper == LWM2M_RESOURCE_OPERATION_READ) { #if FIXED_POINT { q2a(ptr_value, f_gen_sen ); } #endif #if FLOAT_POINT { (*(FRACTION *)ptr_value) = f_gen_sen; } #endif } else if (u8_oper == LWM2M_RESOURCE_OPERATION_WRITE) { #if FIXED_POINT { f_value = a2q((FRACTION *)ptr_value); f_gen_sen = f_value; return 0; } #endif #if FLOAT_POINT { total_len = strlen(( INT8U*)ptr_value); f_value = str_to_float(ptr_value, total_len); f_gen_sen = f_value; return 0; } #endif } return 0; }
//virtual void CInsertFunctionDialog::accept() { mResultFunction = q2a( mFunctionList->currentItem()->text() ); base_t::accept(); }
void CRadsDaemon::RsyncError( QProcess::ProcessError error ) { auto message = "An error occurred launching " + mPaths.mRsyncExecutablePath + "\n" + q2a( COsProcess::ProcessErrorMessage( error ) ); QtServiceBase::instance()->logMessage( message.c_str() ); LOG_FATAL( message.c_str() ); }