View Issue Details

IDProjectCategoryView StatusLast Update
0014129LazarusLCLpublic2009-09-30 17:33
ReporterMassimo Magnano Assigned ToZeljan Rikalo  
Status closedResolutionfixed 
Target Version0.9.30Fixed in Version0.9.29 (SVN) 
Summary0014129: TTrayIcon on Qt Implementation
Description1) In create sequence, the Show method is called but the Popupmenu is always nil even if assigned in the Inspector. If i call Show() manually the Popupupmenu is <>nil.

2) Mouse events never arrive, dblclick, click etc...
TagsNo tags attached.
Fixed in Revision20828
Attached Files


Zeljan Rikalo

2009-07-10 20:04

developer   ~0029031

please attach compileable example of problem.

Zeljan Rikalo

2009-07-11 11:01

developer   ~0029042

Ok ... mouse events aren't propagated, but other things works (tried trayicon from examples)

Zeljan Rikalo

2009-07-11 12:04

developer   ~0029047

According to examples/trayicon it works ok.
OnMouseMove() does not work since qt does not provide such signal over QSystemTrayIcon.

Test and close if ok.

Massimo Magnano

2009-09-27 19:45

reporter   ~0031009

Try the project cactusjukebox (i'm a developer) if you set TrayIcon.Visible =true the tray icon did not appeare because the popupmenu attached to it is nil (The popupmenu is created after the TrayIcon) So the work around is set TrayIcon.visible=False (in the Inspector) and then call trayIcon.Show on TForm.Show.
The Solution to this problem may be move the qt creation code in the TTrayIcon.onLoaded event.

try it , you can find the sources here :

svn checkout

Zeljan Rikalo

2009-09-28 10:49

developer   ~0031014

Please attach simple example which shows your problem.
I don't have time to fight with your sources and missing units etc etc.

Massimo Magnano

2009-09-28 21:15

reporter   ~0031025

i have tested in a simple form and the tray icon works....
only the Click, DblClick etc... don't work.

Sorry, i don't understand why but the problem is in the sources of this specific project.

p.s. Do You have a work around for the click events of trayIcon?

Massimo Magnano

2009-09-28 22:01

reporter   ~0031026

OK, i have finded is a problem of the component, not of my project

the problem is this :
If you don't set the Hint Property The popoupMenu never appear because the InternalUpdate is never called. Try but yourself in the attached sources if you comment\decomment the Line 131 of mainform.

2009-09-28 22:01


trayicon.tar.gz (82,711 bytes)

Zeljan Rikalo

2009-09-29 10:01

developer   ~0031029

I cannot load your test project....Lazarus says "Unable to read project info file wndtray.lpi" but it looks like a magnifier from Felipe , which works ok here.

1.I've downloaded your sources and then it screams about missing httpsend, some lnet units etc ...

2.OnClick(), OnDblClick() works fine here , I don't know why it doesn't work for you.

3. Seem that problem is related to TTrayIcon lcl implementation not widgetset.
When you change icon it calls InternalUpdate
When you change hint it calls InternalUpdate
but PopupMenu is assigned only when creating handle, and setPopupMenu never calls internalupdate.Does it work with gtk2 as expected ?

Zeljan Rikalo

2009-09-29 10:08

developer   ~0031030

Just tested your demo and:
1.OnClick() works
2.OnDblClick() works (but have to comment MessageBox in OnClick() because OnClick() is executed too.
3.PopupMenu OnCLick() works.

So write me:
1.What operating system is used for your tests ?
2.What is the lazarus svn revision.
3.Version of qt libs installed on your system.

Massimo Magnano

2009-09-29 19:50

reporter   ~0031038

Operating system Suse 11.1
lazarus svn 19934, fpc 2.2.4 (x64)
qt 4.3

Zeljan Rikalo

2009-09-29 21:03

developer   ~0031039

Please upgrade qt to 4.5, qt-4.3 have nasty bugs with QSystemTrayIcon (AFAIK Suse 11.XX should have qt-4.5.XX packages for update).

Massimo Magnano

2009-09-30 17:26

reporter   ~0031048

updated qt to 4.4.3 solved the click and other mouse issues. The perfect solution is to call InternalUpdate in the Component onLoaded Event. Work around at this moment is set Hint in the Form.Create, so the popupmenu (that is created) is assigned to the TrayIcon.

Zeljan Rikalo

2009-09-30 17:32

developer   ~0031049

4.4.3 ? Why not to 4.5.2 ? 4.4.3 isn't supported anymore by lclqt.

Zeljan Rikalo

2009-09-30 17:33

developer   ~0031050

reporter have old qt libs.

Issue History

Date Modified Username Field Change
2009-07-10 18:43 Massimo Magnano New Issue
2009-07-10 18:43 Massimo Magnano Widgetset => QT
2009-07-10 20:04 Zeljan Rikalo LazTarget => -
2009-07-10 20:04 Zeljan Rikalo Note Added: 0029031
2009-07-10 20:04 Zeljan Rikalo Status new => feedback
2009-07-11 11:01 Zeljan Rikalo LazTarget - => 0.9.30
2009-07-11 11:01 Zeljan Rikalo Note Added: 0029042
2009-07-11 11:01 Zeljan Rikalo Assigned To => Zeljan Rikalo
2009-07-11 11:01 Zeljan Rikalo Status feedback => assigned
2009-07-11 11:01 Zeljan Rikalo Target Version => 0.9.27 (SVN)
2009-07-11 12:04 Zeljan Rikalo Fixed in Revision => 20828
2009-07-11 12:04 Zeljan Rikalo LazTarget 0.9.30 => 0.9.28
2009-07-11 12:04 Zeljan Rikalo Status assigned => resolved
2009-07-11 12:04 Zeljan Rikalo Resolution open => fixed
2009-07-11 12:04 Zeljan Rikalo Note Added: 0029047
2009-09-27 19:45 Massimo Magnano Status resolved => assigned
2009-09-27 19:45 Massimo Magnano Resolution fixed => reopened
2009-09-27 19:45 Massimo Magnano Note Added: 0031009
2009-09-27 20:57 Zeljan Rikalo LazTarget 0.9.28 => 0.9.30
2009-09-27 21:26 Vincent Snijders Target Version 0.9.27 (SVN) => 0.9.30
2009-09-28 10:49 Zeljan Rikalo Note Added: 0031014
2009-09-28 10:49 Zeljan Rikalo Status assigned => feedback
2009-09-28 21:15 Massimo Magnano Note Added: 0031025
2009-09-28 22:01 Massimo Magnano Note Added: 0031026
2009-09-28 22:01 Massimo Magnano File Added: trayicon.tar.gz
2009-09-29 10:01 Zeljan Rikalo Note Added: 0031029
2009-09-29 10:08 Zeljan Rikalo Note Added: 0031030
2009-09-29 19:50 Massimo Magnano Note Added: 0031038
2009-09-29 21:03 Zeljan Rikalo Status feedback => resolved
2009-09-29 21:03 Zeljan Rikalo Resolution reopened => fixed
2009-09-29 21:03 Zeljan Rikalo Note Added: 0031039
2009-09-30 17:26 Massimo Magnano Note Added: 0031048
2009-09-30 17:32 Zeljan Rikalo Note Added: 0031049
2009-09-30 17:33 Zeljan Rikalo Status resolved => closed
2009-09-30 17:33 Zeljan Rikalo Note Added: 0031050
2009-09-30 17:33 Zeljan Rikalo Fixed in Version => 0.9.29 (SVN)