First of all you have memory leak in Widget::ShowQML.
Second, are you trying to register Widget (which inherits QWidget) here qmlRegisterType<Widget>("File", 1,1, "TextUpdate");?