Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang committed Dec 30, 2024
1 parent 0f8519d commit 144ab9d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/ui/scanpopup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,10 @@ void ScanPopup::updateFoundInDictsList()
QStringList ids = definition->getArticlesList();
QString activeId = definition->getActiveArticleId();
toolbar->clear();
// actionGroup->removeAllActions();
if( actionGroup ){
delete actionGroup;
}
actionGroup = new ActionGroup( this );
for ( QStringList::const_iterator i = ids.constBegin(); i != ids.constEnd(); ++i ) {
// Find this dictionary

Expand All @@ -327,11 +330,11 @@ void ScanPopup::updateFoundInDictsList()
auto dictionary = dictionaries[ x ];
QIcon icon = dictionary->getIcon();
QString dictName = QString::fromUtf8( dictionary->getName().c_str() );
QAction * action = addAction( icon, dictName );
action->setToolTip( dictName ); // Tooltip need not be shortened
QAction * action = new QAction( dictName,this );
action->setIcon( icon );
QString id = QString::fromStdString( dictionary->getId() );
action->setData( id );

action->setCheckable(true);
if ( id == activeId ) {
action->setChecked( true );
}
Expand Down

0 comments on commit 144ab9d

Please sign in to comment.