Skip to content
Permalink
Browse files

Auto emit characterSelected signal

  • Loading branch information
nyalldawson committed May 1, 2019
1 parent ac6ed1a commit bd13c36061a5255fa0c67e66768e439ea23a873e
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/gui/symbology/characterwidget.cpp
@@ -111,6 +111,7 @@ void CharacterWidget::setColumns( int columns )

void CharacterWidget::setCharacter( QChar character )
{
const bool changed = character != mLastKey;
mLastKey = character.unicode();
QWidget *widget = parentWidget();
if ( widget )
@@ -119,6 +120,9 @@ void CharacterWidget::setCharacter( QChar character )
if ( scrollArea && mLastKey < 65536 )
scrollArea->verticalScrollBar()->setValue( mLastKey / mColumns * mSquareSize );
}
if ( changed )
emit characterSelected( mLastKey );

update();
}

@@ -141,7 +145,6 @@ void CharacterWidget::keyPressEvent( QKeyEvent *event )
if ( chr.unicode() != mLastKey )
{
setCharacter( chr );
emit characterSelected( chr );
}
}
}

0 comments on commit bd13c36

Please sign in to comment.
You can’t perform that action at this time.