MCPcopy Index your code
hub / github.com/geekcomputers/Python / create_account_page

Function create_account_page

bank_managment_system/QTFrontend.py:773–888  ·  view source on GitHub ↗
(parent, title, update_btn=False)

Source from the content-addressed store, hash-verified

771
772
773def create_account_page(parent, title, update_btn=False):
774 page, main_layout = create_page_with_header(parent, title)
775
776 content_frame = create_styled_frame(page)
777 content_frame.setSizePolicy(
778 QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding
779 )
780 content_layout = QtWidgets.QVBoxLayout(content_frame)
781
782 form_frame = create_styled_frame(
783 content_frame,
784 min_size=(400, 200),
785 style="background-color: #ffffff; border-radius: 15px; padding: 10px;",
786 )
787 form_layout = QtWidgets.QVBoxLayout(form_frame)
788 form_layout.setSpacing(3)
789
790 # Define input fields
791 fields = ["Name :", "Age :", "Address", "Balance :", "Mobile number :"]
792 edits = []
793
794 for i, field in enumerate(fields):
795 field_frame, field_edit = create_input_field(
796 form_frame, field, min_label_size=(160, 0)
797 )
798 form_layout.addWidget(field_frame)
799 field_edit.setFont(QtGui.QFont("Arial", 12))
800 if i == 0:
801 name_edit = field_edit
802 elif i == 1:
803 Age_edit = field_edit
804 elif i == 2:
805 Address_edit = field_edit
806 elif i == 3:
807 Balance_edit = field_edit
808 elif i == 4:
809 Mobile_number_edit = field_edit
810 edits.append(field_edit)
811 # Dropdown for account type
812 account_type_label = QtWidgets.QLabel("Account Type :", form_frame)
813 account_type_label.setStyleSheet(
814 "font-size: 14px; font-weight: bold; color: #333333;"
815 )
816 form_layout.addWidget(account_type_label)
817 account_type_dropdown = QtWidgets.QComboBox(form_frame)
818 account_type_dropdown.addItems(["Savings", "Current", "Fixed Deposit"])
819 account_type_dropdown.setStyleSheet("""
820 QComboBox {
821 padding: 5px;
822 border: 1px solid #ccc;
823 border-radius: 4px;
824 background-color: white;
825 min-width: 200px;
826 font-size: 14px;
827 }
828 QComboBox:hover {
829 border: 1px solid #999;
830 }

Callers 1

setup_main_windowFunction · 0.85

Calls 5

create_page_with_headerFunction · 0.85
create_styled_frameFunction · 0.85
create_input_fieldFunction · 0.85
create_styled_buttonFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected