Re: ui not declared in scope
So on what line of what file are you getting that error? We can't read minds.
Re: ui not declared in scope
Quote:
Originally Posted by
squidge
So on what line of what file are you getting that error? We can't read minds.
Line 12 .
Re: ui not declared in scope
That is most likely because you don't have a ui member object or pointer or not inheriting from the ui auto-generated class.
See here the methods for using ui in the cpp file (i recommend the private member or pointer <don't forget to new the ui* if you use a pointer>)
Re: ui not declared in scope
Form1::Form1():QMainWindow(NULL,0)
It should be like this.....
ui(new Ui::QtMySql)
Re: ui not declared in scope
@Gokulnathvc: the only problem with the line you pointed to is that is doesn't take a parent and pass is to the QMainWindow constructor:
@Steve: the main problem is that he forgot to integrate the generated code, he only included the header ui_form.h:
Code:
#include "ui_form.h"
{
Q_OBJECT
public:
Form1();
~Form1();
protected slots:
void function1();
//this needs to be added:
private:
Ui_Form ui; //object or pointer whatever you prefer
// or you can use the class from Ui nanespace:
// Ui::Form ui;
// read the documentation page linked in my previous post
}