I'm creating a custom widget to use from the Designer. Currently it's a simple class that has a constructor with no arguments passed. My question is how can I make this widget instantiated such that I specify a different constructor than the default, and pass arguments, for example other objects I may create problematically, not in the Designer. For instance, I have code like this in the form that uses my custom widget, generated by the Designer + VS Qt Plugin:
MyCustomWidget *myWidget1 = new MyCustomWidget();
MyCustomWidget *myWidget2 = new MyCustomWidget();
But I want something like this:
MyCustomWidget *myWidget1 = new MyCustomWidget(myObject1);
MyCustomWidget *myWidget2 = new MyCustomWidget(myObject2);
Where myObject* is created at programming time manually to encapsulate a set of callbacks for example.
Thanks.
Bookmarks