Hi,

just use the regular "Promoted Widgets" feature of Qt creator. The creator will 
not show you the actual Qmitk Widget, but the substitute you specified 
(probably just QWidget). When you check "global include" you just have to make 
sure that the compiler can resolve the include path like with any other class. 
Qt just pretends that there is a certain widget class but it actually doesn't 
really care about it as long as it fulfills the interface of QWidget.


Best,

Stefan

________________________________
Von: Ivaylo Angelov <ivaylo_ange...@gmx.de>
Gesendet: Samstag, 27. Juni 2020 14:49
An: MITK Mailinglist
Betreff: [mitk-users] Inheriting from Qmitk Widgets / widget promotion

Dear all,

I would highly appreciate some advice regarding the following issue:

I have a plugin with a view in which I use the 
QmitkTransferFunctionGeneratorWidget (though the question is more general, 
could be any Qmitk widget).
Now I would like to extend widget, therefore I created a custom one, inheriting 
from QmitkTransferFunctionGeneratorWidget within my plugin. (I am working with 
the Project template, by the way)
The last thing I would like to do is to be able to promote a widget within my 
view to my custom widget and this is where I
don't know how to continue.
For Qmitk widgets it seems to just work by adding the header file name and the 
class name in the "Promoted widgets" tab
of Qt Creator... given that I am inheriting from a Qmitk widget, is there a 
neat way to accomplish the same with my custom widget?

I am aware that this has a lot to do with Qt but I am trying to understand how 
it is possible for the Qmitk widgets to be found by just typing in the name of 
the header file without the full path (I have added a screenshot to show what I 
mean) and I guess understanding that would help me accomplish what I am trying 
to do now.

Thank you in advance and I look forward to hearing from you!

Kind regards
Ivaylo Angelov
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to