I am having trouble with the following code can someone explain what i am doing wrong. It is a main window application that has a dialog open up and im trying to create a button that saves the input from the user. but when i press the button it does gives the follwoing error
Object
::connect: No such
slot QDialog::SaveSettings() in serverDialog.
cpp:6Object::connect: (sender name: 'pushButton_Save')
Object::connect: (receiver name: 'Dialog')
Object::connect: No such slot QDialog::SaveSettings() in serverDialog.cpp:6
Object::connect: (sender name: 'pushButton_Save')
Object::connect: (receiver name: 'Dialog')
To copy to clipboard, switch view to plain text mode
#ifndef SERVERDIALOG_H
#define SERVERDIALOG_H
#include "ui_serverDialog.h"
class ServerDialog
: public QDialog,
public Ui
::Dialog{
public:
ServerDialog();
protected slots:
void SaveSettings();
};
#endif // SERVERDIALOG_H
#ifndef SERVERDIALOG_H
#define SERVERDIALOG_H
#include "ui_serverDialog.h"
class ServerDialog: public QDialog, public Ui::Dialog
{
public:
ServerDialog();
protected slots:
void SaveSettings();
};
#endif // SERVERDIALOG_H
To copy to clipboard, switch view to plain text mode
#include "serverDialog.h"
ServerDialog::ServerDialog()
{
setupUi(this);
connect(pushButton_Save, SIGNAL(clicked()), this, SLOT(SaveSettings()));
connect(pushButton_Quit, SIGNAL(clicked()), this, SLOT(close()));
}
void ServerDialog::SaveSettings()
{
}
#include "serverDialog.h"
ServerDialog::ServerDialog()
{
setupUi(this);
connect(pushButton_Save, SIGNAL(clicked()), this, SLOT(SaveSettings()));
connect(pushButton_Quit, SIGNAL(clicked()), this, SLOT(close()));
}
void ServerDialog::SaveSettings()
{
}
To copy to clipboard, switch view to plain text mode
This was created using Qtcreator.
if i change the slot to close() it works perfectly. how would i get the method SaveSettings to run.
many thanks
jeff
Bookmarks