PDA

View Full Version : Form problem



dusza
28th May 2009, 18:53
Hi,

I want to append line in textBrowser in one of my forms in application, but I can't simply type myForm[index]->m_ui->textBrowser->append(textToSet) because I get compile error mainwindow.cpp:109: error: invalid use of incomplete type ‘struct Ui::Form’
form.h:7: error: forward declaration of ‘struct Ui::Form’

here is form.h code:

#ifndef FORM_H
#define FORM_H

#include <QtGui/QWidget>

namespace Ui {
class Form;
}

class Form : public QWidget {
Q_OBJECT
Q_DISABLE_COPY(Form)
public:
explicit Form(QWidget *parent = 0);
virtual ~Form();
int userid;
QString user_name;
QString textToShow;

public:
virtual void changeEvent(QEvent *e);

public:
Ui::Form *m_ui;

public slots:
void on_pushButton_clicked();
};

#endif // FORM_H

I spent lot of time trying to fix it but I could not find the reason.

wysota
28th May 2009, 18:56
You need to include the ui_form.h (or equivalent) somewhere in the cpp file.

dusza
28th May 2009, 23:41
thanks a lot!