PDA

View Full Version : how to subclass a qwidget in ui file



newcfd
13th October 2015, 19:51
I made a ui file with designer. It has a push button ui.btnOK.
But in my application I need to create a new class
class MyButton : QPushButton
{
};
to replace ui.btnOK. How do I do it?

Thanks for your help.

d_stranz
13th October 2015, 20:08
Reading the Qt Designer docs (http://doc.qt.io/qt-5.5/designer-using-custom-widgets.html) might be a good place to start.

newcfd
13th October 2015, 20:14
got it. Thanks a lot