"contextMenuPolicy"

Defines how the respective widgets shows the context menu.

Synopsis

shape.contextMenuPolicy(string menu);

Parameters

Parameter Description
shape Name of the object
menu
  • NoContextMenu - no context menu is available, context menu handling is deferred to the widget's parent.

  • PreventContextMenu - no context menu is available and the context menu handling is not deferred to the widget's parent. Therefore, all right mouse button events are delivered to the widgets itself.

  • DefaultContextMenu - the widget's standard context menu is displayed

Description

Defines how the respective widgets shows the context menu.

Example

This example disables the context menu for the TEXT_EDIT1 widget.

main(bool enter)
{
  TEXT_EDIT1.contextMenuPolicy("NoContextMenu");
}

Assignment

TextEdit, Thumb Wheel, Progress Bar, Slider, ...