Results 1 to 2 of 2

Thread: overriding the QWidget::contextMenuEvent

  1. #1
    Join Date
    Apr 2008
    Posts
    37
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default overriding the QWidget::contextMenuEvent

    I need a little bit of help

    I need to override the contextMenuEvent but I dont know where to start.
    the reason is because I need to set the actions of the context menu in a way that when I setWindowFlags to FramelessWindowHint dont show up.

    If somebody knows any way to bring up the context menu with the flags up, please let me know

    by the way: im a newbie at QT (thats why I need this dummy help hahaha)

    P.D. Im using Qt 4.4
    Last edited by smarinr; 9th May 2008 at 17:55.

  2. #2
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: overriding the QWidget::contextMenuEvent

    Make a new class with QWidget as a parent, then write your own "void contextMenuEvent ( QContextMenuEvent * event )" for that new class. The contextMenuEvent is a virtual function. So use the traditional C++ OOP technics.

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

    smarinr (9th May 2008)

Similar Threads

  1. Replies: 12
    Last Post: 21st November 2008, 04:42
  2. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  3. how to corss compile for windows in Linux
    By safknw in forum Qt Programming
    Replies: 24
    Last Post: 13th May 2006, 05:23
  4. overriding the minimise,maximise buttons
    By amulya in forum Qt Programming
    Replies: 6
    Last Post: 24th March 2006, 09:25

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.