setools/setoolsgui/widget.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

35 lines
676 B
Python

# Copyright 2015, Tresys Technology, LLC
#
# SPDX-License-Identifier: LGPL-2.1-only
#
#
import sys
from errno import ENOENT
import pkg_resources
from PyQt5.uic import loadUi
# Stylesheet that adds a frame around QGroupBoxes
stylesheet = "\
QGroupBox {\
border: 1px solid lightgrey;\
margin-top: 0.5em;\
}\
\
QGroupBox::title {\
subcontrol-origin: margin;\
left: 10px;\
padding: 0 3px 0 3px;\
}\
"
class SEToolsWidget:
def load_ui(self, filename):
distro = pkg_resources.get_distribution("setools")
path = "{0}/setoolsgui/{1}".format(distro.location, filename)
loadUi(path, self)
self.setStyleSheet(stylesheet)