Skip to main content

QCustomMenu

QCustomMenu

A modern popup action menu.

A frameless, rounded, elevated popup for the "..." / more buttons: a column of icon + label action rows with hover states, optional separators and a right-aligned hint. Open it anchored under a button with popupAt(button). Emits triggered(key) when an item is picked. Theme it from code with applyColors(...) so it flips with the app theme (it is a top-level popup, so the app stylesheet does not cascade in automatically).

At a glance​

TierFree (GPLv3)
Importfrom Custom_Widgets.QCustomMenu import QCustomMenu
Qt DesignerYes — drag it from the palette

Quick start​

from Custom_Widgets.QCustomMenu import QCustomMenu

widget = QCustomMenu()

Dark theme​

Colours come from the design tokens, so the widget follows the app theme with no extra work.

QCustomMenu in dark theme

Properties​

Every property below is settable in code and in Qt Designer.

PropertyTypeDefault
itemHeightint38
cornerRadiusint14
minWidthint200

Signals​

Signal
triggered(QString)

Methods​

MethodDescription
addAction(text, key=None, icon=None, hint='', danger=False)Add an action row. icon may be a QIcon or QPixmap. Returns the key.
addSeparator()Add a separator.
applyColors(bg=None, text=None, muted=None, hover=None, border=None, accent=None, danger=None)Apply the colors.
clear()Clear.
cornerRadius(*args, **kwargs)Corner radius.
itemHeight(*args, **kwargs)Item height.
minWidth(*args, **kwargs)Min width.
popupAt(anchor, align='right', gap=4)Show the menu just below anchor, right- or left-aligned to it.
popupAtPos(global_pos)Popup at pos.
triggered(...)Triggered.

QCustomBreadcrumbs · QCustomCommandPalette · QCustomDrawer · QCustomHamburgerMenu · QCustomHeaderNav · QCustomPagination · QCustomSidebar · QCustomSidebarButton