@@ -77,10 +77,8 @@ void MainWindow::init()
7777 ui->dbTreeWidget ->setColumnWidth (0 , 300 );
7878
7979 // Set up filter row
80- FilterTableHeader* tableHeader = new FilterTableHeader (ui->dataTable );
81- connect (tableHeader, SIGNAL (filterChanged (int ,QString)), m_browseTableModel, SLOT (updateFilter (int ,QString)));
82- connect (tableHeader, SIGNAL (filterChanged (int ,QString)), this , SLOT (setRecordsetLabel ()));
83- ui->dataTable ->setHorizontalHeader (tableHeader);
80+ m_tableHeader = new FilterTableHeader (ui->dataTable );
81+ ui->dataTable ->setHorizontalHeader (m_tableHeader);
8482
8583 // Create the actions for the recently opened dbs list
8684 for (int i = 0 ; i < MaxRecentFiles; ++i) {
@@ -118,7 +116,8 @@ void MainWindow::init()
118116 ui->statusbar ->addPermanentWidget (statusEncodingLabel);
119117
120118 // Connect some more signals and slots
121- connect (tableHeader, SIGNAL (sectionClicked (int )), this , SLOT (browseTableHeaderClicked (int )));
119+ connect (m_tableHeader, SIGNAL (filterChanged (int ,QString)), this , SLOT (setRecordsetLabel ()));
120+ connect (m_tableHeader, SIGNAL (sectionClicked (int )), this , SLOT (browseTableHeaderClicked (int )));
122121 connect (ui->dataTable ->verticalScrollBar (), SIGNAL (valueChanged (int )), this , SLOT (setRecordsetLabel ()));
123122 connect (editWin, SIGNAL (goingAway ()), this , SLOT (editWinAway ()));
124123 connect (editWin, SIGNAL (updateRecordText (int , int , QByteArray)), this , SLOT (updateRecordText (int , int , QByteArray)));
@@ -365,6 +364,7 @@ void MainWindow::fileClose()
365364 // Delete the model for the Browse tab and create a new one
366365 delete m_browseTableModel;
367366 m_browseTableModel = new SqliteTableModel (this , &db, PreferencesDialog::getSettingsValue (" db" , " prefetchsize" ).toInt ());
367+ connect (m_tableHeader, SIGNAL (filterChanged (int ,QString)), m_browseTableModel, SLOT (updateFilter (int ,QString)));
368368
369369 // Manually update the recordset label inside the Browse tab now
370370 setRecordsetLabel ();
0 commit comments