... please update this method:
Code: Select all
METHOD CentralWidgetOf( oValue ) CLASS WIDGET
Local o
IF Pcount() == 0
RETURN ::oCentral
ELSEIF Pcount() == 1
// Protection: we can't reassign multiple Widget to Central Widget
// retrieve current central Widget
IF valtype( ::oCentral ) == "U"
::oCentral := oValue
ENDIF
IF ::lCreated
o := oValue:oQTObject:centralWidget()
// if returned pointer is not valid (means there is no central widget already set)
// and widget is created
IF ! o:hasvalidPointer()
::setCentralWidget( oValue )
RETURN .T.
ENDIF
ENDIF
ENDIF
RETURN .F.