Important: Please read the Qt Code of Conduct -

Designer plugin which interface to get the widget promoted to?

  • Lifetime Qt Champion

    Im working on promotionWidget that can show info on the form about the widget its promoted to.

    However, I have small issue finding the interface that supply this info.

    The DesignerPromotionInterface::PromotedClass
    does contain all promoted widgets but I fail to see how i can know for a instance which entry it belongs to
    alt text

    Also the QDesignerWidgetDataBaseItemInterface contains the all the info, also if its promoted but I cannot see
    any method of getting the name of the class promoted to. (mywidget/mywidget2)
    Also the objectname seems not to be used for the list so i could use that to get promoted class for an instance.

    The Object inspector knows, so its here somewhere. :)

    Anyone, have a hint?

    ps. i have used WorldClock example as base, hence the name ;)

  • Lifetime Qt Champion

    Sorry. Was as a case of "need to clean" build folder. then it worked :)

    The QDesignerWidgetDataBaseInterface has indexOf
    int itemindex = db->indexOfObject(this);

Log in to reply