I added this line here and it works fine. I believe glossybutton was submitted by someone earlier than I implemented __hbqtAppWidget(). So add this line in your sources just after creating the application widget.
WITH OBJECT oBtn := QToolButton( oWnd )
:setGeometry( 100, 135, 100, 30 )
:setToolButtonStyle( Qt_ToolButtonTextOnly )
:setText( "press" )
:connect( "clicked()", {|| udf_test() } )
:connect( QEvent_Paint, { | oEvent, oPainter | udf_paint( oEvent, oPainter, oBtn ) } )
END WITH
__hbqtAppWidget( oWnd )
oWnd:show()