Widget Error Update



  • src/email.cpp: In constructor 'Email::Email(QWidget*)':
    src/email.cpp:5: error: invalid use of incomplete type 'struct Ui::dialogEmail'
    src/email.h:8: error: forward declaration of 'struct Ui::dialogEmail'
    src/email.cpp:7: error: invalid use of incomplete type 'struct Ui::dialogEmail'
    src/email.h:8: error: forward declaration of 'struct Ui::dialogEmail'
    src/email.cpp: In destructor 'virtual Email::~Email()':
    src/email.cpp:12: warning: possible problem detected in invocation of delete operator:
    src/email.cpp:12: warning: invalid use of incomplete type 'struct Ui::dialogEmail'
    src/email.h:8: warning: forward declaration of 'struct Ui::dialogEmail'
    src/email.cpp:12: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.

    I can't add on to my first Widget Error so I am adding the extra infomation requested here
    This is email.h :-

    @
    #ifndef EMAIL_H
    #define EMAIL_H

    #include <QtGui/QDialog>

    namespace Ui
    {
    class dialogEmail;
    }

    class Email : public QDialog
    {
    Q_OBJECT

    public:
    Email(QWidget *parent = 0);
    ~Email();

    public slots:
    void accept();

    private:
    Ui::dialogEmail *ui;

    };

    #endif // EMAIL_H
    @

    and this is email.cpp :-

    @
    #include "email.h"
    #include "ui_email.h"
    #include <QSettings>
    // added setup
    Email::Email(QWidget *parent) : QDialog(parent), ui(new Ui::dialogEmail)
    {
    ui->setupUi(this);
    }

    Email::~Email()
    {
    delete ui;
    }

    void Email::accept()
    {
    QSettings settings("abycad.com","abycad");
    }
    @

    Thanks for the help

    EDIT: added @-tags for source code, Gerolf

    I have checked my pro and Forms += email.ui is there.

    Below is full compile output of my build :-

    @
    Running build steps for project abycad2...
    Configuration unchanged, skipping qmake step.
    Starting: "F:/Qt/2010.04/mingw/bin/mingw32-make.exe" -w
    mingw32-make: Entering directory F:/Qt/2010.04/qt/abycad2' F:/Qt/2010.04/mingw/bin/mingw32-make -f Makefile.Release all mingw32-make[1]: Entering directoryF:/Qt/2010.04/qt/abycad2'
    g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\include\QtCore" -I"..\include\QtGui" -I"..\include\QtSvg" -I"..\include" -I"..\include\ActiveQt" -I"tmp\moc\release_shared" -I"." -I"..\mkspecs\win32-g++" -o tmp\obj\release_shared\email.o src\email.cpp
    src\email.cpp: In constructor 'Email::Email(QWidget*)':
    src\email.cpp:5: error: invalid use of incomplete type 'struct Ui::dialogEmail'
    src/email.h:8: error: forward declaration of 'struct Ui::dialogEmail'
    src\email.cpp:7: error: invalid use of incomplete type 'struct Ui::dialogEmail'
    src/email.h:8: error: forward declaration of 'struct Ui::dialogEmail'
    src\email.cpp: In destructor 'virtual Email::~Email()':
    src\email.cpp:12: warning: possible problem detected in invocation of delete operator:
    src\email.cpp:12: warning: invalid use of incomplete type 'struct Ui::dialogEmail'
    src/email.h:8: warning: forward declaration of 'struct Ui::dialogEmail'
    src\email.cpp:12: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.
    mingw32-make[1]: Leaving directory F:/Qt/2010.04/qt/abycad2' mingw32-make: Leaving directoryF:/Qt/2010.04/qt/abycad2'
    mingw32-make[1]: *** [tmp/obj/release_shared/email.o] Error 1
    mingw32-make: *** [release-all] Error 2
    The process "F:/Qt/2010.04/mingw/bin/mingw32-make.exe" exited with code %2.
    Error while building project abycad2 (target: Desktop)
    When executing build step 'Make'
    @



  • This reminds me of another post, still the same issue ?

    to quote your code use "@" markers, it's more readable



  • Hem, I took your email.h, email.cpp, email.ui, and tried
    @
    qmake -pro
    qmake -tp vc -r
    @
    it does compile...



  • All sounds your pro file does not contain the forms part:

    @
    FORMS += email.ui
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.