The problem is: when I close the first window I can't see the windowicon on the second.
If I have only one form it's work fine. The problem seem to be related with ::s_lQtStarted shared var that is .F. when I fired on the second form. I have placed
Code: Select all
IF ::s_lQtStarted == .F.
msgstop( cName + " ::" + hb_valtoexp( ::s_lQtStarted ) )
HMGAPP():Start()
ENDIF
Please take a look to this little source (note remember to change the resource file and the icons name to show the problem)
Code: Select all
FUNCTION Main
HbQt_ErrorSys()
HMGAPP():Resources := "stdicon"
HMGAPP():Start()
LoginSim()
ShowMain()
RETURN NIL
STATIC FUNCTION ShowMain()
LOCAL MainForm
WITH OBJECT MainForm := Window():New( "MainForm" )
:Row := 10
:Col := 10
:Width := 600
:Height := 600
:Title := "MainForm title"
:Type := WND_MAIN
:OnInit := { || MainFrmOnInit() }
:Icon := ":L3W_ICO"
END WITH
MainForm:Activate()
RETURN NIL
STATIC FUNCTION MainFrmOnInit()
THISWINDOW:Center()
RETURN NIL
STATIC FUNCTION LoginSim()
LOCAL LoginForm
WITH OBJECT LoginForm := Window():New( "LoginForm" )
:Row := 10
:Col := 10
:Width := 200
:Height := 200
:Title := "LoginForm title"
:Type := WND_MODAL
:OnInit := { || LoginFrmOnInit() }
:Icon := ":L3W_ICO"
END WITH
LoginForm:Activate()
RETURN NIL
STATIC FUNCTION LoginFrmOnInit()
THISWINDOW:Center()
RETURN NIL
p.s. I'm using Harbour compiler 3.x.x