[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: PopupMenu pops up repeatedly
From: Dracula007 <dracula007 () atlas ! cz>
Date: 2004-10-26 16:50:13
Message-ID: 897427049.20041026185013 () karneval ! cz
[Download RAW message or body]
Hello,
I've a KListView with items in it, and I'd like to show Popup Menu
for them. I simply connect the slot "showMenu" to the "contextMenu"
signal
// connectiong the signal to the main window's slot
KListView * leftPanel = new KListView(mainWin);
connect(leftPanel,
SIGNAL(contextMenu (KListView *, QListViewItem *, const QPoint &)),
this,
SLOT(showMenu (KListView *, QListViewItem *, const QPoint &)));
// slot
void MainWindow::showMenu (KListView *l, QListViewItem *i, const QPoint &p) {
KPopupMenu * contextmenu = new KPopupMenu(this);
contextmenu->popup(p);
contextmenu->insertItem( "&Delete row",0,0 );
contextmenu->exec();
}
and it works - the menu pops up. The problem is the menu is still
there no matter how I click - it simply won't hide. What should I
do to hide the popup menu?
I'm new to KDE/Qt development so I probably did a really stupid fault.
T.V.
>> 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