eLancaster
4th December 2010, 13:10
Hi there.
I'm folloiwng the Qt Tutorials from the Qt website (if anyone knows of better tutorials, please tell me the link).
I wrote this code on QtCreator and it gave me an error
class MyWidget : public QMainWindow
{
Q_OBJECT
public:
explicit MyWidget(QWidget *parent = 0);
~MyWidget();
private:
Ui::MyWidget *ui;
};
MyWidget::MyWidget(QWidget *parent)
: QWidget(parent)//ERROR
{
QPushButton *quit = new QPushButton("Close Application", this);
quit->setGeometry(150,150,100,100);
quit->setFont(QFont("Times",12,QFont::Bold));
connect(quit,SIGNAL(clicked()),qApp,SLOT(quit()));
}
Error: Type "QWidget" is not direct base of 'MyWidget'.
Could someone tell me where I've gone wrong - thanks!
I'm folloiwng the Qt Tutorials from the Qt website (if anyone knows of better tutorials, please tell me the link).
I wrote this code on QtCreator and it gave me an error
class MyWidget : public QMainWindow
{
Q_OBJECT
public:
explicit MyWidget(QWidget *parent = 0);
~MyWidget();
private:
Ui::MyWidget *ui;
};
MyWidget::MyWidget(QWidget *parent)
: QWidget(parent)//ERROR
{
QPushButton *quit = new QPushButton("Close Application", this);
quit->setGeometry(150,150,100,100);
quit->setFont(QFont("Times",12,QFont::Bold));
connect(quit,SIGNAL(clicked()),qApp,SLOT(quit()));
}
Error: Type "QWidget" is not direct base of 'MyWidget'.
Could someone tell me where I've gone wrong - thanks!