mirror of
https://github.com/SELinuxProject/setools
synced 2025-03-22 11:06:30 +00:00
24 lines
623 B
Python
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())
|