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

List:       kde-devel
Subject:    Re: Context menus (an idea for summer of code?)
From:       Kevin Krammer <kevin.krammer () gmx ! at>
Date:       2005-06-14 15:08:05
Message-ID: 200506141708.12059.kevin.krammer () gmx ! at
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Monday 13 June 2005 21:39, Thomas Friedrichsmeier wrote:

> Next let's see, what you need to do (as a programmer) to provide a context
> menu. In the easiest case you're implementing a single widget, and every
> time the user right-clicks in that widgest it's roughly appropriate to
> always dispaly the same popup-menu. So, what you do, is to create a
> popup-menu, populate it with menu-items, and show it whenever the user
> performs an RMB-click.

Actually when the widget receives a ContextMenuEvent, i.e. the void 
contextMenuEvent(QContextMenuEvent*) method gets invoked, or overloaded forms 
which provide better context data like the one from QListView

> So, we'd have a class KontextMenu, which is derived from KPopupMenu. There
> will be an API for this class to tell it: "Ok, there is a context called
> 'image'. This context is associated with the following options: A, B, C.
> Next there is a context called 'link' with options C, D, E...". Then, when

I think it would be better to associate it with a menu defined in the XMLGUI 
file.
AFAIK it is already supported to create popupmenus this way, but only a few 
applications actually use it.
Maybe this could be made easier with a special context menu class.

> appropriate context menu", and moreover providing a GUI to configure
> options. If we had a generic KontextMenu, however, all this would be a
> feasible one-time effort. The programmer would merely call
> KontextMenu::createConfigurationWidget () or whatever.

Having a configuration dialog for XMLGUI defined menus would indeed be neat.

Cheers,
Kevin
-- 
Kevin Krammer <kevin.krammer@gmx.at>
Qt/KDE Developer, Debian User
Moderator: www.mrunix.de (German), www.qtforum.org

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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