Results 1 to 4 of 4

Thread: Right-click popup from a QListbox

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2007
    Posts
    21
    Thanks
    25
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Right-click popup from a QListbox

    Hi can anyone help me with the best way to generate a popup window inside a Qlistbox when an operator right clicks within the Qlistbox area. (using Qt3)

    i have implemented by Qlistbox in the designer, and when using the code

    void bla::contextMenuEvent(QContextMenuEvent *event)
    {
    QPopuMenu contextMenu(this)
    contextMenu.exec(event->globalPos());
    }

    in my subclass i can get the popup menu to appear anywhere in the mainwindow i just cannot get it to only come up within the qlistbox object.

    i have replaced the 'this' pointer with the name of my qlistbox object name but still it brings up the popup menu any where on my main dialog.

    any help will be very appreciated, thanks in advance,

    nlev.
    Last edited by nleverin; 1st November 2007 at 06:31.

Similar Threads

  1. Double Click Capturing
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2011, 14:12
  2. QGraphicsScene Click / Double Click
    By philentropist in forum Qt Programming
    Replies: 1
    Last Post: 9th February 2007, 04:32
  3. Can't close my popup
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 11th July 2006, 09:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.