Skip to content

Commit 7e2146d

Browse files
committed
Prevent empty context menus from appearing on Property table view
1 parent 06e6d0d commit 7e2146d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/windows/views/properties_tableview.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,8 @@ def contextMenuEvent(self, event):
779779
self.menu = self.build_menu(self.choices, menu)
780780

781781
# Show context menu (if any options present)
782-
if self.menu.children():
782+
# There is always at least 1 QAction in an empty menu though
783+
if len(self.menu.children()) > 1:
783784
self.menu.popup(event.globalPos())
784785

785786
def build_menu(self, data, parent_menu=None):

0 commit comments

Comments
 (0)