QsMenuAnchor: QtObject

import Quickshell

Display anchor for platform menus.

Properties

Functions

Signals

Property Details

[readonly]

anchor: PopupAnchor

The menu’s anchor / positioner relative to another window. The menu will not be shown until it has a valid anchor.

ℹ️

The following is subject to change and NOT a guarantee of future behavior.

A snapshot of the anchor at the time [signal] opened() is emitted will be used to position the menu. Additional changes to the anchor after this point will not affect the placement of the menu.

You can set properties of the anchor like so:

QsMenuAnchor {
  anchor.window: parentwindow
  // or
  anchor {
    window: parentwindow
  }
}

menu: QsMenuHandle

The menu that should be displayed on this anchor.

See also: SystemTrayItem.menu.

[readonly]

visible: bool

If the menu is currently open and visible.

See also: open(), close().

Function Details

void close()

Close the open menu.

void open()

Open the given menu on this menu Requires that anchor is valid.

Signal Details

closed()

Sent when the menu is closed.

opened()

Sent when the menu is displayed onscreen which may be after visible becomes true.