<filename>builder/widgets/py_line_edit/py_line_edit.py

from qt_core import *

# STYLE
# ///////////////////////////////////////////////////////////////
style = '''
QLineEdit {{
	background-color: {_bg_color};
	border-radius: {_radius}px;
	border: {_border_size}px solid transparent;
	padding-left: 10px;
    padding-right: 10px;
	selection-color: {_selection_color};
	selection-background-color: {_context_color};
    color: {_color};
}}
QLineEdit:focus {{
	border: {_border_size}px solid {_context_color};
    background-color: {_bg_color_active};
}}
'''

# PY PUSH BUTTON
# ///////////////////////////////////////////////////////////////
class PyLineEdit(QLineEdit):
    def __init__(
        self, 
        text = "",
        place_holder_text = "",
        radius = 8,
        border_size = 2,
        color = "#FFF",
        selection_color = "#FFF",
        bg_color = "#333",
        bg_color_active = "#fff",
        context_color = "#00ABE8"
    ):
        super().__init__()


        self.lineEdit = QLineEdit(self)
        self.lineEdit.setObjectName(u"lineEdit")

        # PARAMETERS
       # if text:
       #     self.lineEdit.setText(text)
       # if place_holder_text:
       #     self.lineEdit.setPlaceholderText(place_holder_text)

        # SET STYLESHEET
        self.set_stylesheet(
            radius,
            border_size,
            color,
            selection_color,
            bg_color,
            bg_color_active,
            context_color
        )

    # SET STYLESHEET
    def set_stylesheet(
        self,
        radius,
        border_size,
        color,
        selection_color,
        bg_color,
        bg_color_active,
        context_color
    ):
        # APPLY STYLESHEET
        style_format = style.format(
            _radius = radius,
            _border_size = border_size,           
            _color = color,
            _selection_color = selection_color,
            _bg_color = bg_color,
            _bg_color_active = bg_color_active,
            _context_color = context_color
        )
        self.lineEdit.setStyleSheet(style_format)
<filename>builder/widgets/py_line_edit/py_line_edit.py

from qt_core import *

# STYLE
# ///////////////////////////////////////////////////////////////
style = '''
QLineEdit {{
	background-color: {_bg_color};
	border-radius: {_radius}px;
	border: {_border_size}px solid transparent;
	padding-left: 10px;
    padding-right: 10px;
	selection-color: {_selection_color};
	selection-background-color: {_context_color};
    color: {_color};
}}
QLineEdit:focus {{
	border: {_border_size}px solid {_context_color};
    background-color: {_bg_color_active};
}}
'''

# PY PUSH BUTTON
# ///////////////////////////////////////////////////////////////
class PyLineEdit(QLineEdit):
    def __init__(
        self, 
        text = "",
        place_holder_text = "",
        radius = 8,
        border_size = 2,
        color = "#FFF",
        selection_color = "#FFF",
        bg_color = "#333",
        bg_color_active = "#fff",
        context_color = "#00ABE8"
    ):
        super().__init__()


        self.lineEdit = QLineEdit(self)
        self.lineEdit.setObjectName(u"lineEdit")

        # PARAMETERS
       # if text:
       #     self.lineEdit.setText(text)
       # if place_holder_text:
       #     self.lineEdit.setPlaceholderText(place_holder_text)

        # SET STYLESHEET
        self.set_stylesheet(
            radius,
            border_size,
            color,
            selection_color,
            bg_color,
            bg_color_active,
            context_color
        )

    # SET STYLESHEET
    def set_stylesheet(
        self,
        radius,
        border_size,
        color,
        selection_color,
        bg_color,
        bg_color_active,
        context_color
    ):
        # APPLY STYLESHEET
        style_format = style.format(
            _radius = radius,
            _border_size = border_size,           
            _color = color,
            _selection_color = selection_color,
            _bg_color = bg_color,
            _bg_color_active = bg_color_active,
            _context_color = context_color
        )
        self.lineEdit.setStyleSheet(style_format)
# STYLE # /////////////////////////////////////////////////////////////// QLineEdit {{ 	background-color: {_bg_color}; 	border-radius: {_radius}px; 	border: {_border_size}px solid transparent; 	padding-left: 10px;     padding-right: 10px; 	selection-color: {_selection_color}; 	selection-background-color: {_context_color};     color: {_color}; }} QLineEdit:focus {{ 	border: {_border_size}px solid {_context_color};     background-color: {_bg_color_active}; }} # PY PUSH BUTTON # /////////////////////////////////////////////////////////////// # PARAMETERS # if text: #     self.lineEdit.setText(text) # if place_holder_text: #     self.lineEdit.setPlaceholderText(place_holder_text) # SET STYLESHEET # SET STYLESHEET # APPLY STYLESHEET