473,326 Members | 2,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

[PyQt] How to get the QRect of a QMenuBar (QPopupMenu) item ?

Hi all,

I try to introduce tooltips in my application written
in PyQt (more precisly, in the menubar of my application)
but I can't find a way to get the QRect instance
associated to a QMenuBar item (neither a QPopupMenu item)

I need the QRect 'cause I followed the tooltip.py file
given with pyqt to do the job with a re-implementation
of "maybeTip( self, pos )".

May be it is not the good solution ...

Help is welcome !

Cheers,

E.A.
Jul 18 '05 #1
2 2594
Erwan Adam wrote:
Hi all,

I try to introduce tooltips in my application written
in PyQt (more precisly, in the menubar of my application)
but I can't find a way to get the QRect instance
associated to a QMenuBar item (neither a QPopupMenu item)


QObect Class?

QObject::queryList()
QObject::child()

Also try the PyQt list "pykde"
Jul 18 '05 #2
Erwan Adam <er********@cea.fr> wrote in message news:<cn**********@ellebore.saclay.cea.fr>...
I try to introduce tooltips in my application written
in PyQt (more precisly, in the menubar of my application)
but I can't find a way to get the QRect instance
associated to a QMenuBar item (neither a QPopupMenu item)
You need to call the itemGeometry method on your QPopupMenu
object with the index of the menu item you want to examine.

Something like this should work for popup menus:

# popup is a QPopupMenu containing several items
rect = popup.itemGeometry(2) # for the third item in the menu

It may be a little more difficult to get this information out
of QMenuBar because it looks like PyQt can't access the
itemRect function when the menu bar is created by a C++
object, such as a QMainWindow.
I need the QRect 'cause I followed the tooltip.py file
given with pyqt to do the job with a re-implementation
of "maybeTip( self, pos )".


Are you trying to implement tooltips on menu items?

You may find that regulars on the PyQt/PyKDE mailing list can give
you more detailed advice:

http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Good luck!

David
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
by: Vamsi Mudrageda | last post by:
I am kind of new to Python, and after trying and using wxPython, I found it kind of lacking in easy-to-read documentation, speed at loading, and GUI response-time. So I am looking for an another...
8
by: simo | last post by:
OK, so I'm at the stage where I want to make a choice between wxPython and PyQt. Currently I'm using wxPython mainly due to the fact that it has GPL Linux and Windows versions. I prefer Qt to...
10
by: Peter | last post by:
I want to draw some lines on a widget. This works ok, but when I want to redraw, the old lines are still there. How do I clear or refresh the widget, so I can draw a new set of lines? Code...
10
by: svenn.are | last post by:
Hi, I wanted to run a program that is written in PyQt on my mac, and went over to Riverbank to get PyQ 3.13 and SIP 4.1.1 sources. I followed the installation guide except for the compiling...
10
by: Simon John | last post by:
After quite a while of wxPython I'm getting back into PyQt, mainly due to the announcement by Trolltech that they will make a GPL version of Qt4 for Windows (and Phil-T said he will make a PyQt to...
9
by: me | last post by:
Hi, I trying to add a menu bar to my main widget. The reslut is, that the menus (like file menu) apear and work ok, but the menubar it self is not being refreshed at all. I looked at all the...
10
by: Volker Lenhardt | last post by:
For a QApplication (PyQt) on the small screen of my Zaurus 5500 PDA I try to layout my data output in a QScrollView as the central widget. I'd prefer to use QGridLayout, but cannot add it to the...
5
by: kobayashi | last post by:
Dear all, For a particuliar case, I need to copy all the items of an existing menu (including the separators and sub-menus) in a new empty one ... Does someone knows how to do that ? I've tried...
0
by: Moezzie | last post by:
So ive got a bit of a problem here. Ive been searching the net about this for quite some time now but i just cant seem to figure out how to open a dialog that ive made in QtDesigner. Of corse i...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.