QgsScaleComboBox::QgsScaleComboBox( QWidget* parent ) : QComboBox( parent ), mScale( 1.0 )
{
  updateScales();

  setEditable( true );
  setInsertPolicy( QComboBox::NoInsert );
  setCompleter( 0 );
  connect( this, SIGNAL( activated( const QString & ) ), this, SLOT( fixupScale() ) );
  connect( lineEdit(), SIGNAL( editingFinished() ), this, SLOT( fixupScale() ) );
  fixupScale();
}
Exemple #2
0
QgsScaleComboBox::QgsScaleComboBox( QWidget *parent )
  : QComboBox( parent )
{
  updateScales();

  setEditable( true );
  setInsertPolicy( QComboBox::NoInsert );
  setCompleter( nullptr );
  connect( this, static_cast<void ( QComboBox::* )( const QString & )>( &QComboBox::activated ), this, &QgsScaleComboBox::fixupScale );
  connect( lineEdit(), &QLineEdit::editingFinished, this, &QgsScaleComboBox::fixupScale );
  fixupScale();
}