Results 1 to 5 of 5

Thread: hot to disable right click on form input controls

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Location
    Pune,India
    Posts
    63
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default hot to disable right click on form input controls

    I want to right click menu from line edit and date time edit Control. How I can do this.

    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: hot to disable right click on form input controls

    But do you want to disable such menu or create one?

  3. #3
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: hot to disable right click on form input controls

    Quote Originally Posted by safknw
    I want to right click menu from line edit and date time edit Control. How I can do this.

    Thanks in advance.
    Try with

    Qt Code:
    1. object->setContextMenuPolicy ( Qt::NoContextMenu);
    To copy to clipboard, switch view to plain text mode 
    A camel can go 14 days without drink,
    I can't!!!

  4. #4
    Join Date
    May 2006
    Location
    Pune,India
    Posts
    63
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Re: hot to disable right click on form input controls

    Quote Originally Posted by mcosta
    Try with

    Qt Code:
    1. object->setContextMenuPolicy ( Qt::NoContextMenu);
    To copy to clipboard, switch view to plain text mode 
    This is not working on Qt3.3.4 (suse 9.2)
    Any other way to disable Context Menu.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: hot to disable right click on form input controls

    Quote Originally Posted by safknw
    This is not working on Qt3.3.4 (suse 9.2)
    Next time, please, add information about the version in the first post, so you won't waste others time.

    Quote Originally Posted by safknw
    Any other way to disable Context Menu.
    You can try to install an event filter that consumes QContextMenuEvents.

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.