[vtkusers] vtkInteractorStyleImage and QT Widget
Alesssandro
notinmyhead at gmail.com
Tue Sep 4 09:54:28 EDT 2012
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
More information about the vtkusers
mailing list