[Qt-interest] Problem with QSystemTrayIcon on left click

Aaron Lewis the.warl0ck.1989 at gmail.com
Tue Nov 30 01:31:59 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/30/2010 08:21 AM, Scott Aron Bloom wrote:
> Hard to tell without a more complete code sample...
> 
> Sounds like you might have a positional issue.

Check out my project: HackTray

http://kde-apps.org/content/show.php/HackTray?content=135572

> 
> Scott
> 
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Aaron Lewis
> Sent: Monday, November 29, 2010 4:18 PM
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] Problem with QSystemTrayIcon on left click
> 
> On 11/30/2010 02:25 AM, Scott Aron Bloom wrote:
>> What happens if you simply set the menu using setContextMenu
> 
>> Part of the problem in using you method, is your menu will have a
>> completely separate focus environment..
> 
> Hmm .. it's really wired , code is just like what you described.
> 
> i have a private function called setupSysTray()
> 
> // trayMenu is a private instance of QMenu
> 
> trayIMenu.addAction ( ui->actionQuit_Q ) // Would that be a problem ?
> trayMenu.addSeparator ();
> ...
> 
> trayIcon.setContextMenu(&this->trayMenu);
> trayIcon.setIcon ( ... );
> trayIcon.show();
> 
> And besides , even if i call trayMenu.show() ,
> trayIcon.contextMenu->showNormal() or trayMenu.showNormal() , non among
> them works.
> 
> They will firstly appear on my left corner , and after a right click ,
> it appears at right place.
> 
> ( Should be problem with Qt ? Likely position was set to (0,0) by
> default , and further calculation on it changes its position )
> 
> Is referencing a QAction from ui directly a problem here ?
> 
> 
>> And sicne you can probably click on the icon twice raising the menu
>> twice etc etc.
> 
>> Scott
>> -----Original Message-----
>> From: qt-interest-bounces at trolltech.com
>> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Aaron Lewis
>> Sent: Sunday, November 28, 2010 8:30 PM
>> To: qt-interest at trolltech.com
>> Subject: Re: [Qt-interest] Problem with QSystemTrayIcon on left click
> 
>> On 11/29/2010 02:58 AM, Scott Aron Bloom wrote:
>>> I have used QSTI many times, and never saw this type of behavior.
> 
>> Gentoo Linux , Qt 4.7.1
> 
>> Codes:
> 
>> A slot dedicated for handling those events:
> 
>> private slots:
>> void showOrHide(QSystemTrayIcon::ActivationReason reason) {
>>     trayIcon.contextMenu()->showNormal();
>>     return;
>> }
> 
>> And in construct function:
> 
>> /// TrayIcon is an instance of QSystemTrayIcon
> 
> 
> connect(&trayIcon,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
>>             this,SLOT(showOrHide(QSystemTrayIcon::ActivationReason)));
> 
>> This bug also exists in KTTSD , but i'm no longer using that.
> 
> 
>>> What platform?
>>> Can you post code that reproduces it.
> 
>>> Scott
> 
>>> -----Original Message-----
>>> From: qt-interest-bounces at trolltech.com
>>> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Aaron Lewis
>>> Sent: Sunday, November 28, 2010 3:47 AM
>>> To: QT Interest List
>>> Subject: [Qt-interest] Problem with QSystemTrayIcon on left click
> 
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
> 
>>> Hi,
>>> 	If did a left click on QSystemTrayIcon , context menu will just
>>> popup
>>> at a wrong position ( normally left-top corner ) , but after a right
>>> click , further left click on it won't cause troubles , it just show
>> up
>>> the right position.
> 
>>> 	How could i get this problem solved , anyone got some ideas ?
> 
>>> 	Many thanks !
> 
>>> - -- 
>>> Best Regards,
>>> Aaron Lewis - PGP: 0xDFE6C29E ( http://keyserver.veridis.com )
>>> Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E
> 
>>> _______________________________________________
>>> Qt-interest mailing list
>>> Qt-interest at trolltech.com
>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> 
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


- -- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E ( http://keyserver.veridis.com )
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJM9EX/AAoJECSSp9Df5sKePz4QAIyzfxRZHeUHfBbFp67XQfJh
2SK+/FE4OkkZn1bnKcRuCgYogqiXpppEfrb8ox881wheAGEbf/Jry8UfzKHSp4WO
Tcgq1Vk+BHrpvCBmNoED+VmiapdzTdEDY7apIEegdvKJAdqAaYZ25SMrJYhDfIuO
CACnSW19l4u+rIbgQzUkqH5u7Sqv5X5YMcdTllyR4yerVcY/UYLOZ/aBPSC6vXmI
8Ju2IzYLEbmgOY03KFm53z3chOhjl9B4UqikfH6Kovzd5YSMui3xTM90Se4//nU6
M4Aw7Nnex0hF0w7436erhVVwnEnKSgqp+0LIThdSkkff9CgXpnasY3XE/VGU1LvT
lx8RIFbHrENirHlbs19P6kkJKfYCqAW7l/PvKMu56dlejAAaeDMa29X3QBh5T1Qx
Tn7kbySI9yvXTt/cSCob76/oCjeFfYSzNVfhAUulsNWoBEcI+e2kK59CAOlcQcPX
0piV3Akh4DOER66Z+bQ+5FymY42Xs4q3srolxL3pfzyFK7idj0t47yfQjRbJkwiQ
zumSA9RqWTQpdR7tvli9kpHYY9WTF7og1fK9f9QVDWl1s2JPcVfG4E2Rwp0cMRDt
iDh0VB91WaHF7Ptv8MiZxC50qyqzOemySqPZTpf/xMRImoMLaTD1JsZehHJcBol1
G7WPXh45IZM8C05QkksK
=W0f9
-----END PGP SIGNATURE-----



More information about the Qt-interest-old mailing list