waynew
17th April 2010, 22:58
This should be simple, but I don't see it.
Trying to emit a signal in the EditLog class to call a slot in the MainWindow.
No error, but the slot doesn't get called.
the EditLog.h entries:
signals:
void logChanged();
private slots:
void on_pbSave_clicked();
void on_pbCancel_clicked();
the EditLog cpp
void EditLog::on_pbSave_clicked()
{
// some code
emit logChanged();
the MainWindow.h
public slots:
void updateLogView();
the MainWindow.cpp // updateLogView never gets executed
// in the constructor:
EditLog el;
connect(&el, SIGNAL(logChanged()), this, SLOT(updateLogView()));
//
void MainWindow::updateLogView() {
view->selectionModel()->clearSelection();
model->select();
view->resizeColumnsToContents();
qDebug() << "edit model error is " << model->lastError();
}
Any idea what I am missing?
Trying to emit a signal in the EditLog class to call a slot in the MainWindow.
No error, but the slot doesn't get called.
the EditLog.h entries:
signals:
void logChanged();
private slots:
void on_pbSave_clicked();
void on_pbCancel_clicked();
the EditLog cpp
void EditLog::on_pbSave_clicked()
{
// some code
emit logChanged();
the MainWindow.h
public slots:
void updateLogView();
the MainWindow.cpp // updateLogView never gets executed
// in the constructor:
EditLog el;
connect(&el, SIGNAL(logChanged()), this, SLOT(updateLogView()));
//
void MainWindow::updateLogView() {
view->selectionModel()->clearSelection();
model->select();
view->resizeColumnsToContents();
qDebug() << "edit model error is " << model->lastError();
}
Any idea what I am missing?