Results 1 to 3 of 3

Thread: Form problem

  1. #1
    Join Date
    May 2009
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Form problem

    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:
    Qt Code:
    1. #ifndef FORM_H
    2. #define FORM_H
    3.  
    4. #include <QtGui/QWidget>
    5.  
    6. namespace Ui {
    7. class Form;
    8. }
    9.  
    10. class Form : public QWidget {
    11. Q_OBJECT
    12. Q_DISABLE_COPY(Form)
    13. public:
    14. explicit Form(QWidget *parent = 0);
    15. virtual ~Form();
    16. int userid;
    17. QString user_name;
    18. QString textToShow;
    19.  
    20. public:
    21. virtual void changeEvent(QEvent *e);
    22.  
    23. public:
    24. Ui::Form *m_ui;
    25.  
    26. public slots:
    27. void on_pushButton_clicked();
    28. };
    29.  
    30. #endif // FORM_H
    To copy to clipboard, switch view to plain text mode 

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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Form problem

    You need to include the ui_form.h (or equivalent) somewhere in the cpp file.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    dusza (28th May 2009)

  4. #3
    Join Date
    May 2009
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Form problem

    thanks a lot!

Similar Threads

  1. visible main form?
    By triperzonak in forum Newbie
    Replies: 1
    Last Post: 12th June 2008, 09:00
  2. Problem When Creating my own Slot
    By Fatla in forum Qt Programming
    Replies: 12
    Last Post: 6th June 2008, 14:44
  3. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.