[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt]  PyQt5 system tray icon context menu strange behavior
From:       <flll () seznam ! cz>
Date:       2017-06-30 11:00:06
Message-ID: 7T3.19eLd.6CuumurJIvQ.1PLYys () seznam ! cz
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello all,

I have noticed that system tray icon's (QSystemTrayIcon) context menu
(QMenu) is behaving strangely.

1) When tray icon's context menu is closed, it does not emit signal
aboutToHide(), even though it should (https://doc.qt.io/qt-5/qmenu.html#
aboutToHide).

2) The context menu does not react to move(). It sticks to tray icon at the
same place as it appeared. That is a problem if menu has been updated and 
the new content is bigger. The menu adjusts its size properly, but does not
change its position (is fixed to its original left border), so a part of the
updated larger menu is displayed "out of the screen" and is not visible.

3) When tray icon is clicked and menu displayed, calling tray_icon.
contextMenu().isHidden() returns True (hidden), even though it is definitely
visible. While tray icon's menu is displayed, calling menu.show() displayes
another copy of the same menu somewhere on the screen (on its default or 
predefined position). When the copy is displayed, the menu correctly states
"isHidden() == False" and the copy can be moved by "move()".

It looks like the tray icon's context menu is in some strange relation with
the tray icon. It looks really confusing to me. Plus it makes nearly
impossible to use the menu for something more than just a few static options
(can not clear old content when menu is hidden, updated menu is not
visible...). Is this intended behaviour?

Best regards, Filip Happy
[Attachment #5 (text/html)]

<html><body>Hello all,<br><br>I have noticed that system tray icon's \
(QSystemTrayIcon) context menu (QMenu) is behaving strangely. <br><br>1) When tray \
icon's context menu is closed, it does not emit signal <i>aboutToHide(), </i>even \
though it should (https://doc.qt.io/qt-5/qmenu.html#aboutToHide).<br><br>2) The \
context menu does not react to <i>move()</i>. It sticks to tray icon at the same \
place as it appeared. That is a problem if menu has been updated and the new content \
is bigger. The menu adjusts its size properly, but does not change its position (is \
fixed to its original left border), so a part of the updated larger menu is displayed \
"out of the screen" and is not visible.<br><br>3) When tray icon is clicked and menu \
displayed, calling <i>tray_icon.contextMenu().isHidden()</i> returns <i>True \
</i>(hidden), even though it is definitely visible. While tray icon's menu is \
displayed, calling <i>menu.show()</i> displayes another copy of the same menu \
somewhere on the screen (on its default or predefined position). When the copy is \
displayed, the menu correctly states "isHidden() == False" and the copy can be moved \
by "move()".<br><br>It looks like the tray icon's context menu is in some strange \
relation with the tray icon. It looks really confusing to me. Plus it makes nearly \
impossible to use the menu for something more than just a few static options (can not \
clear old content when menu is hidden, updated menu is not visible...). Is this \
intended behaviour?<br><br>Best regards, Filip Happy<br></body></html>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic