Results 1 to 2 of 2

Thread: QScrollBar context menu

  1. #1
    Join Date
    Jan 2007
    Posts
    26
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QScrollBar context menu

    Is it possible to get the pointer to the context menu for a QScrollBar object so that the menu can be added to?

    If I try overriding contextMenuEvent in a subclass, I can add my item to a new menu, but I was hoping to preserve the old one if possible, and just add to it.

    Thanks,
    Chas
    Last edited by ChasW; 29th January 2007 at 06:44.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QScrollBar context menu

    Unfortunately it's not. The context menu seems to have been hard coded into QScrollBar::contextMenuEvent() and there's no way to access the local QMenu object.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    ChasW (29th January 2007)

Similar Threads

  1. Context Menu on QTableWidget
    By ankurjain in forum Qt Programming
    Replies: 9
    Last Post: 17th December 2009, 09:52
  2. menu on right click on canvas
    By quickNitin in forum Newbie
    Replies: 4
    Last Post: 8th October 2006, 12:09
  3. context menu advice
    By larry104 in forum Qt Programming
    Replies: 1
    Last Post: 4th October 2006, 07:55
  4. Q3TextEdit custom context menu
    By bcteh_98 in forum Qt Programming
    Replies: 1
    Last Post: 15th February 2006, 21:00
  5. Tracking separators in a menu (insertSeparator)
    By PrimeCP in forum Qt Programming
    Replies: 4
    Last Post: 25th January 2006, 18: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.