Results 1 to 6 of 6

Thread: Modify a ContextMenu

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

    Exclamation Modify a ContextMenu

    Guys,
    this one i'm not sure if it is easy...

    See please the attachmment.

    Somebody say to me that the menu I show is the contextMenu. By some reason if I set setWindowFlags(Qt::FramelessWindowHint) like this, the contextMenu is being disable on my application.

    if somebody can let me see code or explain a little bit better HOW I DO THAT OVERRIDE of the contextMenu or if I'm wrong and that menu is not the contextMenu

    thanks so much and hoping somebody show me a little bit of light
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Modify a ContextMenu

    Why do you want to set a frameless window hint? The context menu is frameless out of the box. Try executing this snippet:
    Qt Code:
    1. QMenu menu;
    2. menu.addAction("xyz");
    3. menu.addAction("abc");
    4. menu.exec(QCursor::pos());
    To copy to clipboard, switch view to plain text mode 

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

    Default Re: Modify a ContextMenu

    Quote Originally Posted by wysota View Post
    Why do you want to set a frameless window hint?
    is because im trying to bring up a dialog but my application when I bring it on, the dialog show me the frame and because of how the app looks like, is not elegant to see the frame up and disappear.... so... i just more for UI looks a little bit nice

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Modify a ContextMenu

    What does the context menu have to do with it?

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

    Default Re: Modify a ContextMenu

    I forgot to tell you somethiing

    when you set the setWindowFlag to be frameless that context menu dont shows up when you right click on the app on the taskbar

    its suppose to be very simple: restore, maximized, minimized and close

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Modify a ContextMenu

    That's because your window manager ignores frameless windows - it doesn't manage them. Try finding a solution to your problem that doesn't involve frameless windows. Or live with an unmanaged window.

  7. The following user says thank you to wysota for this useful post:

    smarinr (10th May 2008)

Similar Threads

  1. contextmenu in QDockWidget title
    By klipko in forum Newbie
    Replies: 4
    Last Post: 7th March 2008, 22:32
  2. I have a problem to modify table
    By Abk in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 20:11
  3. contextmenu with MDI
    By Thoosle in forum Qt Programming
    Replies: 1
    Last Post: 1st December 2006, 07:29
  4. Modify model data in QTreeView
    By YuriyRusinov in forum Qt Programming
    Replies: 6
    Last Post: 26th October 2006, 17:28
  5. ContextMenu
    By Naveen in forum Qt Programming
    Replies: 9
    Last Post: 21st February 2006, 10:54

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.