Hi there, folks!!
I have a bit of a problem here with being able to declare an object from a class derived from a UI file designed with Qt Designer, in other words:
in adddialog.h,
#ifndef ADDDIALOG_H
#define ADDDIALOG_H
#include "ui_adddialog.h"
class adddialog
: public QDialog,
private Ui
::AddDLG { Q_OBJECT
public:
adddialog ();
};
#endif // ADDDIALOG_H
#ifndef ADDDIALOG_H
#define ADDDIALOG_H
#include "ui_adddialog.h"
class adddialog : public QDialog, private Ui::AddDLG {
Q_OBJECT
public:
adddialog ();
};
#endif // ADDDIALOG_H
To copy to clipboard, switch view to plain text mode
in adddialog.cpp,
#include "adddialog.h"
adddialog::adddialog() {
setupUi(this);
}
#include "adddialog.h"
adddialog::adddialog() {
setupUi(this);
}
To copy to clipboard, switch view to plain text mode
and in the implementation of the main window,
#include "adddialog.h"
...
void mainwindow::adddialog() {
adddialog add;
add.show();
}
#include "adddialog.h"
...
void mainwindow::adddialog() {
adddialog add;
add.show();
}
To copy to clipboard, switch view to plain text mode
void adddialog in the class mainwindow is a slot, later used to connect a button to it, and hence make an "Add Dialog" launch whenever the button is clicked.
When I run this code I get the following errors:
"expected ; before 'add' "
"statement cannot resolve address of overloaded function"
" 'add' was not declared in this scope"
What am I doing wrong??? As usual sample code would be very appreaciated.
Thanks in advance
Bookmarks