@@ -180,12 +180,12 @@ void MainWindow::init()
180180 ui->editGoto ->setValidator (gotoValidator);
181181
182182 // Set up filters
183- connect (ui->dataTable ->filterHeader (), SIGNAL ( filterChanged ( int ,QString)), this , SLOT ( updateFilter ( int ,QString)) );
184- connect (ui->dataTable ->filterHeader (), SIGNAL ( addCondFormat ( int ,QString)), this , SLOT ( addCondFormat ( int ,QString)) );
185- connect (ui->dataTable ->filterHeader (), SIGNAL ( clearAllCondFormats ( int )) , this , SLOT ( clearAllCondFormats ( int )) );
186- connect (ui->dataTable ->filterHeader (), SIGNAL ( editCondFormats ( int )) , this , SLOT ( editCondFormats ( int )) );
187- connect (ui->dataTable , SIGNAL ( editCondFormats ( int )) , this , SLOT ( editCondFormats ( int )) );
188- connect (m_browseTableModel, SIGNAL ( dataChanged (QModelIndex,QModelIndex)), this , SLOT ( dataTableSelectionChanged (QModelIndex)) );
183+ connect (ui->dataTable ->filterHeader (), &FilterTableHeader:: filterChanged, this , &MainWindow:: updateFilter);
184+ connect (ui->dataTable ->filterHeader (), &FilterTableHeader:: addCondFormat, this , &MainWindow:: addCondFormat);
185+ connect (ui->dataTable ->filterHeader (), &FilterTableHeader::allCondFormatsCleared , this , &MainWindow:: clearAllCondFormats);
186+ connect (ui->dataTable ->filterHeader (), &FilterTableHeader::condFormatsEdited , this , &MainWindow:: editCondFormats);
187+ connect (ui->dataTable , &ExtendedTableWidget:: editCondFormats, this , &MainWindow:: editCondFormats);
188+ connect (m_browseTableModel, &SqliteTableModel:: dataChanged, this , &MainWindow:: dataTableSelectionChanged);
189189
190190 // Select in table the rows correspoding to the selected points in plot
191191 connect (plotDock, SIGNAL (pointsSelected (int ,int )), ui->dataTable , SLOT (selectTableLines (int ,int )));
@@ -235,9 +235,9 @@ void MainWindow::init()
235235 // Add keyboard shortcuts
236236
237237 QShortcut* shortcutBrowseRefreshF5 = new QShortcut (QKeySequence (" F5" ), this );
238- connect (shortcutBrowseRefreshF5, SIGNAL ( activated ()) , this , SLOT ( refresh ()) );
238+ connect (shortcutBrowseRefreshF5, &QShortcut:: activated, this , &MainWindow:: refresh);
239239 QShortcut* shortcutBrowseRefreshCtrlR = new QShortcut (QKeySequence (" Ctrl+R" ), this );
240- connect (shortcutBrowseRefreshCtrlR, SIGNAL ( activated ()) , this , SLOT ( refresh ()) );
240+ connect (shortcutBrowseRefreshCtrlR, &QShortcut:: activated, this , &MainWindow:: refresh);
241241
242242 // Add print shortcut for the DB Structure tab (dbTreeWidget) with context to the widget, so other print shortcuts aren't eclipsed.
243243 QShortcut* shortcutPrint = new QShortcut (QKeySequence (QKeySequence::Print), ui->dbTreeWidget , nullptr , nullptr , Qt::WidgetShortcut);
@@ -439,16 +439,16 @@ void MainWindow::init()
439439 });
440440
441441 // Connect some more signals and slots
442- connect (ui->dataTable ->filterHeader (), SIGNAL ( sectionClicked ( int )) , this , SLOT ( browseTableHeaderClicked ( int )) );
442+ connect (ui->dataTable ->filterHeader (), &FilterTableHeader:: sectionClicked, this , &MainWindow:: browseTableHeaderClicked);
443443 connect (ui->dataTable ->filterHeader (), &QHeaderView::sectionDoubleClicked, ui->dataTable , &QTableView::selectColumn);
444- connect (ui->dataTable ->verticalScrollBar (), SIGNAL ( valueChanged ( int )) , this , SLOT ( setRecordsetLabel ()) );
445- connect (ui->dataTable ->horizontalHeader (), SIGNAL ( sectionResized ( int , int , int )), this , SLOT ( updateBrowseDataColumnWidth ( int , int , int )) );
446- connect (editDock, SIGNAL ( recordTextUpdated (QPersistentModelIndex, QByteArray, bool )), this , SLOT ( updateRecordText (QPersistentModelIndex, QByteArray, bool )) );
447- connect (ui->dbTreeWidget ->selectionModel (), SIGNAL ( currentChanged (QModelIndex,QModelIndex)), this , SLOT ( changeTreeSelection ()) );
448- connect (ui->dataTable ->horizontalHeader (), SIGNAL ( customContextMenuRequested (QPoint)) , this , SLOT ( showDataColumnPopupMenu (QPoint)) );
449- connect (ui->dataTable ->verticalHeader (), SIGNAL ( customContextMenuRequested (QPoint)) , this , SLOT ( showRecordPopupMenu (QPoint)) );
444+ connect (ui->dataTable ->verticalScrollBar (), &QScrollBar:: valueChanged, this , &MainWindow:: setRecordsetLabel);
445+ connect (ui->dataTable ->horizontalHeader (), &QHeaderView:: sectionResized, this , &MainWindow:: updateBrowseDataColumnWidth);
446+ connect (editDock, &EditDialog:: recordTextUpdated, this , &MainWindow:: updateRecordText);
447+ connect (ui->dbTreeWidget ->selectionModel (), &QItemSelectionModel:: currentChanged, this , &MainWindow:: changeTreeSelection);
448+ connect (ui->dataTable ->horizontalHeader (), &QHeaderView:: customContextMenuRequested, this , &MainWindow:: showDataColumnPopupMenu);
449+ connect (ui->dataTable ->verticalHeader (), &QHeaderView:: customContextMenuRequested, this , &MainWindow:: showRecordPopupMenu);
450450 connect (ui->dataTable , SIGNAL (openFileFromDropEvent (QString)), this , SLOT (fileOpen (QString)));
451- connect (ui->dockEdit , SIGNAL ( visibilityChanged ( bool )) , this , SLOT ( toggleEditDock ( bool )) );
451+ connect (ui->dockEdit , &QDockWidget:: visibilityChanged, this , &MainWindow:: toggleEditDock);
452452 connect (m_remoteDb, SIGNAL (openFile (QString)), this , SLOT (fileOpen (QString)));
453453 connect (m_remoteDb, &RemoteDatabase::gotCurrentVersion, this , &MainWindow::checkNewVersion);
454454 connect (m_browseTableModel, &SqliteTableModel::finishedFetch, this , &MainWindow::setRecordsetLabel);
@@ -739,7 +739,7 @@ void MainWindow::populateTable()
739739 ui->dataTable ->setModel (m_browseTableModel);
740740 if (reconnectSelectionSignals)
741741 {
742- connect (ui->dataTable ->selectionModel (), SIGNAL ( currentChanged (QModelIndex,QModelIndex)), this , SLOT ( dataTableSelectionChanged (QModelIndex)) );
742+ connect (ui->dataTable ->selectionModel (), &QItemSelectionModel:: currentChanged, this , &MainWindow:: dataTableSelectionChanged);
743743 connect (ui->dataTable ->selectionModel (), &QItemSelectionModel::selectionChanged, [this ](const QItemSelection&, const QItemSelection&) {
744744 updateInsertDeleteRecordButton ();
745745
@@ -1077,9 +1077,8 @@ void MainWindow::attachPlot(ExtendedTableWidget* tableWidget, SqliteTableModel*
10771077 disconnect (plotDock, SIGNAL (pointsSelected (int ,int )), nullptr , nullptr );
10781078 if (tableWidget) {
10791079 // Connect plot selection to the current table results widget.
1080- connect (plotDock, SIGNAL (pointsSelected (int ,int )), tableWidget, SLOT (selectTableLines (int ,int )));
1081- connect (tableWidget, SIGNAL (destroyed ()), plotDock, SLOT (resetPlot ()));
1082-
1080+ connect (plotDock, &PlotDock::pointsSelected, tableWidget, &ExtendedTableWidget::selectTableLines);
1081+ connect (tableWidget, &ExtendedTableWidget::destroyed, plotDock, &PlotDock::resetPlot);
10831082 }
10841083}
10851084
@@ -1578,7 +1577,7 @@ void MainWindow::executeQuery()
15781577 disconnect (*conn);
15791578
15801579 attachPlot (sqlWidget->getTableResult (), sqlWidget->getModel ());
1581- connect (sqlWidget->getTableResult ()->selectionModel (), SIGNAL ( currentChanged (QModelIndex,QModelIndex)), this , SLOT ( dataTableSelectionChanged (QModelIndex)) );
1580+ connect (sqlWidget->getTableResult ()->selectionModel (), &QItemSelectionModel:: currentChanged, this , &MainWindow:: dataTableSelectionChanged);
15821581 connect (sqlWidget->getTableResult (), &QTableView::doubleClicked, this , &MainWindow::doubleClickTable);
15831582
15841583 auto time_end = std::chrono::high_resolution_clock::now ();
@@ -2404,11 +2403,11 @@ int MainWindow::openSqlTab(bool resetCounter)
24042403 // would interfere with the search bar and it'd be anyway redundant.
24052404 w->getEditor ()->setEnabledFindDialog (false );
24062405 w->getEditor ()->setFocus ();
2407- connect (w, SIGNAL ( findFrameVisibilityChanged ( bool )) , ui->actionSqlFind , SLOT ( setChecked ( bool )) );
2406+ connect (w, &SqlExecutionArea:: findFrameVisibilityChanged, ui->actionSqlFind , &QAction:: setChecked);
24082407
24092408 // Connect now the find shortcut to the editor with widget context, so it isn't ambiguous with other Scintilla Widgets.
24102409 QShortcut* shortcutFind = new QShortcut (ui->actionSqlFind ->shortcut (), w->getEditor (), nullptr , nullptr , Qt::WidgetShortcut);
2411- connect (shortcutFind, SIGNAL ( activated ()) , ui->actionSqlFind , SLOT ( toggle ()) );
2410+ connect (shortcutFind, &QShortcut:: activated, ui->actionSqlFind , &QAction:: toggle);
24122411
24132412 return index;
24142413}
0 commit comments