waynew
8th November 2009, 01:37
A pushbutton, pbSave, in the StnInfoDialog form needs to call the slot insertInfo in the stninfodialog.cpp passing the value of the form field 'call'
Here is the code:
#include "stninfodialog.h"
#include "ui_stninfodialog.h"
#include "makestndb.h"
#include "insertstninfo.h"
#include <QDebug>
StnInfoDialog::StnInfoDialog(QWidget *parent) :
QDialog(parent),
m_ui(new Ui::StnInfoDialog)
{
m_ui->setupUi(this);
connect(m_ui->pbSave, SIGNAL(clicked(bool)),
this, SLOT(insertInfo(m_ui->call->text())));
}
}
void StnInfoDialog::insertInfo(QString mycall)
{
InsertStnInfo insert;
insert.insertStnInfo(mycall);
}
Problem is, the slot never gets called when pbSave is clicked.
Can someone please show me what I am doing wrong?
Here is the code:
#include "stninfodialog.h"
#include "ui_stninfodialog.h"
#include "makestndb.h"
#include "insertstninfo.h"
#include <QDebug>
StnInfoDialog::StnInfoDialog(QWidget *parent) :
QDialog(parent),
m_ui(new Ui::StnInfoDialog)
{
m_ui->setupUi(this);
connect(m_ui->pbSave, SIGNAL(clicked(bool)),
this, SLOT(insertInfo(m_ui->call->text())));
}
}
void StnInfoDialog::insertInfo(QString mycall)
{
InsertStnInfo insert;
insert.insertStnInfo(mycall);
}
Problem is, the slot never gets called when pbSave is clicked.
Can someone please show me what I am doing wrong?