Results 1 to 3 of 3

Thread: Problem with Qt Netbeans, method calls

  1. #1
    Join Date
    Apr 2013
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem with Qt Netbeans, method calls

    Hi,

    I set up Qt for Netbeans yesterday following this tutorial : https://netbeans.org/kb/docs/cnd/qt-applications.html
    But I have a problem with the Qt Library.

    I create a HelloForm class (example) but I have compilation problems, just making a call of an instance of HelloForm :

    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include <QtGui>
    3.  
    4. #include "HelloForm.h"
    5.  
    6. int main(int argc, char *argv[]) {
    7.  
    8. QApplication app(argc, argv);
    9.  
    10. HelloForm form();
    11. // form.show();
    12.  
    13. return app.exec();
    14. }
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. #ifndef _HELLOFORM_H
    2. #define _HELLOFORM_H
    3.  
    4. #include "ui_HelloForm.h"
    5.  
    6. class HelloForm : public QWidget {
    7. Q_OBJECT
    8. public:
    9. HelloForm();
    10. virtual ~HelloForm();
    11. private:
    12. Ui::HelloForm widget;
    13. };
    14.  
    15. #endif /* _HELLOFORM_H */
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. #include "HelloForm.h"
    2.  
    3. HelloForm::HelloForm() {
    4. widget.setupUi(this);
    5. }
    6.  
    7. HelloForm::~HelloForm() {
    8. }
    To copy to clipboard, switch view to plain text mode 

    Erros are :

    Qt Code:
    1. HelloForm.cpp: In constructor 'HelloForm::HelloForm()':
    2. HelloForm.cpp:11:24: erreur: no matching function for call to 'Ui::HelloForm::setupUi(HelloForm* const)'
    3. HelloForm.cpp:11:24: note: candidate is:
    4. In file included from HelloForm.h:11:0,
    5. from HelloForm.cpp:8:
    6. ui_HelloForm.h:28:10: note: void Ui_HelloForm::setupUi(QDialog*)
    7. ui_HelloForm.h:28:10: note: no known conversion for argument 1 from 'HelloForm* const' to 'QDialog*'
    To copy to clipboard, switch view to plain text mode 

    I checked the Qt parameters and everthing seems to be ok... Any idea ?
    I am using Qt 4.8.x and Netbeans 7.2

    Thanks

  2. #2
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problem with Qt Netbeans, method calls

    did u try clean and make again?

    Hope it helps,
    Bala

  3. #3
    Join Date
    Apr 2013
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with Qt Netbeans, method calls

    I did.
    Could it be a version problem ?

Similar Threads

  1. Qt Open Gl Programming in Netbeans IDE
    By chintu in forum Newbie
    Replies: 12
    Last Post: 17th September 2012, 09:10
  2. Netbeans IDE - Debugging Qt apps
    By johnnyturbo3 in forum Newbie
    Replies: 1
    Last Post: 27th January 2011, 14:49
  3. Replies: 1
    Last Post: 25th November 2010, 11:37
  4. Netbeans IDE
    By Petr_Kropotkin in forum General Discussion
    Replies: 0
    Last Post: 11th October 2010, 18:08
  5. qt4.x in netbeans 6.5
    By siddharth_univ in forum Qt Programming
    Replies: 1
    Last Post: 20th December 2008, 03:16

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.