diff --git a/src/fulltextsearch.cc b/src/fulltextsearch.cc index 657bcdc8..68766ef2 100644 --- a/src/fulltextsearch.cc +++ b/src/fulltextsearch.cc @@ -246,8 +246,8 @@ FullTextSearchDialog::FullTextSearchDialog( QWidget * parent, connect( this, &QDialog::finished, this, &FullTextSearchDialog::saveData ); - connect( ui.OKButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( ui.cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( ui.OKButton, &QPushButton::clicked, this, &QDialog::accept ); + connect( ui.cancelButton, &QPushButton::clicked, this, &QDialog::reject ); helpAction.setShortcut( QKeySequence( "F1" ) ); diff --git a/src/ui/articleview.cc b/src/ui/articleview.cc index bfa9c655..e9bf6b4c 100644 --- a/src/ui/articleview.cc +++ b/src/ui/articleview.cc @@ -176,7 +176,7 @@ ArticleView::ArticleView( QWidget * parent, ArticleNetworkAccessManager & nm, Au connect( webview, &QWidget::customContextMenuRequested, this, &ArticleView::contextMenuRequested ); - connect( webview->page(), SIGNAL( linkHovered( const QString & ) ), this, SLOT( linkHovered( const QString & ) ) ); + connect( webview->page(), &QWebEnginePage::linkHovered, this, &ArticleView::linkHovered ); connect( webview, &ArticleWebView::doubleClicked, this, &ArticleView::doubleClicked ); diff --git a/src/ui/favoritespanewidget.cc b/src/ui/favoritespanewidget.cc index 8b4097d9..00a4c144 100644 --- a/src/ui/favoritespanewidget.cc +++ b/src/ui/favoritespanewidget.cc @@ -113,9 +113,9 @@ void FavoritesPaneWidget::setUp( Config::Class * cfg, QMenu * menu ) connect( m_favoritesTree, &QAbstractItemView::clicked, this, &FavoritesPaneWidget::onItemClicked ); connect( m_favoritesTree->selectionModel(), - SIGNAL( selectionChanged( QItemSelection const &, QItemSelection const & ) ), - this, - SLOT( onSelectionChanged( QItemSelection const & ) ) ); + &QItemSelectionModel::selectionChanged, + this, + &FavoritesPaneWidget::onSelectionChanged ); connect( m_favoritesTree, &QWidget::customContextMenuRequested, this, &FavoritesPaneWidget::showCustomMenu ); } @@ -196,8 +196,10 @@ void FavoritesPaneWidget::showCustomMenu(QPoint const & pos) m_favoritesMenu->exec( m_favoritesTree->mapToGlobal( pos ) ); } -void FavoritesPaneWidget::onSelectionChanged( QItemSelection const & selection ) +void FavoritesPaneWidget::onSelectionChanged( const QItemSelection & selection, const QItemSelection & deselected ) { + Q_UNUSED( deselected ) + if ( m_favoritesTree->selectionModel()->selectedIndexes().size() != 1 || selection.indexes().isEmpty() ) return; diff --git a/src/ui/favoritespanewidget.hh b/src/ui/favoritespanewidget.hh index 9c4db26e..10c104c5 100644 --- a/src/ui/favoritespanewidget.hh +++ b/src/ui/favoritespanewidget.hh @@ -68,7 +68,7 @@ protected: private slots: void emitFavoritesItemRequested(QModelIndex const &); - void onSelectionChanged(QItemSelection const & selection); + void onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected ); void onItemClicked(QModelIndex const & idx); void showCustomMenu(QPoint const & pos); void deleteSelectedItems(); diff --git a/src/ui/historypanewidget.cc b/src/ui/historypanewidget.cc index d2cde59f..16470f4f 100644 --- a/src/ui/historypanewidget.cc +++ b/src/ui/historypanewidget.cc @@ -78,8 +78,10 @@ void HistoryPaneWidget::setUp( Config::Class * cfg, History * history, QMenu * // list selection and keyboard navigation connect( m_historyList, &QAbstractItemView::clicked, this, &HistoryPaneWidget::onItemClicked ); connect( m_history, &History::itemsChanged, this, &HistoryPaneWidget::updateHistoryCounts ); - connect ( m_historyList->selectionModel(), SIGNAL( selectionChanged ( QItemSelection const & , QItemSelection const & ) ), - this, SLOT( onSelectionChanged( QItemSelection const & ) ) ); + connect( m_historyList->selectionModel(), + &QItemSelectionModel::selectionChanged, + this, + &HistoryPaneWidget::onSelectionChanged ); connect( m_historyList, &QWidget::customContextMenuRequested, this, &HistoryPaneWidget::showCustomMenu ); @@ -188,9 +190,9 @@ void HistoryPaneWidget::emitHistoryItemRequested( QModelIndex const & idx ) } } -void HistoryPaneWidget::onSelectionChanged( QItemSelection const & selection ) +void HistoryPaneWidget::onSelectionChanged( const QItemSelection & selection, const QItemSelection & deselected ) { - // qDebug() << "selectionChanged"; + Q_UNUSED( deselected ); if ( selection.empty() ) return; diff --git a/src/ui/historypanewidget.hh b/src/ui/historypanewidget.hh index a8487f63..c538c868 100644 --- a/src/ui/historypanewidget.hh +++ b/src/ui/historypanewidget.hh @@ -40,7 +40,7 @@ public slots: private slots: void emitHistoryItemRequested(QModelIndex const &); - void onSelectionChanged(QItemSelection const & selection); + void onSelectionChanged( const QItemSelection & selection, const QItemSelection & deselected ); void onItemClicked(QModelIndex const & idx); void showCustomMenu(QPoint const & pos); void deleteSelectedItems(); diff --git a/src/ui/orderandprops.cc b/src/ui/orderandprops.cc index 4b97f547..c2040b9c 100644 --- a/src/ui/orderandprops.cc +++ b/src/ui/orderandprops.cc @@ -108,8 +108,10 @@ OrderAndProps::OrderAndProps( QWidget * parent, connect( ui.dictionaryOrder, &DictListWidget::gotFocus, this, &OrderAndProps::dictListFocused ); connect( ui.inactiveDictionaries, &DictListWidget::gotFocus, this, &OrderAndProps::inactiveDictListFocused ); - connect ( ui.dictionaryOrder->selectionModel(), SIGNAL( selectionChanged ( const QItemSelection & , const QItemSelection & ) ), - this, SLOT( dictionarySelectionChanged( const QItemSelection & ) ) ); + connect( ui.dictionaryOrder->selectionModel(), + &QItemSelectionModel::selectionChanged, + this, + &OrderAndProps::dictionarySelectionChanged ); connect( ui.inactiveDictionaries->selectionModel(), &QItemSelectionModel::selectionChanged, this, @@ -158,8 +160,10 @@ void OrderAndProps::inactiveDictListFocused() describeDictionary( ui.inactiveDictionaries, ui.inactiveDictionaries->currentIndex() ); } -void OrderAndProps::dictionarySelectionChanged( const QItemSelection & current ) +void OrderAndProps::dictionarySelectionChanged( const QItemSelection & current, const QItemSelection & deselected ) { + Q_UNUSED( deselected ) + if ( current.empty() ) return; diff --git a/src/ui/orderandprops.hh b/src/ui/orderandprops.hh index d9234753..e42bc9a7 100644 --- a/src/ui/orderandprops.hh +++ b/src/ui/orderandprops.hh @@ -22,8 +22,7 @@ public: Config::Group getCurrentInactiveDictionaries() const; private slots: - - void dictionarySelectionChanged( const QItemSelection ¤t ); + void dictionarySelectionChanged( const QItemSelection & current, const QItemSelection & deselected ); void inactiveDictionarySelectionChanged( const QItemSelection ¤t ); void contextMenuRequested( const QPoint & pos ); void filterChanged( QString const & filterText );