1 #include <cpPlugins/QT/ParametersDialog.h>
2 #include <cpPlugins/Pipeline/ProcessObject.h>
7 #include <QDoubleSpinBox>
10 #include <QInputDialog>
12 #include <QPushButton>
15 // -------------------------------------------------------------------------
16 cpPlugins::QT::ParametersDialog::
17 ParametersDialog( QWidget* parent, Qt::WindowFlags f, bool manual )
18 : QDialog( parent, f ),
19 m_ProcessObject( NULL ),
20 m_WidgetsUpdated( false ),
25 this->m_Title = new QLabel( this );
26 this->m_Title->setText( "Parameters dialog title" );
27 this->m_MainLayout = new QGridLayout( this );
28 this->m_ToolsLayout = new QVBoxLayout( );
29 this->m_ToolsLayout->addWidget( this->m_Title );
30 this->m_MainLayout->addLayout( this->m_ToolsLayout, 0, 0, 1, 1 );
34 this, SIGNAL( accepted( ) ), this, SLOT( _dlg_Accepted( ) )
38 // -------------------------------------------------------------------------
39 cpPlugins::QT::ParametersDialog::
45 delete this->m_ToolsLayout;
46 delete this->m_MainLayout;
51 // -------------------------------------------------------------------------
52 cpPlugins::Pipeline::ProcessObject*
53 cpPlugins::QT::ParametersDialog::
54 getProcessObject( ) const
56 return( this->m_ProcessObject );
59 // -------------------------------------------------------------------------
60 bool cpPlugins::QT::ParametersDialog::
61 setProcessObject( cpPlugins::Pipeline::ProcessObject* obj )
63 if( this->m_ProcessObject != NULL || obj == NULL )
65 this->m_ProcessObject = obj;
66 this->m_WidgetsUpdated = false;
67 this->_updateWidgets( );
72 // -------------------------------------------------------------------------
73 void cpPlugins::QT::ParametersDialog::
76 if( this->m_ProcessObject == NULL )
81 // Check if an explicit re-execution button is needed
83 this->findChild< QCheckBox* >( "___ExplicitExecution___" );
85 this->m_ProcessObject->SetExplicitExecution( v_bool->isChecked( ) );
88 auto parameters = this->m_ProcessObject->GetParameters( );
89 auto& raw_params = parameters->GetRawParameters( );
90 for( auto pIt = raw_params.begin( ); pIt != raw_params.end( ); ++pIt )
92 QString pName = pIt->first.c_str( );
93 switch( pIt->second.first )
95 case cpPlugins::Pipeline::Parameters::String:
96 case cpPlugins::Pipeline::Parameters::OpenFileName:
97 case cpPlugins::Pipeline::Parameters::SaveFileName:
98 case cpPlugins::Pipeline::Parameters::PathName:
99 case cpPlugins::Pipeline::Parameters::IntList:
100 case cpPlugins::Pipeline::Parameters::UintList:
101 case cpPlugins::Pipeline::Parameters::RealList:
102 case cpPlugins::Pipeline::Parameters::OpenFileNameList:
104 QLineEdit* v_string = this->findChild< QLineEdit* >( pName );
105 if( v_string != NULL )
106 pIt->second.second = v_string->text( ).toStdString( );
109 case cpPlugins::Pipeline::Parameters::Bool:
111 QCheckBox* v_bool = this->findChild< QCheckBox* >( pName );
113 pIt->second.second = ( v_bool->isChecked( ) )? "1": "0";
116 case cpPlugins::Pipeline::Parameters::Int:
117 case cpPlugins::Pipeline::Parameters::Uint:
119 QSpinBox* v_uint = this->findChild< QSpinBox* >( pName );
122 std::stringstream str;
123 str << v_uint->value( );
124 pIt->second.second = str.str( );
129 case cpPlugins::Pipeline::Parameters::Real:
131 QDoubleSpinBox* v_double = this->findChild< QDoubleSpinBox* >( pName );
134 std::stringstream str;
135 str << v_double->value( );
136 pIt->second.second = str.str( );
141 case cpPlugins::Pipeline::Parameters::StringList:
143 case cpPlugins::Pipeline::Parameters::BoolList:
145 case cpPlugins::Pipeline::Parameters::SaveFileNameList:
147 case cpPlugins::Pipeline::Parameters::PathNameList:
149 case cpPlugins::Pipeline::Parameters::Choices:
151 QComboBox* v_choices = this->findChild< QComboBox* >( pName );
152 if( v_choices != NULL )
154 std::istringstream str_choices( pIt->second.second );
155 std::string real_choices;
156 std::getline( str_choices, real_choices, '@' );
159 v_choices->currentText( ).toStdString( );
169 this->m_ProcessObject->Modified( );
172 // -------------------------------------------------------------------------
173 void cpPlugins::QT::ParametersDialog::
176 if( this->m_ProcessObject == NULL )
181 // Check if an explicit re-execution button is needed
183 this->findChild< QCheckBox* >( "___ExplicitExecution___" );
185 v_bool->setChecked( this->m_ProcessObject->GetExplicitExecution( ) );
188 auto parameters = this->m_ProcessObject->GetParameters( );
189 auto& raw_params = parameters->GetRawParameters( );
190 for( auto pIt = raw_params.begin( ); pIt != raw_params.end( ); ++pIt )
192 QString pName = pIt->first.c_str( );
193 switch( pIt->second.first )
195 case cpPlugins::Pipeline::Parameters::String:
196 case cpPlugins::Pipeline::Parameters::OpenFileName:
197 case cpPlugins::Pipeline::Parameters::SaveFileName:
198 case cpPlugins::Pipeline::Parameters::PathName:
199 case cpPlugins::Pipeline::Parameters::IntList:
200 case cpPlugins::Pipeline::Parameters::UintList:
201 case cpPlugins::Pipeline::Parameters::RealList:
202 case cpPlugins::Pipeline::Parameters::OpenFileNameList:
204 QLineEdit* v_string = this->findChild< QLineEdit* >( pName );
205 if( v_string != NULL )
206 v_string->setText( pIt->second.second.c_str( ) );
209 case cpPlugins::Pipeline::Parameters::Bool:
211 QCheckBox* v_bool = this->findChild< QCheckBox* >( pName );
213 v_bool->setChecked( pIt->second.second == "1" );
216 case cpPlugins::Pipeline::Parameters::Int:
217 case cpPlugins::Pipeline::Parameters::Uint:
219 QSpinBox* v_uint = this->findChild< QSpinBox* >( pName );
222 std::istringstream tok_str( pIt->second.second );
225 v_uint->setValue( v );
230 case cpPlugins::Pipeline::Parameters::Real:
232 QDoubleSpinBox* v_double = this->findChild< QDoubleSpinBox* >( pName );
235 std::istringstream tok_str( pIt->second.second );
238 v_double->setValue( v );
243 case cpPlugins::Pipeline::Parameters::StringList:
245 case cpPlugins::Pipeline::Parameters::BoolList:
247 case cpPlugins::Pipeline::Parameters::SaveFileNameList:
249 case cpPlugins::Pipeline::Parameters::PathNameList:
251 case cpPlugins::Pipeline::Parameters::Choices:
253 QComboBox* v_choices = this->findChild< QComboBox* >( pName );
254 if( v_choices != NULL )
256 std::istringstream str_choices( pIt->second.second );
257 std::string choices, real_choice;
258 std::getline( str_choices, choices, '@' );
259 std::getline( str_choices, real_choice, '@' );
260 std::istringstream str( choices );
262 int id = -1, cont = 0;
263 while( std::getline( str, token, '#' ) )
265 if( token == real_choice )
272 v_choices->setCurrentIndex( id );
284 // -------------------------------------------------------------------------
285 void cpPlugins::QT::ParametersDialog::
292 this->m_Buttons = new QDialogButtonBox(
293 QDialogButtonBox::Ok | QDialogButtonBox::Cancel
296 this->m_Buttons, SIGNAL( accepted( ) ), this, SLOT( accept( ) )
299 this->m_Buttons, SIGNAL( rejected( ) ), this, SLOT( reject( ) )
301 this->m_ToolsLayout->addWidget( this->m_Buttons );
304 this->m_WidgetsUpdated = true;
307 // -------------------------------------------------------------------------
308 void cpPlugins::QT::ParametersDialog::
311 if( this->m_WidgetsUpdated || this->m_ProcessObject == NULL )
317 std::stringstream title;
319 << "Parameters for an object of class \""
320 << this->m_ProcessObject->GetClassName( )
322 this->m_Title->setText( title.str( ).c_str( ) );
324 // Check if an explicit re-execution button is needed
325 QCheckBox* v_bool = new QCheckBox( this );
326 v_bool->setObjectName( "___ExplicitExecution___" );
327 v_bool->setText( "Explicit re-execution" );
328 v_bool->setChecked( this->m_ProcessObject->GetExplicitExecution( ) );
330 QHBoxLayout* new_layout = new QHBoxLayout( );
331 new_layout->addWidget( v_bool );
332 this->m_ToolsLayout->addLayout( new_layout );
335 auto parameters = this->m_ProcessObject->GetParameters( );
336 auto& raw_params = parameters->GetRawParameters( );
337 for( auto pIt = raw_params.begin( ); pIt != raw_params.end( ); ++pIt )
339 QWidget* w_input = NULL;
340 switch( pIt->second.first )
342 case cpPlugins::Pipeline::Parameters::String:
344 QLineEdit* v_string = new QLineEdit( this );
345 v_string->setObjectName( pIt->first.c_str( ) );
346 v_string->setText( pIt->second.second.c_str( ) );
350 case cpPlugins::Pipeline::Parameters::Bool:
352 QCheckBox* v_bool = new QCheckBox( this );
353 v_bool->setObjectName( pIt->first.c_str( ) );
354 v_bool->setText( "[ON/OFF]" );
355 v_bool->setChecked( pIt->second.second == "1" );
359 case cpPlugins::Pipeline::Parameters::Int:
360 case cpPlugins::Pipeline::Parameters::Uint:
362 std::istringstream tok_str( pIt->second.second );
365 QSpinBox* v_uint = new QSpinBox( this );
366 v_uint->setObjectName( pIt->first.c_str( ) );
367 if( pIt->second.first == cpPlugins::Pipeline::Parameters::Uint )
368 v_uint->setMinimum( 0 );
370 v_uint->setMinimum( -std::numeric_limits< int >::max( ) );
371 v_uint->setMaximum( std::numeric_limits< int >::max( ) );
372 v_uint->setValue( v );
376 case cpPlugins::Pipeline::Parameters::Real:
378 std::istringstream tok_str( pIt->second.second );
381 QDoubleSpinBox* v_double = new QDoubleSpinBox( this );
382 v_double->setObjectName( pIt->first.c_str( ) );
383 v_double->setDecimals( 3 );
384 v_double->setMinimum( -std::numeric_limits< double >::max( ) );
385 v_double->setMaximum( std::numeric_limits< double >::max( ) );
386 v_double->setValue( v );
390 case cpPlugins::Pipeline::Parameters::OpenFileName:
392 QFrame* frame = new QFrame( this );
393 QHBoxLayout* layout = new QHBoxLayout( frame );
394 QLineEdit* v_string = new QLineEdit( frame );
395 v_string->setObjectName( pIt->first.c_str( ) );
396 v_string->setText( pIt->second.second.c_str( ) );
397 QPushButton* v_button = new QPushButton( frame );
398 v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
399 v_button->setText( "..." );
401 v_button, SIGNAL( clicked( ) ),
402 this, SLOT( _dlg_OpenSingleFile( ) )
404 layout->addWidget( v_string );
405 layout->addWidget( v_button );
408 case cpPlugins::Pipeline::Parameters::SaveFileName:
410 QFrame* frame = new QFrame( this );
411 QHBoxLayout* layout = new QHBoxLayout( frame );
412 QLineEdit* v_string = new QLineEdit( frame );
413 v_string->setObjectName( pIt->first.c_str( ) );
414 v_string->setText( pIt->second.second.c_str( ) );
415 QPushButton* v_button = new QPushButton( frame );
416 v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
417 v_button->setText( "..." );
419 v_button, SIGNAL( clicked( ) ),
420 this, SLOT( _dlg_SaveSingleFile( ) )
422 layout->addWidget( v_string );
423 layout->addWidget( v_button );
427 case cpPlugins::Pipeline::Parameters::PathName:
429 QFrame* frame = new QFrame( this );
430 QHBoxLayout* layout = new QHBoxLayout( frame );
431 QLineEdit* v_string = new QLineEdit( frame );
432 v_string->setObjectName( pIt->first.c_str( ) );
433 v_string->setText( pIt->second.second.c_str( ) );
434 QPushButton* v_button = new QPushButton( frame );
435 v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
436 v_button->setText( "..." );
438 v_button, SIGNAL( clicked( ) ),
439 this, SLOT( _dlg_OpenSinglePath( ) )
441 layout->addWidget( v_string );
442 layout->addWidget( v_button );
446 case cpPlugins::Pipeline::Parameters::StringList:
448 case cpPlugins::Pipeline::Parameters::BoolList:
450 case cpPlugins::Pipeline::Parameters::IntList:
452 QFrame* frame = new QFrame( this );
453 QHBoxLayout* layout = new QHBoxLayout( frame );
454 QLineEdit* v_string = new QLineEdit( frame );
455 v_string->setObjectName( pIt->first.c_str( ) );
456 v_string->setText( pIt->second.second.c_str( ) );
457 QPushButton* v_button = new QPushButton( frame );
458 v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
459 v_button->setText( "+" );
461 v_button, SIGNAL( clicked( ) ),
462 this, SLOT( _dlg_AddInt( ) )
464 layout->addWidget( v_string );
465 layout->addWidget( v_button );
469 case cpPlugins::Pipeline::Parameters::UintList:
471 QFrame* frame = new QFrame( this );
472 QHBoxLayout* layout = new QHBoxLayout( frame );
473 QLineEdit* v_string = new QLineEdit( frame );
474 v_string->setObjectName( pIt->first.c_str( ) );
475 v_string->setText( pIt->second.second.c_str( ) );
476 QPushButton* v_button = new QPushButton( frame );
477 v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
478 v_button->setText( "+" );
480 v_button, SIGNAL( clicked( ) ),
481 this, SLOT( _dlg_AddUint( ) )
483 layout->addWidget( v_string );
484 layout->addWidget( v_button );
488 case cpPlugins::Pipeline::Parameters::RealList:
490 QFrame* frame = new QFrame( this );
491 QHBoxLayout* layout = new QHBoxLayout( frame );
492 QLineEdit* v_string = new QLineEdit( frame );
493 v_string->setObjectName( pIt->first.c_str( ) );
494 v_string->setText( pIt->second.second.c_str( ) );
495 QPushButton* v_button = new QPushButton( frame );
496 v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
497 v_button->setText( "+" );
499 v_button, SIGNAL( clicked( ) ),
500 this, SLOT( _dlg_AddReal( ) )
502 layout->addWidget( v_string );
503 layout->addWidget( v_button );
507 case cpPlugins::Pipeline::Parameters::OpenFileNameList:
509 QFrame* frame = new QFrame( this );
510 QHBoxLayout* layout = new QHBoxLayout( frame );
511 QLineEdit* v_string = new QLineEdit( frame );
512 v_string->setObjectName( pIt->first.c_str( ) );
513 v_string->setMaxLength( std::numeric_limits< int >::max( ) );
514 v_string->setText( pIt->second.second.c_str( ) );
515 QPushButton* v_button = new QPushButton( frame );
516 v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
517 v_button->setText( "..." );
519 v_button, SIGNAL( clicked( ) ),
520 this, SLOT( _dlg_OpenMultipleFiles( ) )
522 layout->addWidget( v_string );
523 layout->addWidget( v_button );
527 case cpPlugins::Pipeline::Parameters::SaveFileNameList:
529 case cpPlugins::Pipeline::Parameters::PathNameList:
531 case cpPlugins::Pipeline::Parameters::Choices:
533 QComboBox* v_choices = new QComboBox( this );
534 v_choices->setObjectName( pIt->first.c_str( ) );
536 std::istringstream str0( pIt->second.second );
538 std::getline( str0, choices, '@' );
539 std::istringstream str1( choices );
542 while( std::getline( str1, token, '#' ) )
543 v_choices->insertItem( id++, token.c_str( ) );
552 // Ok, a representation was created
553 if( w_input != NULL )
555 QHBoxLayout* new_layout = new QHBoxLayout( );
556 QLabel* label = new QLabel( this );
557 label->setText( QString( pIt->first.c_str( ) ) );
558 new_layout->addWidget( label );
559 new_layout->addWidget( w_input );
560 this->m_ToolsLayout->addLayout( new_layout );
567 this->_addButtons( );
570 // -------------------------------------------------------------------------
571 void cpPlugins::QT::ParametersDialog::
574 this->updateParameters( );
577 // -------------------------------------------------------------------------
578 void cpPlugins::QT::ParametersDialog::
579 _dlg_OpenSingleFile( )
581 auto parameters = this->m_ProcessObject->GetParameters( );
582 QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
585 std::string bName = btn->objectName( ).toStdString( );
586 std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
587 QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
590 std::string param_name = line->objectName( ).toStdString( );
591 if( param_name != "" )
593 std::string param_value = parameters->GetOpenFileName( param_name );
594 if( param_value == "" )
596 QStringList dialog_filters;
597 std::string extensions = parameters->GetAcceptedFileExtensions( param_name );
598 if( extensions != "" )
599 dialog_filters << extensions.c_str( );
600 dialog_filters << "Any file (*)";
602 // Show dialog and check if it was accepted
603 QFileDialog dialog( this );
604 dialog.setFileMode( QFileDialog::ExistingFile );
605 dialog.setDirectory( QFileDialog::tr( param_value.c_str( ) ) );
606 dialog.setNameFilters( dialog_filters );
607 dialog.setAcceptMode( QFileDialog::AcceptOpen );
609 line->setText( *( dialog.selectedFiles( ).begin( ) ) );
618 // -------------------------------------------------------------------------
619 void cpPlugins::QT::ParametersDialog::
620 _dlg_SaveSingleFile( )
622 auto parameters = this->m_ProcessObject->GetParameters( );
623 QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
626 std::string bName = btn->objectName( ).toStdString( );
627 std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
628 QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
631 std::string param_name = line->objectName( ).toStdString( );
632 if( param_name != "" )
634 std::string param_value = parameters->GetSaveFileName( param_name );
635 if( param_value == "" )
637 QStringList dialog_filters;
638 std::string extensions = parameters->GetAcceptedFileExtensions( param_name );
639 if( extensions != "" )
640 dialog_filters << extensions.c_str( );
641 dialog_filters << "Any file (*)";
643 // Show dialog and check if it was accepted
644 QFileDialog dialog( this );
645 dialog.setFileMode( QFileDialog::AnyFile );
646 dialog.setDirectory( QFileDialog::tr( param_value.c_str( ) ) );
647 dialog.setNameFilters( dialog_filters );
648 dialog.setAcceptMode( QFileDialog::AcceptSave );
650 line->setText( *( dialog.selectedFiles( ).begin( ) ) );
659 // -------------------------------------------------------------------------
660 void cpPlugins::QT::ParametersDialog::
661 _dlg_OpenSinglePath( )
663 auto parameters = this->m_ProcessObject->GetParameters( );
664 QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
667 std::string bName = btn->objectName( ).toStdString( );
668 std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
669 QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
672 std::string param_name = line->objectName( ).toStdString( );
673 if( param_name != "" )
675 std::string param_value = parameters->GetPathName( param_name );
676 if( param_value == "" )
679 // Show dialog and check if it was accepted
680 QFileDialog dialog( this );
681 dialog.setFileMode( QFileDialog::Directory );
682 dialog.setDirectory( QFileDialog::tr( param_value.c_str( ) ) );
683 dialog.setAcceptMode( QFileDialog::AcceptOpen );
685 line->setText( *( dialog.selectedFiles( ).begin( ) ) );
694 // -------------------------------------------------------------------------
695 void cpPlugins::QT::ParametersDialog::
696 _dlg_OpenMultipleFiles( )
698 auto parameters = this->m_ProcessObject->GetParameters( );
699 QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
702 std::string bName = btn->objectName( ).toStdString( );
703 std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
705 QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
708 std::string param_name = line->objectName( ).toStdString( );
709 if( param_name != "" )
711 QStringList dialog_filters;
712 std::string extensions = parameters->GetAcceptedFileExtensions( param_name );
713 if( extensions != "" )
714 dialog_filters << extensions.c_str( );
715 dialog_filters << "Any file (*)";
717 // Show dialog and check if it was accepted
718 QFileDialog dialog( this );
719 dialog.setFileMode( QFileDialog::ExistingFiles );
720 dialog.setNameFilters( dialog_filters );
721 dialog.setAcceptMode( QFileDialog::AcceptOpen );
724 if( dialog.selectedFiles( ).size( ) > 0 )
726 std::stringstream str;
727 auto files = dialog.selectedFiles( );
728 auto fIt = files.begin( );
729 str << fIt->toStdString( );
731 for( ; fIt != files.end( ); ++fIt )
732 str << "#" << fIt->toStdString( );
733 line->setText( str.str( ).c_str( ) );
746 // -------------------------------------------------------------------------
747 void cpPlugins::QT::ParametersDialog::
750 QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
753 std::string bName = btn->objectName( ).toStdString( );
754 std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
755 QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
758 std::string param_name = line->objectName( ).toStdString( );
759 if( param_name != "" )
763 QInputDialog::getInt(
766 std::string( "Add new value to \"" ) +
772 -std::numeric_limits< int >::max( ),
773 std::numeric_limits< int >::max( ),
778 std::string values = line->text( ).toStdString( );
781 std::stringstream str;
782 str << values << value;
783 line->setText( str.str( ).c_str( ) );
794 // -------------------------------------------------------------------------
795 void cpPlugins::QT::ParametersDialog::
798 QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
801 std::string bName = btn->objectName( ).toStdString( );
802 std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
803 QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
806 std::string param_name = line->objectName( ).toStdString( );
807 if( param_name != "" )
811 QInputDialog::getInt(
814 std::string( "Add new value to \"" ) +
819 0, 0, std::numeric_limits< int >::max( ), 1,
824 std::string values = line->text( ).toStdString( );
827 std::stringstream str;
828 str << values << value;
829 line->setText( str.str( ).c_str( ) );
840 // -------------------------------------------------------------------------
841 void cpPlugins::QT::ParametersDialog::
844 QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
847 std::string bName = btn->objectName( ).toStdString( );
848 std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
849 QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
852 std::string param_name = line->objectName( ).toStdString( );
853 if( param_name != "" )
857 QInputDialog::getDouble(
860 std::string( "Add new value to \"" ) +
866 -std::numeric_limits< double >::max( ),
867 std::numeric_limits< double >::max( ),
872 std::string values = line->text( ).toStdString( );
875 std::stringstream str;
876 str << values << value;
877 line->setText( str.str( ).c_str( ) );