Hello!
I want to connect a function in my MainWindow-class to a PushButton in a QDialog, that could be opened from the MainWindow.
The following message appears while compiling:
object missing in reference to ‘Ui_AddressBook::addCustomerButton’
MainWindow.cpp
connect(AddressBook::addCustomerButton ,SIGNAL(clicked()), this, SLOT(newcustomer()));
connect(AddressBook::addCustomerButton ,SIGNAL(clicked()), this, SLOT(newcustomer()));
To copy to clipboard, switch view to plain text mode
addressbook.h
class AddressBook
: public QDialog,
public Ui
::AddressBook
class AddressBook : public QDialog, public Ui::AddressBook
To copy to clipboard, switch view to plain text mode
ui_addressbook.h
class Ui_AddressBook
{
public:
class Ui_AddressBook
{
public:
QPushButton *addCustomerButton;
To copy to clipboard, switch view to plain text mode
After typing "connect(AddressBook::" the code completion in QtCreator appears and shows the button.
Do you know what I am doing wrong?
Is it neccessary to connect to button to a defined object, e.g.
AddressBook* test = new AddressBook;
connect(test->pushButton, SIGNAL(clicked()),...
AddressBook* test = new AddressBook;
connect(test->pushButton, SIGNAL(clicked()),...
To copy to clipboard, switch view to plain text mode
Or is it only possible to connect it to a class in general? Or both?
Kind regards,
HomeR
Bookmarks