Results 1 to 2 of 2

Thread: Context menu on tab header

  1. #1
    Join Date
    Dec 2016
    Posts
    15
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Context menu on tab header

    I currently have a tabwidget for which I connected its customContextMenuRequested signal to a slot that shows a context menu.

    The context menu shows up, but it shows up through the entire area of the tab.

    How do I make it so that the right click opens only when I click on the tab title bar?

    example.jpg

    Sorry for the rough diagram. Currently, my context menu is triggered in the green and blue regions. How do I isolate it to the green region alone?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Context menu on tab header

    Maybe connect to the QTabBar's signal instead?

    Cheers,
    _

Similar Threads

  1. Qt Context menu
    By jeyanthinatarajan in forum Newbie
    Replies: 3
    Last Post: 4th April 2012, 22:26
  2. Replies: 2
    Last Post: 21st February 2012, 10:21
  3. Replies: 1
    Last Post: 4th November 2011, 11:25
  4. Context menu
    By dejvis in forum Newbie
    Replies: 2
    Last Post: 20th September 2009, 22:02
  5. Qwt and context menu
    By giusepped in forum Qwt
    Replies: 1
    Last Post: 9th December 2008, 08:55

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.