[vtkusers] vtkInteractorStyleImage and QT Widget

Alessandro notinmyhead at gmail.com
Tue Sep 4 10:21:17 EDT 2012


Il giorno 04/set/2012, alle ore 15.54, Alesssandro ha scritto:

> 
> Il giorno 04/set/2012, alle ore 15.44, David Doria ha scritto:
> 
>>> If I do so, I get (as I would expect) an error like that: error: invalid use of incomplete type 'struct CustomWidget' each time the code point to a public member of the CustomWidget...
>>> 
>>> I'd like to provide you a compilable file but they are extracted from a very huge project so unfortunately it'll take time...
>>> 
>>> Alessandro
>> 
>> 
>> It should work as long as you are just storing a pointer of one class
>> in the other (which you are). This is the pattern:
>> 
>> class ClassB;
>> 
>> class ClassA
>> {
>> ClassB* classB;
>> };
>> 
>> class ClassB
>> {
>> int data;
>> };
>> 
>> int main(int argc, char *argv[])
>> {
>> ClassA classA;
>> ClassB classB;
>> 
>> return 0;
>> }
>> 
>> Also, why are you declaring CustomWidget inside of Ui as well as outside of Ui :
>> 
>> namespace Ui {
>>   class CustomWidget;
>> }
>> 
>> class CustomWidget : public QWidget
>> {
>>   Q_OBJECT
>> ...
>> 
>> ?
>> 
>> David
> I do so because it is the way QT let you declare Widget with Designer form...
> 
> Ale
> 

I tried inverting classA and ClassB and it goes better until I try, in CustomWidget to instantiate a new CustomInteractorStlye using ::New():  error: incomplete type 'CustomInteractorStyle' used in nested name specifier

Ale


More information about the vtkusers mailing list