setools/setoolsgui/getdetailslist.py
Chris PeBenito 8e082f70cf Replace license text in sources with SPDX license indentifiers.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2021-11-20 14:12:15 -05:00

24 lines
623 B
Python

# Copyright 2016, Tresys Technology, LLC
#
# SPDX-License-Identifier: LGPL-2.1-only
#
#
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import QAction, QListView, QMenu
class GetDetailsListView(QListView):
"""A QListView widget with more details context menu."""
def __init__(self, parent):
super(GetDetailsListView, self).__init__(parent)
# set up right-click context menu
self.get_detail = QAction("More details...", self)
self.menu = QMenu(self)
self.menu.addAction(self.get_detail)
def contextMenuEvent(self, event):
self.menu.popup(QCursor.pos())