Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Widget Error Update
Forum Updated to NodeBB v4.3 + New Features

Widget Error Update

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Roy_CT
    wrote on last edited by
    #1

    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 directory F:/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 directory F:/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'
    @

    1 Reply Last reply
    0
    • F Offline
      F Offline
      florent.revelut
      wrote on last edited by
      #2

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

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

      1 Reply Last reply
      0
      • F Offline
        F Offline
        florent.revelut
        wrote on last edited by
        #3

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

        • "roy.pro":http://pastebin.com/Aygep4LA
        • "email.h":http://pastebin.com/M2J5uZCA
        • "email.cpp":http://pastebin.com/jJFKD2vz
        • "email.ui":http://pastebin.com/s9JrZwQD
        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

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

          @
          FORMS += email.ui
          @

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved