6.2: currentIndexChanged signal is changed.

This commit is contained in:
xiaoyifang 2022-02-27 14:26:49 +08:00 committed by xiaoyifang
parent 7b5511a7bd
commit 23d833fbb8
4 changed files with 16 additions and 17 deletions

View file

@ -677,11 +677,11 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
connect( ui.showReference, SIGNAL( triggered() ),
this, SLOT( showGDHelp() ) );
connect( groupListInDock, SIGNAL( currentIndexChanged( QString const & ) ),
this, SLOT( currentGroupChanged( QString const & ) ) );
connect( groupListInDock, &GroupComboBox::currentIndexChanged,
this, &MainWindow::currentGroupChanged );
connect( groupListInToolbar, SIGNAL( currentIndexChanged( QString const & ) ),
this, SLOT( currentGroupChanged( QString const & ) ) );
connect( groupListInToolbar, &GroupComboBox::currentIndexChanged,
this, &MainWindow::currentGroupChanged );
connect( ui.translateLine, SIGNAL( textChanged( QString const & ) ),
this, SLOT( translateInputChanged( QString const & ) ) );
@ -1391,8 +1391,8 @@ void MainWindow::updateGroupList()
// currentIndexChanged() signal is very trigger-happy. To avoid triggering
// it, we disconnect it while we're clearing and filling back groups.
disconnect( groupList, SIGNAL( currentIndexChanged( QString const & ) ),
this, SLOT( currentGroupChanged( QString const & ) ) );
disconnect( groupList, &GroupComboBox::currentIndexChanged,
this, &MainWindow::currentGroupChanged );
groupInstances.clear();
@ -1437,8 +1437,8 @@ void MainWindow::updateGroupList()
view.reload();
}
connect( groupList, SIGNAL( currentIndexChanged( QString const & ) ),
this, SLOT( currentGroupChanged( QString const & ) ) );
connect( groupList, &GroupComboBox::currentIndexChanged,
this, &MainWindow::currentGroupChanged );
}
void MainWindow::updateDictionaryBar()
@ -2255,7 +2255,7 @@ void MainWindow::editPreferences()
ftsIndexing.doIndexing();
}
void MainWindow::currentGroupChanged( QString const & )
void MainWindow::currentGroupChanged( int )
{
cfg.lastMainGroupId = groupList->getCurrentGroup();
Instances::Group const * igrp = groupInstances.findGroup( cfg.lastMainGroupId );
@ -3740,8 +3740,8 @@ void MainWindow::applyWordsZoomLevel()
if ( groupList->font().pointSize() != ps )
{
disconnect( groupList, SIGNAL( currentIndexChanged( QString const & ) ),
this, SLOT( currentGroupChanged( QString const & ) ) );
disconnect( groupList, &GroupComboBox::currentIndexChanged,
this, &MainWindow::currentGroupChanged );
int n = groupList->currentIndex();
groupList->clear();
groupList->setFont( font );

View file

@ -377,7 +377,7 @@ private slots:
void editCurrentGroup();
void editPreferences();
void currentGroupChanged( QString const & );
void currentGroupChanged( int );
void translateInputChanged( QString const & );
void translateInputFinished( bool checkModifiers = true );

View file

@ -254,8 +254,8 @@ ScanPopup::ScanPopup( QWidget * parent,
connect( &switchExpandModeAction, SIGNAL( triggered() ),
this, SLOT(switchExpandOptionalPartsMode() ) );
connect( ui.groupList, SIGNAL( currentIndexChanged( QString const & ) ),
this, SLOT( currentGroupChanged( QString const & ) ) );
connect( ui.groupList, &QComboBox::currentIndexChanged,
this, &ScanPopup::currentGroupChanged);
connect( &wordFinder, SIGNAL( finished() ),
this, SLOT( prefixMatchFinished() ) );
@ -717,8 +717,7 @@ QString ScanPopup::elideInputWord()
QString const & inputWord = inputPhrase.phrase;
return inputWord.size() > 32 ? inputWord.mid( 0, 32 ) + "..." : inputWord;
}
void ScanPopup::currentGroupChanged( QString const & )
void ScanPopup::currentGroupChanged( int )
{
cfg.lastPopupGroupId = ui.groupList->getCurrentGroup();
Instances::Group const * igrp = groups.findGroup( cfg.lastPopupGroupId );

View file

@ -194,7 +194,7 @@ private:
private slots:
void clipboardChanged( QClipboard::Mode );
void mouseHovered( QString const & , bool forcePopup);
void currentGroupChanged( QString const & );
void currentGroupChanged( int );
void prefixMatchFinished();
void on_pronounceButton_clicked();
void pinButtonClicked( bool checked );