Notify bug ?
Moderator: Rathinagiri
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Notify bug ?
Yep. Also, it is related with MsgInfo() also. If we don't use MsgInfo(), it works fine.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Notify bug ?
I tried to isolate MsgInfo() and the following code is still wrong:
Seems to be related with the way QMessageBox() is executed or how it is anchored to the parent window.
Need a deeper analysis in QT itself...
Code: Select all
#include "hbqtgui.ch"
#include "hmg.ch"
Function Main
hbqt_errorsys()
public oWindow
With Object oWindow := Window():New()
:Width := 400
:Height := 400
:Title := 'Hide bug...'
:Type := WND_MAIN
:NotifyIcon := 'new.png'
:NotifyToolTip := 'Hi All!'
:OnNotifyClick := { || msgOther() }
With Object oNotify := NotifyMenu():New(oWindow)
oItemHide := MenuItem():New( 'Hide Main Window' , { || oWindow:Hide() } ) ; :AddItem(oItemHide)
:AddSeparator()
oItemShow := MenuItem():New( 'Show Main Window' , { || oWindow:Show() } ) ; :AddItem(oItemShow)
End With
End With
oWindow:Activate()
Return Nil
static function msgOther()
local oMB := QMessageBox()
oMB:setText( 'Notify Icon Clicked!' )
oMB:exec()
RETURN nil
Need a deeper analysis in QT itself...
[[]] Mauricio Ventura Faria
Re: Notify bug ?
Very ugly workaround ! 
Code: Select all
#include "hbqtgui.ch"
#include "hmg.ch"
Function Main
hbqt_errorsys()
public oWindow
With Object oWindow := Window():New()
:Width := 400
:Height := 400
:Title := 'Hide bug...'
:Type := WND_MAIN
:NotifyIcon := 'new.png'
:NotifyToolTip := 'Hi All!'
:OnNotifyClick := { || msgOther(oWindow) }
With Object oNotify := NotifyMenu():New(oWindow)
oItemHide := MenuItem():New( 'Hide Main Window' , { || oWindow:Hide() } ) ; :AddItem(oItemHide)
:AddSeparator()
oItemShow := MenuItem():New( 'Show Main Window' , { || oWindow:Show() } ) ; :AddItem(oItemShow)
End With
End With
oWindow:Activate()
Return Nil
static function msgOther(oWindow)
local oMB := QMessageBox()
oMB:setText( 'Notify Icon Clicked!' )
oMB:exec()
if ! oWindow:Visible
oWindow:show()
oWindow:hide()
endif
RETURN nil
[[]] Mauricio Ventura Faria
Re: Notify bug ?
I found...
It´s the QuitOnLastWindowClosed property.
It´s the QuitOnLastWindowClosed property.
Code: Select all
if ! oWindow:Visible
oWindow:s_qApp:setQuitOnLastWindowClosed(.F.)
endif
oMB:exec()
if ! oWindow:Visible
oWindow:s_qApp:setQuitOnLastWindowClosed(.T.)
endif
[[]] Mauricio Ventura Faria
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Notify bug ?
That's great!
Let us incorporate in the code.
Let us incorporate in the code.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Notify bug ?
I tried to change msgbox.prg but found no way to reference the main window.
And it's possible that msgbox.prg isn´t the only affected program...
And it's possible that msgbox.prg isn´t the only affected program...
[[]] Mauricio Ventura Faria
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Notify bug ?
IMHO, it shall be put at hide()/show() method of window.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.