WIDGET ERROR
-
Hi
I am getting the following error when building :-
@
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.
@The widget is defined as following:
@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dialogEmail</class>
<widget class="QDialog" name="dialogEmail">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>255</width>
<height>336</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="labelEmail_address">
<property name="text">
<string>To:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEmail_address"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelSubject">
<property name="text">
<string>Subject:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineSubject"/>
</item>
<item row="5" column="0" colspan="2">
<widget class="QDialogButtonBox" name="bboxEmail">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Discard|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Name of set</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QComboBox" name="comboName_of_set_3"/>
</item>
<item>
<widget class="QListWidget" name="listName_of_set_3">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Set</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Name of project</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QComboBox" name="comboName_of_project_3"/>
</item>
<item>
<widget class="QListWidget" name="listName_of_project_3">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item row="4" column="0" colspan="2">
<widget class="QGroupBox" name="groupMessage">
<property name="title">
<string>Message</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QTextEdit" name="editMessage_2"/>
</item>
<item>
<widget class="QCheckBox" name="checkRead_Only">
<property name="text">
<string>Send drawings as read only (Export to PDF)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
@Is there something missing in this declaration ?
It seems that is not complete ?Thanks
Roy -
Hi,
can you please make a sense-full thread header? This header is much too generic.
Most people can't read Qt ui code directly. perhaps you have some problems in the using code (cpp, h) or in the project file. Please pack everything as small zip or create a small example that has the same error and upload it somewhere so we have the possibility to run qmake on our own.
It's really hard to find errors in the xml code of the ui file.
-
Well your UI file looks good and renders correctly once processed by uic.
could you provide your email.cpp and email.h ? Did you think to include "ui_dialogEmail.h" (the file generated by uic) ?
-
in your header you need to include the lines
@namespace Ui { class dialogEmail; }@